From a259b04f0d5cc73645ddb1a4e6b804743038749a Mon Sep 17 00:00:00 2001 From: slhmy Date: Mon, 2 Oct 2023 00:46:01 +0000 Subject: [PATCH] deploy: 471d81d62dffd0f26f5142f296c4a02da504c804 --- assets/{cssMode.7f89fd13.js => cssMode.4d72dae4.js} | 2 +- ...eemarker2.58e81d19.js => freemarker2.2fa88075.js} | 2 +- ...handlebars.22aac3a6.js => handlebars.ea0bcdcf.js} | 2 +- assets/{html.b47bf8be.js => html.1d3b9bc0.js} | 2 +- .../{htmlMode.deea9223.js => htmlMode.3b4a4064.js} | 2 +- assets/{index.11712c1d.js => index.f5fa5601.js} | 12 ++++++------ ...javascript.e4912f74.js => javascript.085c3588.js} | 2 +- .../{jsonMode.a52e5d0a.js => jsonMode.dd799092.js} | 2 +- assets/{liquid.a63a4f6f.js => liquid.48bc72f5.js} | 2 +- assets/{python.19481683.js => python.a3ce8923.js} | 2 +- assets/{razor.3066de02.js => razor.11bc3a39.js} | 2 +- assets/{tsMode.77d96e96.js => tsMode.87c59f2a.js} | 2 +- ...typescript.e69b2029.js => typescript.dd711b51.js} | 2 +- assets/{xml.6c1a18aa.js => xml.41997ea4.js} | 2 +- assets/{yaml.9fe1d6e2.js => yaml.2bcbf7fc.js} | 2 +- index.html | 2 +- 16 files changed, 21 insertions(+), 21 deletions(-) rename assets/{cssMode.7f89fd13.js => cssMode.4d72dae4.js} (99%) rename assets/{freemarker2.58e81d19.js => freemarker2.2fa88075.js} (99%) rename assets/{handlebars.22aac3a6.js => handlebars.ea0bcdcf.js} (99%) rename assets/{html.b47bf8be.js => html.1d3b9bc0.js} (98%) rename assets/{htmlMode.deea9223.js => htmlMode.3b4a4064.js} (99%) rename assets/{index.11712c1d.js => index.f5fa5601.js} (99%) rename assets/{javascript.e4912f74.js => javascript.085c3588.js} (89%) rename assets/{jsonMode.a52e5d0a.js => jsonMode.dd799092.js} (99%) rename assets/{liquid.a63a4f6f.js => liquid.48bc72f5.js} (98%) rename assets/{python.19481683.js => python.a3ce8923.js} (98%) rename assets/{razor.3066de02.js => razor.11bc3a39.js} (99%) rename assets/{tsMode.77d96e96.js => tsMode.87c59f2a.js} (99%) rename assets/{typescript.e69b2029.js => typescript.dd711b51.js} (98%) rename assets/{xml.6c1a18aa.js => xml.41997ea4.js} (97%) rename assets/{yaml.9fe1d6e2.js => yaml.2bcbf7fc.js} (98%) diff --git a/assets/cssMode.7f89fd13.js b/assets/cssMode.4d72dae4.js similarity index 99% rename from assets/cssMode.7f89fd13.js rename to assets/cssMode.4d72dae4.js index 51f0550e8..9445a3fe6 100644 --- a/assets/cssMode.7f89fd13.js +++ b/assets/cssMode.4d72dae4.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.11712c1d.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.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/freemarker2.58e81d19.js b/assets/freemarker2.2fa88075.js similarity index 99% rename from assets/freemarker2.58e81d19.js rename to assets/freemarker2.2fa88075.js index fdca9b9e2..ff0790b3a 100644 --- a/assets/freemarker2.58e81d19.js +++ b/assets/freemarker2.2fa88075.js @@ -1,4 +1,4 @@ -import{m as F}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/handlebars.22aac3a6.js b/assets/handlebars.ea0bcdcf.js similarity index 99% rename from assets/handlebars.22aac3a6.js rename to assets/handlebars.ea0bcdcf.js index 33f47953f..101681724 100644 --- a/assets/handlebars.22aac3a6.js +++ b/assets/handlebars.ea0bcdcf.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/html.b47bf8be.js b/assets/html.1d3b9bc0.js similarity index 98% rename from assets/html.b47bf8be.js rename to assets/html.1d3b9bc0.js index 36aa00c63..135b97600 100644 --- a/assets/html.b47bf8be.js +++ b/assets/html.1d3b9bc0.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/htmlMode.deea9223.js b/assets/htmlMode.3b4a4064.js similarity index 99% rename from assets/htmlMode.deea9223.js rename to assets/htmlMode.3b4a4064.js index af9ba682a..af300a8b1 100644 --- a/assets/htmlMode.deea9223.js +++ b/assets/htmlMode.3b4a4064.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.11712c1d.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.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/index.11712c1d.js b/assets/index.f5fa5601.js similarity index 99% rename from assets/index.11712c1d.js rename to assets/index.f5fa5601.js index 36eae2e64..db665c91d 100644 --- a/assets/index.11712c1d.js +++ b/assets/index.f5fa5601.js @@ -877,27 +877,27 @@ ${e.toString()}`}}class CH{constructor(e=new cF,t=!1,i,r=fQt){var o;this._servic * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var wyt=Object.defineProperty,xyt=Object.getOwnPropertyDescriptor,Lyt=Object.getOwnPropertyNames,Syt=Object.prototype.hasOwnProperty,Eme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Lyt(e))!Syt.call(n,r)&&r!==t&&wyt(n,r,{get:()=>e[r],enumerable:!(i=xyt(e,r))||i.enumerable});return n},Dyt=(n,e,t)=>(Eme(n,e,"default"),t&&Eme(t,e,"default")),Nw={};Dyt(Nw,yD);var PNe={},MZ={},VNe=class{constructor(n){lo(this,"_languageId");lo(this,"_loadingTriggered");lo(this,"_lazyLoadPromise");lo(this,"_lazyLoadPromiseResolve");lo(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return MZ[n]||(MZ[n]=new VNe(n)),MZ[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,PNe[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function en(n){const e=n.id;PNe[e]=n,Nw.languages.register(n);const t=VNe.getOrCreate(e);Nw.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Nw.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Nw.languages.setLanguageConfiguration(e,i.conf)})}en({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Gt(()=>import("./abap.8d9655f4.js"),[])});en({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Gt(()=>import("./apex.b3189065.js"),[])});en({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Gt(()=>import("./azcli.f7531e17.js"),[])});en({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Gt(()=>import("./bat.9ae253b7.js"),[])});en({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Gt(()=>import("./bicep.a3d6e787.js"),[])});en({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Gt(()=>import("./cameligo.8bf9720b.js"),[])});en({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Gt(()=>import("./clojure.04114cb8.js"),[])});en({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Gt(()=>import("./coffee.28837354.js"),[])});en({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Gt(()=>import("./cpp.deebc619.js"),[])});en({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Gt(()=>import("./cpp.deebc619.js"),[])});en({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Gt(()=>import("./csharp.648409de.js"),[])});en({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Gt(()=>import("./csp.66b6c869.js"),[])});en({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Gt(()=>import("./css.6bedf661.js"),[])});en({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Gt(()=>import("./cypher.00e41e23.js"),[])});en({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Gt(()=>import("./dart.cfde4211.js"),[])});en({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Gt(()=>import("./dockerfile.84a15201.js"),[])});en({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Gt(()=>import("./ecl.5abc946e.js"),[])});en({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Gt(()=>import("./elixir.db33105a.js"),[])});en({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Gt(()=>import("./flow9.1d4111c6.js"),[])});en({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Gt(()=>import("./fsharp.93aab1ff.js"),[])});en({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagAutoInterpolationDollar)});en({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagAngleInterpolationDollar)});en({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagBracketInterpolationDollar)});en({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagAngleInterpolationBracket)});en({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagBracketInterpolationBracket)});en({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagAutoInterpolationDollar)});en({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.58e81d19.js"),[]).then(n=>n.TagAutoInterpolationBracket)});en({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Gt(()=>import("./go.98392917.js"),[])});en({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Gt(()=>import("./graphql.bf914c4a.js"),[])});en({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Gt(()=>import("./handlebars.22aac3a6.js"),[])});en({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Gt(()=>import("./hcl.4f8b160a.js"),[])});en({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:()=>Gt(()=>import("./html.b47bf8be.js"),[])});en({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Gt(()=>import("./ini.977f833e.js"),[])});en({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Gt(()=>import("./java.ae14ac73.js"),[])});en({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Gt(()=>import("./javascript.e4912f74.js"),["assets/javascript.e4912f74.js","assets/typescript.e69b2029.js"])});en({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Gt(()=>import("./julia.dd67b955.js"),[])});en({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Gt(()=>import("./kotlin.23505027.js"),[])});en({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Gt(()=>import("./less.738fa250.js"),[])});en({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Gt(()=>import("./lexon.529339b0.js"),[])});en({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Gt(()=>import("./lua.18489a57.js"),[])});en({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Gt(()=>import("./liquid.a63a4f6f.js"),[])});en({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Gt(()=>import("./m3.a6ef8080.js"),[])});en({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Gt(()=>import("./markdown.91cb7aa5.js"),[])});en({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Gt(()=>import("./mips.e7073e82.js"),[])});en({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Gt(()=>import("./msdax.33524897.js"),[])});en({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Gt(()=>import("./mysql.22cfb043.js"),[])});en({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Gt(()=>import("./objective-c.33bdf997.js"),[])});en({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Gt(()=>import("./pascal.633311c1.js"),[])});en({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Gt(()=>import("./pascaligo.d06b8aeb.js"),[])});en({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Gt(()=>import("./perl.6e113f1a.js"),[])});en({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Gt(()=>import("./pgsql.9b5e9017.js"),[])});en({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Gt(()=>import("./php.78d0eac3.js"),[])});en({id:"pla",extensions:[".pla"],loader:()=>Gt(()=>import("./pla.151fc74d.js"),[])});en({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Gt(()=>import("./postiats.17b61568.js"),[])});en({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Gt(()=>import("./powerquery.f8c48499.js"),[])});en({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Gt(()=>import("./powershell.609e2cf8.js"),[])});en({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Gt(()=>import("./protobuf.b1b6abd2.js"),[])});en({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Gt(()=>import("./pug.ee488ef4.js"),[])});en({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Gt(()=>import("./python.19481683.js"),[])});en({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Gt(()=>import("./qsharp.c080fdf2.js"),[])});en({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Gt(()=>import("./r.46e01e78.js"),[])});en({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Gt(()=>import("./razor.3066de02.js"),[])});en({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Gt(()=>import("./redis.435c6619.js"),[])});en({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Gt(()=>import("./redshift.99a0e43e.js"),[])});en({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Gt(()=>import("./restructuredtext.1c9767eb.js"),[])});en({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Gt(()=>import("./ruby.a72a608d.js"),[])});en({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Gt(()=>import("./rust.5054347b.js"),[])});en({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Gt(()=>import("./sb.9c04a17e.js"),[])});en({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:()=>Gt(()=>import("./scala.963f3b7e.js"),[])});en({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Gt(()=>import("./scheme.ba91b63a.js"),[])});en({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Gt(()=>import("./scss.e98cebc6.js"),[])});en({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Gt(()=>import("./shell.a82e99e2.js"),[])});en({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Gt(()=>import("./solidity.b8e46684.js"),[])});en({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Gt(()=>import("./sophia.1771ec47.js"),[])});en({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Gt(()=>import("./sparql.2a37b27c.js"),[])});en({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Gt(()=>import("./sql.38f3f2d0.js"),[])});en({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:()=>Gt(()=>import("./st.f2e86a7e.js"),[])});en({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Gt(()=>import("./swift.d105dd84.js"),[])});en({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Gt(()=>import("./systemverilog.fd8f498a.js"),[])});en({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Gt(()=>import("./systemverilog.fd8f498a.js"),[])});en({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Gt(()=>import("./tcl.bce48484.js"),[])});en({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Gt(()=>import("./twig.638e34ac.js"),[])});en({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Gt(()=>import("./typescript.e69b2029.js"),[])});en({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Gt(()=>import("./vb.1c00933e.js"),[])});en({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Gt(()=>import("./wgsl.eaaedc4b.js"),[])});en({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Gt(()=>import("./xml.6c1a18aa.js"),[])});en({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Gt(()=>import("./yaml.9fe1d6e2.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var wyt=Object.defineProperty,xyt=Object.getOwnPropertyDescriptor,Lyt=Object.getOwnPropertyNames,Syt=Object.prototype.hasOwnProperty,Eme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Lyt(e))!Syt.call(n,r)&&r!==t&&wyt(n,r,{get:()=>e[r],enumerable:!(i=xyt(e,r))||i.enumerable});return n},Dyt=(n,e,t)=>(Eme(n,e,"default"),t&&Eme(t,e,"default")),Nw={};Dyt(Nw,yD);var PNe={},MZ={},VNe=class{constructor(n){lo(this,"_languageId");lo(this,"_loadingTriggered");lo(this,"_lazyLoadPromise");lo(this,"_lazyLoadPromiseResolve");lo(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return MZ[n]||(MZ[n]=new VNe(n)),MZ[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,PNe[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function en(n){const e=n.id;PNe[e]=n,Nw.languages.register(n);const t=VNe.getOrCreate(e);Nw.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Nw.languages.onLanguageEncountered(e,async()=>{const i=await t.load();Nw.languages.setLanguageConfiguration(e,i.conf)})}en({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Gt(()=>import("./abap.8d9655f4.js"),[])});en({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Gt(()=>import("./apex.b3189065.js"),[])});en({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Gt(()=>import("./azcli.f7531e17.js"),[])});en({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Gt(()=>import("./bat.9ae253b7.js"),[])});en({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Gt(()=>import("./bicep.a3d6e787.js"),[])});en({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Gt(()=>import("./cameligo.8bf9720b.js"),[])});en({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Gt(()=>import("./clojure.04114cb8.js"),[])});en({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Gt(()=>import("./coffee.28837354.js"),[])});en({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Gt(()=>import("./cpp.deebc619.js"),[])});en({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Gt(()=>import("./cpp.deebc619.js"),[])});en({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Gt(()=>import("./csharp.648409de.js"),[])});en({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Gt(()=>import("./csp.66b6c869.js"),[])});en({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Gt(()=>import("./css.6bedf661.js"),[])});en({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Gt(()=>import("./cypher.00e41e23.js"),[])});en({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Gt(()=>import("./dart.cfde4211.js"),[])});en({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Gt(()=>import("./dockerfile.84a15201.js"),[])});en({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Gt(()=>import("./ecl.5abc946e.js"),[])});en({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Gt(()=>import("./elixir.db33105a.js"),[])});en({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Gt(()=>import("./flow9.1d4111c6.js"),[])});en({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Gt(()=>import("./fsharp.93aab1ff.js"),[])});en({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagAutoInterpolationDollar)});en({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagAngleInterpolationDollar)});en({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagBracketInterpolationDollar)});en({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagAngleInterpolationBracket)});en({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagBracketInterpolationBracket)});en({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagAutoInterpolationDollar)});en({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Gt(()=>import("./freemarker2.2fa88075.js"),[]).then(n=>n.TagAutoInterpolationBracket)});en({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Gt(()=>import("./go.98392917.js"),[])});en({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Gt(()=>import("./graphql.bf914c4a.js"),[])});en({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Gt(()=>import("./handlebars.ea0bcdcf.js"),[])});en({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Gt(()=>import("./hcl.4f8b160a.js"),[])});en({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:()=>Gt(()=>import("./html.1d3b9bc0.js"),[])});en({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Gt(()=>import("./ini.977f833e.js"),[])});en({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Gt(()=>import("./java.ae14ac73.js"),[])});en({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Gt(()=>import("./javascript.085c3588.js"),["assets/javascript.085c3588.js","assets/typescript.dd711b51.js"])});en({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Gt(()=>import("./julia.dd67b955.js"),[])});en({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Gt(()=>import("./kotlin.23505027.js"),[])});en({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Gt(()=>import("./less.738fa250.js"),[])});en({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Gt(()=>import("./lexon.529339b0.js"),[])});en({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Gt(()=>import("./lua.18489a57.js"),[])});en({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Gt(()=>import("./liquid.48bc72f5.js"),[])});en({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Gt(()=>import("./m3.a6ef8080.js"),[])});en({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Gt(()=>import("./markdown.91cb7aa5.js"),[])});en({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Gt(()=>import("./mips.e7073e82.js"),[])});en({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Gt(()=>import("./msdax.33524897.js"),[])});en({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Gt(()=>import("./mysql.22cfb043.js"),[])});en({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Gt(()=>import("./objective-c.33bdf997.js"),[])});en({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Gt(()=>import("./pascal.633311c1.js"),[])});en({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Gt(()=>import("./pascaligo.d06b8aeb.js"),[])});en({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Gt(()=>import("./perl.6e113f1a.js"),[])});en({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Gt(()=>import("./pgsql.9b5e9017.js"),[])});en({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Gt(()=>import("./php.78d0eac3.js"),[])});en({id:"pla",extensions:[".pla"],loader:()=>Gt(()=>import("./pla.151fc74d.js"),[])});en({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Gt(()=>import("./postiats.17b61568.js"),[])});en({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Gt(()=>import("./powerquery.f8c48499.js"),[])});en({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Gt(()=>import("./powershell.609e2cf8.js"),[])});en({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Gt(()=>import("./protobuf.b1b6abd2.js"),[])});en({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Gt(()=>import("./pug.ee488ef4.js"),[])});en({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Gt(()=>import("./python.a3ce8923.js"),[])});en({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Gt(()=>import("./qsharp.c080fdf2.js"),[])});en({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Gt(()=>import("./r.46e01e78.js"),[])});en({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Gt(()=>import("./razor.11bc3a39.js"),[])});en({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Gt(()=>import("./redis.435c6619.js"),[])});en({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Gt(()=>import("./redshift.99a0e43e.js"),[])});en({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Gt(()=>import("./restructuredtext.1c9767eb.js"),[])});en({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Gt(()=>import("./ruby.a72a608d.js"),[])});en({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Gt(()=>import("./rust.5054347b.js"),[])});en({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Gt(()=>import("./sb.9c04a17e.js"),[])});en({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:()=>Gt(()=>import("./scala.963f3b7e.js"),[])});en({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Gt(()=>import("./scheme.ba91b63a.js"),[])});en({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Gt(()=>import("./scss.e98cebc6.js"),[])});en({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Gt(()=>import("./shell.a82e99e2.js"),[])});en({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Gt(()=>import("./solidity.b8e46684.js"),[])});en({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Gt(()=>import("./sophia.1771ec47.js"),[])});en({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Gt(()=>import("./sparql.2a37b27c.js"),[])});en({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Gt(()=>import("./sql.38f3f2d0.js"),[])});en({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib"],aliases:["StructuredText","scl","stl"],loader:()=>Gt(()=>import("./st.f2e86a7e.js"),[])});en({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Gt(()=>import("./swift.d105dd84.js"),[])});en({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Gt(()=>import("./systemverilog.fd8f498a.js"),[])});en({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Gt(()=>import("./systemverilog.fd8f498a.js"),[])});en({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Gt(()=>import("./tcl.bce48484.js"),[])});en({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Gt(()=>import("./twig.638e34ac.js"),[])});en({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Gt(()=>import("./typescript.dd711b51.js"),[])});en({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Gt(()=>import("./vb.1c00933e.js"),[])});en({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Gt(()=>import("./wgsl.eaaedc4b.js"),[])});en({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Gt(()=>import("./xml.41997ea4.js"),[])});en({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Gt(()=>import("./yaml.2bcbf7fc.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Eyt=Object.defineProperty,kyt=Object.getOwnPropertyDescriptor,Myt=Object.getOwnPropertyNames,Ayt=Object.prototype.hasOwnProperty,kme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Myt(e))!Ayt.call(n,r)&&r!==t&&Eyt(n,r,{get:()=>e[r],enumerable:!(i=kyt(e,r))||i.enumerable});return n},Nyt=(n,e,t)=>(kme(n,e,"default"),t&&kme(t,e,"default")),lb={};Nyt(lb,yD);var Uue=class{constructor(n,e,t){lo(this,"_onDidChange",new lb.Emitter);lo(this,"_options");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,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(n){this._options=n||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(n){this.setOptions(n)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},que={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}},Gue={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},FNe=new Uue("css",que,Gue),BNe=new Uue("scss",que,Gue),$Ne=new Uue("less",que,Gue);lb.languages.css={cssDefaults:FNe,lessDefaults:$Ne,scssDefaults:BNe};function Kue(){return Gt(()=>import("./cssMode.7f89fd13.js"),[])}lb.languages.onLanguage("less",()=>{Kue().then(n=>n.setupMode($Ne))});lb.languages.onLanguage("scss",()=>{Kue().then(n=>n.setupMode(BNe))});lb.languages.onLanguage("css",()=>{Kue().then(n=>n.setupMode(FNe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Eyt=Object.defineProperty,kyt=Object.getOwnPropertyDescriptor,Myt=Object.getOwnPropertyNames,Ayt=Object.prototype.hasOwnProperty,kme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Myt(e))!Ayt.call(n,r)&&r!==t&&Eyt(n,r,{get:()=>e[r],enumerable:!(i=kyt(e,r))||i.enumerable});return n},Nyt=(n,e,t)=>(kme(n,e,"default"),t&&kme(t,e,"default")),lb={};Nyt(lb,yD);var Uue=class{constructor(n,e,t){lo(this,"_onDidChange",new lb.Emitter);lo(this,"_options");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,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(n){this._options=n||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(n){this.setOptions(n)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},que={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}},Gue={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},FNe=new Uue("css",que,Gue),BNe=new Uue("scss",que,Gue),$Ne=new Uue("less",que,Gue);lb.languages.css={cssDefaults:FNe,lessDefaults:$Ne,scssDefaults:BNe};function Kue(){return Gt(()=>import("./cssMode.4d72dae4.js"),[])}lb.languages.onLanguage("less",()=>{Kue().then(n=>n.setupMode($Ne))});lb.languages.onLanguage("scss",()=>{Kue().then(n=>n.setupMode(BNe))});lb.languages.onLanguage("css",()=>{Kue().then(n=>n.setupMode(FNe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Oyt=Object.defineProperty,Iyt=Object.getOwnPropertyDescriptor,Ryt=Object.getOwnPropertyNames,Hyt=Object.prototype.hasOwnProperty,Mme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ryt(e))!Hyt.call(n,r)&&r!==t&&Oyt(n,r,{get:()=>e[r],enumerable:!(i=Iyt(e,r))||i.enumerable});return n},Pyt=(n,e,t)=>(Mme(n,e,"default"),t&&Mme(t,e,"default")),NF={};Pyt(NF,yD);var Vyt=class{constructor(n,e,t){lo(this,"_onDidChange",new NF.Emitter);lo(this,"_options");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,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(n){this._options=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},Fyt={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"},OF={format:Fyt,suggest:{},data:{useDefaultDataProvider:!0}};function IF(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===vx,documentFormattingEdits:n===vx,documentRangeFormattingEdits:n===vx}}var vx="html",Ame="handlebars",Nme="razor",jNe=RF(vx,OF,IF(vx)),Byt=jNe.defaults,WNe=RF(Ame,OF,IF(Ame)),$yt=WNe.defaults,zNe=RF(Nme,OF,IF(Nme)),jyt=zNe.defaults;NF.languages.html={htmlDefaults:Byt,razorDefaults:jyt,handlebarDefaults:$yt,htmlLanguageService:jNe,handlebarLanguageService:WNe,razorLanguageService:zNe,registerHTMLLanguageService:RF};function Wyt(){return Gt(()=>import("./htmlMode.deea9223.js"),[])}function RF(n,e=OF,t=IF(n)){const i=new Vyt(n,e,t);let r;const o=NF.languages.onLanguage(n,async()=>{r=(await Wyt()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Oyt=Object.defineProperty,Iyt=Object.getOwnPropertyDescriptor,Ryt=Object.getOwnPropertyNames,Hyt=Object.prototype.hasOwnProperty,Mme=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ryt(e))!Hyt.call(n,r)&&r!==t&&Oyt(n,r,{get:()=>e[r],enumerable:!(i=Iyt(e,r))||i.enumerable});return n},Pyt=(n,e,t)=>(Mme(n,e,"default"),t&&Mme(t,e,"default")),NF={};Pyt(NF,yD);var Vyt=class{constructor(n,e,t){lo(this,"_onDidChange",new NF.Emitter);lo(this,"_options");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,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(n){this._options=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},Fyt={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"},OF={format:Fyt,suggest:{},data:{useDefaultDataProvider:!0}};function IF(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===vx,documentFormattingEdits:n===vx,documentRangeFormattingEdits:n===vx}}var vx="html",Ame="handlebars",Nme="razor",jNe=RF(vx,OF,IF(vx)),Byt=jNe.defaults,WNe=RF(Ame,OF,IF(Ame)),$yt=WNe.defaults,zNe=RF(Nme,OF,IF(Nme)),jyt=zNe.defaults;NF.languages.html={htmlDefaults:Byt,razorDefaults:jyt,handlebarDefaults:$yt,htmlLanguageService:jNe,handlebarLanguageService:WNe,razorLanguageService:zNe,registerHTMLLanguageService:RF};function Wyt(){return Gt(()=>import("./htmlMode.3b4a4064.js"),[])}function RF(n,e=OF,t=IF(n)){const i=new Vyt(n,e,t);let r;const o=NF.languages.onLanguage(n,async()=>{r=(await Wyt()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var zyt=Object.defineProperty,Uyt=Object.getOwnPropertyDescriptor,qyt=Object.getOwnPropertyNames,Gyt=Object.prototype.hasOwnProperty,Ome=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qyt(e))!Gyt.call(n,r)&&r!==t&&zyt(n,r,{get:()=>e[r],enumerable:!(i=Uyt(e,r))||i.enumerable});return n},Kyt=(n,e,t)=>(Ome(n,e,"default"),t&&Ome(t,e,"default")),_D={};Kyt(_D,yD);var Zyt=class{constructor(n,e,t){lo(this,"_onDidChange",new _D.Emitter);lo(this,"_diagnosticsOptions");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},Xyt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Yyt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},UNe=new Zyt("json",Xyt,Yyt);_D.languages.json={jsonDefaults:UNe};function Jyt(){return Gt(()=>import("./jsonMode.a52e5d0a.js"),[])}_D.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});_D.languages.onLanguage("json",()=>{Jyt().then(n=>n.setupMode(UNe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var zyt=Object.defineProperty,Uyt=Object.getOwnPropertyDescriptor,qyt=Object.getOwnPropertyNames,Gyt=Object.prototype.hasOwnProperty,Ome=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qyt(e))!Gyt.call(n,r)&&r!==t&&zyt(n,r,{get:()=>e[r],enumerable:!(i=Uyt(e,r))||i.enumerable});return n},Kyt=(n,e,t)=>(Ome(n,e,"default"),t&&Ome(t,e,"default")),_D={};Kyt(_D,yD);var Zyt=class{constructor(n,e,t){lo(this,"_onDidChange",new _D.Emitter);lo(this,"_diagnosticsOptions");lo(this,"_modeConfiguration");lo(this,"_languageId");this._languageId=n,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},Xyt={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Yyt={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},UNe=new Zyt("json",Xyt,Yyt);_D.languages.json={jsonDefaults:UNe};function Jyt(){return Gt(()=>import("./jsonMode.dd799092.js"),[])}_D.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});_D.languages.onLanguage("json",()=>{Jyt().then(n=>n.setupMode(UNe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var e_t=Object.defineProperty,t_t=Object.getOwnPropertyDescriptor,n_t=Object.getOwnPropertyNames,i_t=Object.prototype.hasOwnProperty,Ime=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of n_t(e))!i_t.call(n,r)&&r!==t&&e_t(n,r,{get:()=>e[r],enumerable:!(i=t_t(e,r))||i.enumerable});return n},r_t=(n,e,t)=>(Ime(n,e,"default"),t&&Ime(t,e,"default")),o_t="5.0.2",cQ={};r_t(cQ,yD);var qNe=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(qNe||{}),GNe=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(GNe||{}),KNe=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(KNe||{}),ZNe=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(ZNe||{}),XNe=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(XNe||{}),YNe=class{constructor(n,e,t,i,r){lo(this,"_onDidChange",new cQ.Emitter);lo(this,"_onDidExtraLibsChange",new cQ.Emitter);lo(this,"_extraLibs");lo(this,"_removedExtraLibs");lo(this,"_eagerModelSync");lo(this,"_compilerOptions");lo(this,"_diagnosticsOptions");lo(this,"_workerOptions");lo(this,"_onDidExtraLibsChangeTimeout");lo(this,"_inlayHintsOptions");lo(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];!r||r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},s_t=o_t,JNe={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},eOe=new YNe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},JNe),tOe=new YNe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},JNe),a_t=()=>HF().then(n=>n.getTypeScriptWorker()),l_t=()=>HF().then(n=>n.getJavaScriptWorker());cQ.languages.typescript={ModuleKind:qNe,JsxEmit:GNe,NewLineKind:KNe,ScriptTarget:ZNe,ModuleResolutionKind:XNe,typescriptVersion:s_t,typescriptDefaults:eOe,javascriptDefaults:tOe,getTypeScriptWorker:a_t,getJavaScriptWorker:l_t};function HF(){return Gt(()=>import("./tsMode.77d96e96.js"),[])}cQ.languages.onLanguage("typescript",()=>HF().then(n=>n.setupTypeScript(eOe)));cQ.languages.onLanguage("javascript",()=>HF().then(n=>n.setupJavaScript(tOe)));var u_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PF=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const VF=new It("selectionAnchorSet",!1);let r6=class nOe{static get(e){return e.getContribution(nOe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=VF.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(Ht.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Gl().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ys(w("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(Ht.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()}};r6.ID="editor.contrib.selectionAnchorController";r6=u_t([c_t(1,_n)],r6);class d_t extends Ot{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:ws(2089,2080),weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class h_t extends Ot{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:VF})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class f_t extends Ot{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:VF,kbOpts:{kbExpr:oe.editorTextFocus,primary:ws(2089,2089),weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class p_t extends Ot{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:VF,kbOpts:{kbExpr:oe.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}yi(r6.ID,r6,4);dt(d_t);dt(h_t);dt(f_t);dt(p_t);const g_t=de("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class m_t extends Ot{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.jumpToBracket()}}class T_t extends Ot{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var r;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(r=Ed.get(t))===null||r===void 0||r.selectToBracket(o)}}class v_t extends Ot{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class Q_t{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ed extends Pe{static get(e){return e.getContribution(Ed.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Qr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(69),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(69)&&(this._matchBrackets=this._editor.getOption(69),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const r=i.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new Ht(s.lineNumber,s.column,s.lineNumber,s.column):new Ht(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const u=t.bracketPairs.findNextBracket(o);u&&u.range&&(s=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(G.compareRangesUsingStarts);const[u,c]=s;if(a=e?u.getStartPosition():u.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&i.push(new Ht(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const r=i.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const r=i.brackets;r&&(e[t++]={range:r[0],options:i.options},e[t++]={range:r[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let r=[];this._lastVersionId===i&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(De.compare);const a=[];let l=0,u=0;const c=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}dt(C_t);var w_t=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const c8="9_cutcopypaste",x_t=F2||document.queryCommandSupported("cut"),rOe=F2||document.queryCommandSupported("copy"),L_t=typeof navigator.clipboard>"u"||I1?document.queryCommandSupported("paste"):!0;function Zue(n){return n.register(),n}const S_t=x_t?Zue(new tb({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:F2?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1}]})):void 0,D_t=rOe?Zue(new tb({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:F2?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;xl.appendMenuItem(se.MenubarEditMenu,{submenu:se.MenubarCopy,title:{value:w("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextCopy,title:{value:w("copy as","Copy As"),original:"Copy As"},group:c8,order:3});xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1,when:ct.and(ct.notEquals("resourceScheme","output"),oe.editorTextFocus)});xl.appendMenuItem(se.EditorTitleContext,{submenu:se.EditorTitleContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1});xl.appendMenuItem(se.ExplorerContext,{submenu:se.ExplorerContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1});const AZ=L_t?Zue(new tb({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:F2?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4}]})):void 0;class E_t extends Ot{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(35)&&t.getSelection().isEmpty()||(tne.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),tne.forceCopyWithSyntaxHighlighting=!1)}}function oOe(n,e){!n||(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Mi).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(35),s=r.getSelection();return s&&s.isEmpty()&&!o||document.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}oOe(S_t,"cut");oOe(D_t,"copy");AZ&&(AZ.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(Mi),i=n.get(Q6),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?!document.execCommand("paste")&&C7?(()=>w_t(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=fL.INSTANCE.get(s);let l=!1,u=null,c=null;a&&(l=r.getOption(35)&&!!a.isFromEmptySelection,u=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),r.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:u,mode:c})}}))():!0:!1}),AZ.addImplementation(0,"generic-dom",(n,e)=>(document.execCommand("paste"),!0)));rOe&&dt(E_t);var k_t=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Mn{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+Mn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Mn(this.value+Mn.sep+e)}}Mn.sep=".";Mn.None=new Mn("@@none@@");Mn.Empty=new Mn("");Mn.QuickFix=new Mn("quickfix");Mn.Refactor=new Mn("refactor");Mn.RefactorExtract=Mn.Refactor.append("extract");Mn.RefactorInline=Mn.Refactor.append("inline");Mn.RefactorMove=Mn.Refactor.append("move");Mn.RefactorRewrite=Mn.Refactor.append("rewrite");Mn.Source=new Mn("source");Mn.SourceOrganizeImports=Mn.Source.append("organizeImports");Mn.SourceFixAll=Mn.Source.append("fixAll");Mn.SurroundWith=Mn.Refactor.append("surround");var Gc;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(Gc||(Gc={}));function M_t(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>sOe(e,t,n.include))||!n.includeSourceActions&&Mn.Source.contains(e))}function A_t(n,e){const t=e.kind?new Mn(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>sOe(t,i,n.include))||!n.includeSourceActions&&t&&Mn.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function sOe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class ch{static fromUser(e,t){return!e||typeof e!="object"?new ch(t.kind,t.apply,!1):new ch(ch.getKindFromUser(e,t.kind),ch.getApplyFromUser(e,t.apply),ch.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 Mn(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class N_t{constructor(e,t){this.action=e,this.provider=t}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 i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(r){Cs(r)}i&&(this.action.edit=i.edit)}return this})}}var LH=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const aOe="editor.action.codeAction",Xue="editor.action.quickFix",lOe="editor.action.autoFix",uOe="editor.action.refactor",cOe="editor.action.sourceAction",Yue="editor.action.organizeImports",Jue="editor.action.fixAll";class Qx extends Pe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ol(e.diagnostics)?ol(t.diagnostics)?Qx.codeActionsPreferredComparator(e,t):-1:ol(t.diagnostics)?1:Qx.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Qx.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Mn.QuickFix.contains(new Mn(e.kind))&&!!e.isPreferred)}}const Rme={actions:[],documentation:void 0};function ece(n,e,t,i,r,o){var s;return LH(this,void 0,void 0,function*(){const a=i.filter||{},l={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},u=new Wue(e,o),c=O_t(n,e,a),d=new st,h=c.map(g=>LH(this,void 0,void 0,function*(){try{r.report(g);const T=yield g.provideCodeActions(e,t,l,u.token);if(T&&d.add(T),u.token.isCancellationRequested)return Rme;const v=((T==null?void 0:T.actions)||[]).filter(b=>b&&A_t(a,b)),Q=R_t(g,v,a.include);return{actions:v.map(b=>new N_t(b,g)),documentation:Q}}catch(T){if(u0(T))throw T;return Cs(T),Rme}})),f=n.onDidChange(()=>{const g=n.all(e);Na(g,c)||u.cancel()});try{const g=yield Promise.all(h),T=g.map(Q=>Q.actions).flat(),v=[...Rh(g.map(Q=>Q.documentation)),...I_t(n,e,i,T)];return new Qx(T,v,d)}finally{f.dispose(),u.dispose()}})}function O_t(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>M_t(t,new Mn(r))):!0)}function*I_t(n,e,t,i){var r,o,s;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},i.map(l=>l.action)))}function R_t(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new Mn(r.kind),command:r.command}));if(t){let r;for(const o of i)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(!!r.kind){for(const o of i)if(o.kind.contains(new Mn(r.kind)))return o.command}}var SH;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(SH||(SH={}));function H_t(n,e,t,i,r=Jn.None){var o;return LH(this,void 0,void 0,function*(){const s=n.get(gD),a=n.get(Qo),l=n.get(Jc),u=n.get(Fo);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield s.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==SH.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const d=P_t(c);u.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function P_t(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}mi.registerCommand("_executeCodeActionProvider",function(n,e,t,i,r){return LH(this,void 0,void 0,function*(){if(!(e instanceof on))throw E1();const{codeActionProvider:o}=n.get(Vt),s=n.get(Kr).getModel(e);if(!s)throw E1();const a=Ht.isISelection(t)?Ht.liftSelection(t):G.isIRange(t)?s.validateRange(t):void 0;if(!a)throw E1();const l=typeof i=="string"?new Mn(i):void 0,u=yield ece(o,s,a,{type:1,triggerAction:Gc.Default,filter:{includeSourceActions:!0,include:l}},J8.None,Jn.None),c=[],d=Math.min(u.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>u.dispose(),100)}})});var V_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DH=class dOe{constructor(e){this.keybindingService=e}getResolver(){const e=new Jh(()=>this.keybindingService.getKeybindings().filter(t=>dOe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Yue?i={kind:Mn.SourceOrganizeImports.value}:t.command===Jue&&(i={kind:Mn.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},ch.fromUser(i,{kind:Mn.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Mn(e.kind);return t.filter(r=>r.kind.contains(i)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};DH.codeActionCommands=[uOe,aOe,cOe,Yue,Jue];DH=V_t([F_t(0,Ir)],DH);de("symbolIcon.arrayForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.booleanForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.colorForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.constantForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.fileForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.folderForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.keyForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.keywordForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.moduleForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.namespaceForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.nullForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.numberForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.objectForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.operatorForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.packageForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.propertyForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.referenceForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.snippetForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.stringForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.structForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.textForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.typeParameterForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.unitForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const hOe=Object.freeze({kind:Mn.Empty,title:w("codeAction.widget.id.more","More Actions...")}),B_t=Object.freeze([{kind:Mn.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix...")},{kind:Mn.RefactorExtract,title:w("codeAction.widget.id.extract","Extract..."),icon:_t.wrench},{kind:Mn.RefactorInline,title:w("codeAction.widget.id.inline","Inline..."),icon:_t.wrench},{kind:Mn.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite..."),icon:_t.wrench},{kind:Mn.RefactorMove,title:w("codeAction.widget.id.move","Move..."),icon:_t.wrench},{kind:Mn.SurroundWith,title:w("codeAction.widget.id.surround","Surround With..."),icon:_t.symbolSnippet},{kind:Mn.Source,title:w("codeAction.widget.id.source","Source Action..."),icon:_t.symbolFile},hOe]);function $_t(n,e,t){if(!e)return n.map(o=>({kind:"action",item:o,group:hOe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title}));const i=B_t.map(o=>({group:o,actions:[]}));for(const o of n){const s=o.action.kind?new Mn(o.action.kind):Mn.None;for(const a of i)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of i)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions)r.push({kind:"action",item:s,group:o.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return r}var j_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},KT;(function(n){n.Hidden={type:0};class e{constructor(i,r,o,s){this.actions=i,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}n.Showing=e})(KT||(KT={}));let d8=class fOe extends Pe{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new xe),this.onClick=this._onClick.event,this._state=KT.Hidden,this._domNode=at("div.lightBulbWidget"),this._register(gr.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),this._register(u3t(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:o}=Os(this._domNode),s=this._editor.getOption(64);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(62)&&!this._editor.getOption(62).enabled&&this.hide()})),this._register(Ut.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,r;this._preferredKbLabel=ca((i=t.lookupKeybinding(lOe))===null||i===void 0?void 0:i.getLabel()),this._quickFixKbLabel=ca((r=t.lookupKeybinding(Xue))===null||r===void 0?void 0:r.getLabel()),this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const r=this._editor.getOptions();if(!r.get(62).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,u=r.get(48),c=o.getLineContent(s),d=oF(c,l),h=u.spaceWidth*d>22,f=T=>T>2&&this._editor.getTopForLineNumber(T)===this._editor.getTopForLineNumber(T-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*u.spaceWidth<22)return this.hide()}this.state=new KT.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:fOe._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==KT.Hidden&&(this.state=KT.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(...dn.asClassNameArray(_t.lightBulb)),this._domNode.classList.add(...dn.asClassNameArray(_t.lightbulbAutofix)),this._preferredKbLabel)){this.title=w("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...dn.asClassNameArray(_t.lightbulbAutofix)),this._domNode.classList.add(...dn.asClassNameArray(_t.lightBulb)),this._quickFixKbLabel?this.title=w("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=w("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};d8.ID="editor.contrib.lightbulbWidget";d8._posPref=[0];d8=j_t([W_t(1,Ir)],d8);var z_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ic=class Oie{static get(e){return e.getContribution(Oie.ID)}constructor(e,t){this._messageWidget=new Ra,this._messageListeners=new st,this._editor=e,this._visible=Oie.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Ys(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new Hme(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new W1(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(r=>{!r.target.position||(i?i.containsPosition(r.target.position)||this.closeMessage():i=new G(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Hme.fadeOut(this._messageWidget.value))}};ic.ID="editor.contrib.messageController";ic.MESSAGE_VISIBLE=new It("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));ic=z_t([U_t(1,_n)],ic);const q_t=Ps.bindToContribution(ic.get);vt(new q_t({id:"leaveEditorMessage",precondition:ic.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class Hme{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("message"),s.textContent=r,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)}}yi(ic.ID,ic,4);var pOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Iie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const gOe="acceptSelectedCodeAction",mOe="previewSelectedCodeAction";class G_t{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var r,o;i.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Rie=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const r=new vD(e,Ac);return{container:e,icon:t,text:i,keybinding:r}}renderElement(e,t,i){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(i.icon.className=dn.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=At(e.group.icon.color.id))):(i.icon.className=dn.asClassName(_t.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=TOe(e.label),i.keybinding.set(e.keybinding),b3t(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(gOe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(mOe))===null||s===void 0?void 0:s.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview?i.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};Rie=pOe([Iie(1,Ir)],Rie);class K_t extends UIEvent{constructor(){super("acceptSelectedAction")}}class Pme extends UIEvent{constructor(){super("previewSelectedAction")}}let Hie=class extends Pe{constructor(e,t,i,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,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 Wd(e,this.domNode,a,[new Rie(t,this._keybindingService),new G_t],{keyboardSupport:!1,accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let u=l.label?TOe(l==null?void 0:l.label):"";return l.disabled&&(u=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",u,l.disabled)),u}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(em),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this._list.domFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(u=>u.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);const o=this._allMenuItems.map((u,c)=>{const d=document.getElementById(this._list.getElementID(c));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...o,e),a=.7,l=Math.min(r,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 i=t[0],r=this._list.element(i);if(!this.focusCondition(r))return;const o=e?new Pme:new K_t;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Pme):this._list.setSelection([])}onListHover(e){this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Hie=pOe([Iie(4,b6),Iie(5,Ir)],Hie);function TOe(n){return n.replace(/\r\n|\r|\n/g," ")}var Z_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const h8={Visible:new It("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},im=oi("actionWidgetService");let f8=class extends Pe{get isVisible(){return h8.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ra)}show(e,t,i,r,o,s,a){const l=h8.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Hie,e,t,i,r);this._contextViewService.showContextView({getAnchor:()=>o,render:c=>(l.set(!0),this._renderWidget(c,u,a!=null?a:[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},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,i){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new st,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(Ye(l,kt.MOUSE_DOWN,g=>g.stopPropagation()));const u=document.createElement("div"),c=e.appendChild(u);c.classList.add("context-view-pointerBlock"),s.add(Ye(c,kt.POINTER_MOVE,()=>c.remove())),s.add(Ye(c,kt.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(Fh(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const i=at(e),r=new F1(i);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};f8=Z_t([NZ(0,b6),NZ(1,_n),NZ(2,Sn)],f8);gi(im,f8,1);const CD=100+1e3;ps(class extends T6{constructor(){super({id:"hideCodeActionWidget",title:{value:w("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:h8.Visible,keybinding:{weight:CD,primary:9,secondary:[1033]}})}run(n){n.get(im).hide()}});ps(class extends T6{constructor(){super({id:"selectPrevCodeAction",title:{value:w("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:h8.Visible,keybinding:{weight:CD,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(im);e instanceof f8&&e.focusPrevious()}});ps(class extends T6{constructor(){super({id:"selectNextCodeAction",title:{value:w("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:h8.Visible,keybinding:{weight:CD,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(im);e instanceof f8&&e.focusNext()}});ps(class extends T6{constructor(){super({id:gOe,title:{value:w("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:h8.Visible,keybinding:{weight:CD,primary:3,secondary:[2137]}})}run(n){const e=n.get(im);e instanceof f8&&e.acceptSelected()}});ps(class extends T6{constructor(){super({id:mOe,title:{value:w("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:h8.Visible,keybinding:{weight:CD,primary:2051}})}run(n){const e=n.get(im);e instanceof f8&&e.acceptSelected(!0)}});var OZ=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},X_t=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},pT;const vOe=new It("supportedCodeAction","");class Y_t extends Pe{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new W1),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>aF(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Gc.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:r,column:o}=i.getPosition(),s=t.getLineContent(r);if(s.length===0)return;if(o===1){if(/\s/.test(s[0]))return}else if(o===t.getLineMaxColumn(r)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return i}}var pg;(function(n){n.Empty={type:0};class e{constructor(i,r,o){this.trigger=i,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(u0(s))return J_t;throw s})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(pg||(pg={}));const J_t=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class eCt extends Pe{constructor(e,t,i,r,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._codeActionOracle=this._register(new Ra),this._state=pg.Empty,this._onDidChangeState=this._register(new xe),this.onDidChangeState=this._onDidChangeState.event,pT.set(this,!1),this._supportedCodeActions=vOe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){OZ(this,pT,"f")||(X_t(this,pT,!0,"f"),super.dispose(),this.setState(pg.Empty,!0))}_update(){if(OZ(this,pT,"f"))return;this._codeActionOracle.value=void 0,this.setState(pg.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(88)){const t=this._registry.all(e).flatMap(i=>{var r;return(r=i.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Y_t(this._editor,this._markerService,i=>{var r;if(!i){this.setState(pg.Empty);return}const o=bs(s=>ece(this._registry,e,i.selection,i.trigger,J8.None,s));i.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(o,250)),this.setState(new pg.Triggered(i.trigger,i.selection.getStartPosition(),o))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Gc.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&&!OZ(this,pT,"f")&&this._onDidChangeState.fire(e))}}pT=new WeakMap;var tCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},nCt=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},iCt=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},dI;let p8=class QOe extends Pe{static get(e){return e.getContribution(QOe.ID)}constructor(e,t,i,r,o,s,a,l,u,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=u,this._instantiationService=c,this._activeCodeActions=this._register(new Ra),this._showDisabled=!1,dI.set(this,!1),this._editor=e,this._model=this._register(new eCt(this._editor,o.codeActionProvider,t,i,s)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Jh(()=>{const d=this._editor.getContribution(d8.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=r.createInstance(DH),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){nCt(this,dI,!0,"f"),super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,r){var o;if(!this._editor.hasModel())return;(o=ic.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return sN(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(H_t,e,SH.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Gc.QuickFix,filter:{}})}})}update(e){var t,i,r,o,s,a,l;return sN(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let u;try{u=yield e.actions}catch(c){$n(c);return}if(!iCt(this,dI,"f"))if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(u,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,u);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(d,!1,!1)}finally{u.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,u);if(h&&h.action.disabled){(s=ic.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),u.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!u.allActions.length||!c&&!u.validActions.length)){(l=ic.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=u,u.dispose();return}this._activeCodeActions.value=u,this.showCodeActionList(u,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?u.dispose():this._activeCodeActions.value=u})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(!!t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(!!t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return sN(this,void 0,void 0,function*(){const r=this._editor.getDomNode();if(!r)return;const o=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!o.length)return;const s=De.isIPosition(t)?this.toCoords(t):t,a={onSelect:(l,u)=>sN(this,void 0,void 0,function*(){this._applyCodeAction(l,!0,!!u),this._actionWidgetService.hide()}),onHide:()=>{var l;(l=this._editor)===null||l===void 0||l.focus()}};this._actionWidgetService.show("codeActionWidget",!0,$_t(o,this._shouldShowHeaders(),this._resolver.getResolver()),a,s,r,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Os(this._editor.getDomNode()),r=i.left+t.left,o=i.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}};dI=new WeakMap;p8.ID="editor.contrib.codeActionController";p8=tCt([B3(1,i3),B3(2,_n),B3(3,Sn),B3(4,Vt),B3(5,k7),B3(6,Qo),B3(7,bi),B3(8,im),B3(9,Sn)],p8);function wD(n){return ct.regex(vOe.keys()[0],new RegExp("(\\s|^)"+zc(n.value)+"\\b"))}const tce={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function rm(n,e,t,i,r=Gc.Default){if(n.hasModel()){const o=p8.get(n);o==null||o.manualTriggerAtCurrentPosition(e,r,t,i)}}class rCt extends Ot{constructor(){super({id:Xue,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:2137,weight:100}})}run(e,t){return rm(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Gc.QuickFix)}}class oCt extends Ps{constructor(){super({id:aOe,precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:tce}]}})}runEditorCommand(e,t,i){const r=ch.fromUser(i,{kind:Mn.Empty,apply:"ifSingle"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class sCt extends Ot{constructor(){super({id:uOe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ct.and(oe.writable,wD(Mn.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:tce}]}})}run(e,t,i){const r=ch.fromUser(i,{kind:Mn.Refactor,apply:"never"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:Mn.Refactor.contains(r.kind)?r.kind:Mn.None,onlyIncludePreferredActions:r.preferred},r.apply,Gc.Refactor)}}class aCt extends Ot{constructor(){super({id:cOe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ct.and(oe.writable,wD(Mn.Source))},description:{description:"Source Action...",args:[{name:"args",schema:tce}]}})}run(e,t,i){const r=ch.fromUser(i,{kind:Mn.Source,apply:"never"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:Mn.Source.contains(r.kind)?r.kind:Mn.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Gc.SourceAction)}}class lCt extends Ot{constructor(){super({id:Yue,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ct.and(oe.writable,wD(Mn.SourceOrganizeImports)),kbOpts:{kbExpr:oe.textInputFocus,primary:1581,weight:100}})}run(e,t){return rm(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:Mn.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Gc.OrganizeImports)}}class uCt extends Ot{constructor(){super({id:Jue,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:ct.and(oe.writable,wD(Mn.SourceFixAll))})}run(e,t){return rm(t,w("fixAll.noneMessage","No fix all action available"),{include:Mn.SourceFixAll,includeSourceActions:!0},"ifSingle",Gc.FixAll)}}class cCt extends Ot{constructor(){super({id:lOe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ct.and(oe.writable,wD(Mn.QuickFix)),kbOpts:{kbExpr:oe.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return rm(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Mn.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Gc.AutoFix)}}yi(p8.ID,p8,3);yi(d8.ID,d8,4);dt(rCt);dt(sCt);dt(aCt);dt(lCt);dt(cCt);dt(uCt);vt(new oCt);vo.as(g6.Configuration).registerConfiguration(Object.assign(Object.assign({},HAe),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));var Vme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Pie{constructor(){this.lenses=[],this._disposables=new st}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function bOe(n,e,t){return Vme(this,void 0,void 0,function*(){const i=n.ordered(e),r=new Map,o=new Pie,s=i.map((a,l)=>Vme(this,void 0,void 0,function*(){r.set(a,l);try{const u=yield Promise.resolve(a.provideCodeLenses(e,t));u&&o.add(u,a)}catch(u){Cs(u)}}));return yield Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o})}mi.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Xi(on.isUri(t)),Xi(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(Vt),o=n.get(Kr).getModel(t);if(!o)throw E1();const s=[],a=new st;return bOe(r,o,Jn.None).then(l=>{a.add(l);const u=[];for(const c of l.lenses)i==null||Boolean(c.symbol.command)?s.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&u.push(Promise.resolve(c.provider.resolveCodeLens(o,c.symbol,Jn.None)).then(d=>s.push(d||c.symbol)));return Promise.all(u)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var dCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hCt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const yOe=oi("ICodeLensCache");class Fme{constructor(e,t){this.lineCount=e,this.data=t}}let Vie=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new E7(20,.75);const t="codelens/cache";y4(()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r),Hh(e.onWillSaveState)(o=>{o.reason===uH.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=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}}}),r=new Pie;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Fme(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const r=new Set;for(const o of i.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const r=t[i],o=[];for(const a of r.lines)o.push({range:new G(a,1,a,11)});const s=new Pie;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Fme(r.lineCount,s))}}catch{}}};Vie=dCt([hCt(0,qd)],Vie);gi(yOe,Vie,1);class fCt{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class FF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${FF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let r=!1;for(let o=0;o{u.symbol.command&&l.push(u.symbol),i.addDecoration({range:u.symbol.range,options:Bme},d=>this._decorationIds[c]=d),a?a=G.plusRange(a,u.symbol.range):a=G.lift(u.symbol.range)}),this._viewZone=new fCt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new FF(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(i&&G.isEmpty(r.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,r)=>{t.addDecoration({range:i.symbol.range,options:Bme},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let dQ=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new st,this._localToDispose=new st,this._lenses=[],this._oldCodeLensModels=new st,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Qr(()=>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(48)||a.hasChanged(17)||a.hasChanged(16))&&this._updateLensStyle(),a.hasChanged(15)&&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(64)/this._editor.getOption(50));let t=this._editor.getOption(17);return(!t||t<5)&&(t=this._editor.getOption(50)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(16),r=this._editor.getOption(48),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Ju.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(15))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Uf(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Qr(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=bs(s=>bOe(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()-o);i.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},$n)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Bn(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(s),l=c.getLineNumber())});const u=new IZ;a.forEach(c=>{c.dispose(u,s),this._lenses.splice(this._lenses.indexOf(c),1)}),u.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Bn(()=>{if(this._editor.getModel()){const r=Y2.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new IZ;for(const r of this._lenses)r.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],i.push(r)))}if(!i.length&&!this._lenses.length)return;const o=Y2.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const u=new IZ;let c=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),c++,d++)}for(;cthis._resolveCodeLensesInViewportSoon())),d++;u.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),r.push(a))}),i.length===0)return;const o=Date.now(),s=bs(a=>{const l=i.map((u,c)=>{const d=new Array(u.length),h=u.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(T=>{d[g]=T},Cs):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[c].isDisposed()&&r[c].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{$n(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){return this._currentCodeLensModel}};dQ.ID="css.editor.codeLens";dQ=pCt([eC(1,Vt),eC(2,G1),eC(3,Qo),eC(4,Fo),eC(5,yOe)],dQ);yi(dQ.ID,dQ,1);dt(class extends Ot{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:oe.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return gCt(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(c0),r=e.get(Qo),o=e.get(Fo),s=t.getSelection().positionLineNumber,a=t.getContribution(dQ.ID);if(!a)return;const l=a.getModel();if(!l)return;const u=[];for(const d of l.lenses)d.symbol.command&&d.symbol.range.startLineNumber===s&&u.push({label:d.symbol.command.title,command:d.symbol.command});if(u.length===0)return;const c=yield i.pick(u,{canPickMany:!1});if(!!c){if(l.isDisposed)return yield r.executeCommand(this.id);try{yield r.executeCommand(c.command.id,...c.command.arguments||[])}catch(d){o.error(d)}}})}});var mCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class nce{constructor(e,t){this._editorWorkerClient=new dle(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return TCt(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const r=t.range,o=t.color,s=o.alpha,a=new Re(new ci(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?Re.Format.CSS.formatRGB(a):Re.Format.CSS.formatRGBA(a),u=s?Re.Format.CSS.formatHSL(a):Re.Format.CSS.formatHSLA(a),c=s?Re.Format.CSS.formatHex(a):Re.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:u,textEdit:{range:r,text:u}}),d.push({label:c,textEdit:{range:r,text:c}}),d}}let Fie=class extends Pe{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new nce(e,t)))}};Fie=mCt([RZ(0,Kr),RZ(1,br),RZ(2,Vt)],Fie);MF(Fie);var xD=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function _Oe(n,e,t,i=!0){return xD(this,void 0,void 0,function*(){return ice(new vCt,n,e,t,i)})}function COe(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class vCt{constructor(){}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)})}}class QCt{constructor(){}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)})}}class bCt{constructor(e){this.colorInfo=e}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,Jn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)})}}function ice(n,e,t,i,r){return xD(this,void 0,void 0,function*(){let o=!1,s;const a=[],l=e.ordered(t);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c instanceof nce)s=c;else try{(yield n.compute(c,t,i,a))&&(o=!0)}catch(d){Cs(d)}}return o?a:s&&r?(yield n.compute(s,t,i,a),a):[]})}function wOe(n,e){const{colorProvider:t}=n.get(Vt),i=n.get(Kr).getModel(e);if(!i)throw E1();const r=n.get(bi).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}mi.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof on))throw E1();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=wOe(n,t);return ice(new QCt,r,i,Jn.None,o)});mi.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:o}=i;if(!(r instanceof on)||!Array.isArray(t)||t.length!==4||!G.isIRange(o))throw E1();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=wOe(n,r),[u,c,d,h]=t;return ice(new bCt({range:o,color:{red:u,green:c,blue:d,alpha:h}}),a,s,Jn.None,l)});var yCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const xOe=Object.create({});let e7=class LOe extends Pe{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new st),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new aD(this._editor),this._decoratorLimitReporter=new _Ct,this._colorDecorationClassRefs=this._register(new st),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:LOe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(142);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(19),l=o.hasChanged(142);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(142),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const r=i.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(18)}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 W1,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return jme(this,void 0,void 0,function*(){this._computePromise=bs(e=>jme(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new nu(!1),r=yield _Oe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),r}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){$n(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Vn.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(19);for(let o=0;othis._colorDatas.has(r.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};e7.ID="editor.contrib.colorDetector";e7.RECOMPUTE_TIME=1e3;e7=yCt([HZ(1,bi),HZ(2,Vt),HZ(3,G1)],e7);class _Ct{constructor(){this._onDidChange=new xe,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}yi(e7.ID,e7,1);class CCt{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new xe,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new xe,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let r=0;r{this.backgroundColor=s.getColor(DR)||Re.white})),this._register(Ye(this._pickedColorNode,kt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Ye(this._originalColorNode,kt.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=Re.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 xCt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Re.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this._pickedColorNode.prepend(kc(".codicon.codicon-color-mode"))}}class xCt extends Pe{constructor(e){super(),this._onClicked=this._register(new xe),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ge(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ge(this._button,t),Ge(t,kc(".button"+dn.asCSSSelector(Eo("color-picker-close",_t.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class LCt extends Pe{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=kc(".colorpicker-body"),Ge(e,this._domNode),this._saturationBox=new SCt(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 DCt(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new ECt(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new kCt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Re(new hh(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Re(new hh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Re(new hh(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class SCt extends Pe{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,this._domNode=kc(".saturation-wrap"),Ge(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ge(this._domNode,this._canvas),this.selection=kc(".saturation-selection"),Ge(this._domNode,this.selection),this.layout(),this._register(Ye(this._domNode,kt.POINTER_DOWN,r=>this.onPointerDown(r))),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 nb);const t=Os(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const i=Ye(document,kt.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,r),this._onDidChange.fire({s:i,v:r})}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 Re(new hh(e.h,1,1,1)),i=this._canvas.getContext("2d"),r=i.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Re.Format.CSS.format(t),i.fill(),i.fillStyle=r,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class SOe extends Pe{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Ge(e,kc(".standalone-strip")),this.overlay=Ge(this.domNode,kc(".standalone-overlay"))):(this.domNode=Ge(e,kc(".strip")),this.overlay=Ge(this.domNode,kc(".overlay"))),this.slider=Ge(this.domNode,kc(".slider")),this.slider.style.top="0px",this._register(Ye(this.domNode,kt.POINTER_DOWN,r=>this.onPointerDown(r))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new nb),i=Os(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const r=Ye(document,kt.POINTER_UP,()=>{this._onColorFlushed.fire(),r.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 DCt extends SOe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:r}=e.rgba,o=new Re(new ci(t,i,r,1)),s=new Re(new ci(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class ECt extends SOe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class kCt extends Pe{constructor(e){super(),this._onClicked=this._register(new xe),this.onClicked=this._onClicked.event,this._button=Ge(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class MCt extends U1{constructor(e,t,i,r,o=!1){super(),this.model=t,this.pixelRatio=i,this._register($v.onDidChange(()=>this.layout()));const s=kc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new wCt(s,this.model,r,o)),this.body=this._register(new LCt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var DOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hQ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class ACt{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let EH=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Zo.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const r=e7.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[yield kOe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return MOe(this,this._editor,this._themeService,t,e)}};EH=DOe([EOe(1,Vs)],EH);class NCt{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let WL=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!e7.get(this._editor))return null;const o=yield _Oe(i,this._editor.getModel(),Jn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;G.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s!=null?s:e,u=a!=null?a:t,c=!!s;return{colorHover:yield kOe(this,this._editor.getModel(),l,u),foundInEditor:c}})}updateEditorModel(e){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new G(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield hI(this._editor.getModel(),t,this._color,i,e),i=AOe(this._editor,i,t))})}renderHoverParts(e,t){return MOe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};WL=DOe([EOe(1,Vs)],WL);function kOe(n,e,t,i){return hQ(this,void 0,void 0,function*(){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,u=new ci(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),c=new Re(u),d=yield COe(e,t,i,Jn.None),h=new CCt(c,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(c,r),n instanceof EH?new ACt(n,G.lift(t.range),h,i):new NCt(n,G.lift(t.range),h,i)})}function MOe(n,e,t,i,r){if(i.length===0||!e.hasModel())return Pe.None;const o=new st,s=i[0],a=e.getModel(),l=s.model,u=o.add(new MCt(r.fragment,l,e.getOption(138),t,n instanceof WL));r.setColorPicker(u);let c=new G(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(n instanceof WL){const d=i[0].model.color;n.color=d,hI(a,l,d,c,s),o.add(l.onColorFlushed(h=>{n.color=h}))}else o.add(l.onColorFlushed(d=>hQ(this,void 0,void 0,function*(){yield hI(a,l,d,c,s),c=AOe(e,c,l,r)})));return o.add(l.onDidChangeColor(d=>{hI(a,l,d,c,s)})),o}function AOe(n,e,t,i){let r,o;if(t.presentation.textEdit){r=[t.presentation.textEdit],o=new G(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",r),o=n.getModel()._getTrackedRange(s)||o}else r=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",r);return t.presentation.additionalTextEdits&&(r=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",r),i&&i.hide()),n.pushUndoStop(),o}function hI(n,e,t,i,r){return hQ(this,void 0,void 0,function*(){const o=yield COe(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Jn.None);e.colorPresentations=o||[]})}function Bie(n,e){return!!n[e]}class PZ{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Bie(e.event,t.triggerModifier),this.hasSideBySideModifier=Bie(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Wme{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Bie(e,t.triggerModifier)}}class aN{constructor(e,t,i,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function zme(n){return n==="altKey"?Yn?new aN(57,"metaKey",6,"altKey"):new aN(5,"ctrlKey",6,"altKey"):Yn?new aN(6,"altKey",57,"metaKey"):new aN(6,"altKey",5,"ctrlKey")}class BF extends Pe{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new xe),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new xe),this.onExecute=this._onExecute.event,this._onCancel=this._register(new xe),this.onCancel=this._onCancel.event,this._editor=e,this._alwaysFireExecuteOnMouseUp=t,this._opts=zme(this._editor.getOption(75)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(75)){const r=zme(this._editor.getOption(75));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(i=>this._onEditorMouseMove(new PZ(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new PZ(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new PZ(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new Wme(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new Wme(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;(this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t||this._alwaysFireExecuteOnMouseUp)&&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 OCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let t7=class extends eQ{constructor(e,t,i,r,o,s,a,l,u,c,d,h,f){super(e,Object.assign(Object.assign({},r.getRawOptions()),{overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()}),i,o,s,a,l,u,c,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){GS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};t7=OCt([$3(4,Sn),$3(5,Mi),$3(6,Qo),$3(7,_n),$3(8,Vs),$3(9,Fo),$3(10,L7),$3(11,br),$3(12,Vt)],t7);const Ume=new Re(new ci(0,122,204)),ICt={showArrow:!0,showFrame:!0,className:"",frameColor:Ume,arrowColor:Ume,keepEditorSelection:!1},RCt="vs.editor.contrib.zoneWidget";class HCt{constructor(e,t,i,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class PCt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class $F{constructor(e){this._editor=e,this._ruleName=$F._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Vpe(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(){Vpe(this._ruleName),Wte(`.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:G.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}$F._IdGenerator=new due(".arrow-decoration-");class VCt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new st,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=r4(t),GS(this.options,ICt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const r=this._getWidth(i);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(r)}))}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 $F(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const r=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(!!e)return e.getStartPosition()}show(e,t){const i=G.isIRange(e)?G.lift(e):G.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Vn.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(64);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(64);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,u=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(u=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 HCt(s,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new PCt(RCt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:u;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new G(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.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 Ya(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(64),r=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var NOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const IOe=oi("IPeekViewService");gi(IOe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const r=this._widgets.get(n);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var xu;(function(n){n.inPeekEditor=new It("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(xu||(xu={}));let zL=class{constructor(e,t){e instanceof t7&&xu.inPeekEditor.bindTo(t)}dispose(){}};zL.ID="editor.contrib.referenceController";zL=NOe([OOe(1,_n)],zL);yi(zL.ID,zL,0);function FCt(n){const e=n.get(Mi).getFocusedCodeEditor();return e instanceof t7?e.getParentEditor():e}const BCt={headerBackgroundColor:Re.white,primaryHeadingColor:Re.fromHex("#333333"),secondaryHeadingColor:Re.fromHex("#6c6c6cb3")};let kH=class extends VCt{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new xe,this.onDidClose=this._onDidClose.event,GS(this.options,BCt,!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=at(".head"),this._bodyElement=at(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=at(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),es(this._titleElement,"click",o=>this._onTitleClick(o))),Ge(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=at("span.filename"),this._secondaryHeading=at("span.dirname"),this._metaHeading=at("span.meta"),Ge(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=at(".peekview-actions");Ge(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new F1(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new nc("peekview.close",w("label.close","Close"),dn.asClassName(_t.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:rTt.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:ys(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Uu(this._metaHeading)):ql(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(64)*1.2),r=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(r,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`)}};kH=NOe([OOe(2,Sn)],kH);const $Ct=de("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Re.black,hcLight:Re.white},w("peekViewTitleBackground","Background color of the peek view title area.")),ROe=de("peekViewTitleLabel.foreground",{dark:Re.white,light:Re.black,hcDark:Re.white,hcLight:_d},w("peekViewTitleForeground","Color of the peek view title.")),HOe=de("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),jCt=de("peekView.border",{dark:Ic,light:Ic,hcDark:ri,hcLight:ri},w("peekViewBorder","Color of the peek view borders and arrow.")),WCt=de("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Re.black,hcLight:Re.white},w("peekViewResultsBackground","Background color of the peek view result list."));de("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Re.white,hcLight:_d},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));de("peekViewResult.fileForeground",{dark:Re.white,light:"#1E1E1E",hcDark:Re.white,hcLight:_d},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));de("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));de("peekViewResult.selectionForeground",{dark:Re.white,light:"#6C6C6C",hcDark:Re.white,hcLight:_d},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const sf=de("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Re.black,hcLight:Re.white},w("peekViewEditorBackground","Background color of the peek view editor."));de("peekViewEditorGutter.background",{dark:sf,light:sf,hcDark:sf,hcLight:sf},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));de("peekViewEditorStickyScroll.background",{dark:sf,light:sf,hcDark:sf,hcLight:sf},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));de("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));de("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));de("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Nr,hcLight:Nr},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var zCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class n7{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=xne.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?w({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,V1(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",V1(this.uri),this.range.startLineNumber,this.range.startColumn)}}class UCt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:r,column:o-t}),u=new G(r,l.startColumn,r,o),c=new G(s,a,s,1073741824),d=i.getValueInRange(u).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(c).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class UL{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new wl}dispose(){$i(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",V1(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,V1(this.uri),this.uri.fsPath)}resolve(e){return zCt(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new UCt(i))}catch(i){$n(i)}return this})}}class rc{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new xe,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(rc._compareReferences);let r;for(const o of e)if((!r||!Or.isEqual(r.uri,o.uri,!0))&&(r=new UL(this,o.uri),this.groups.push(r)),r.children.length===0||rc._compareReferences(o,r.children[r.children.length-1])!==0){const s=new n7(i===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){$i(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new rc(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let r=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,i.children[r]):(r=i.parent.groups.indexOf(i),t?(r=(r+1)%s,i.parent.groups[r].children[0]):(r=(r+s-1)%s,i.parent.groups[r].children[i.parent.groups[r].children.length-1]))}nearestReference(e,t){const i=this.references.map((r,o)=>({idx:o,prefixLen:Xg(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&G.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Or.compare(e.uri,t.uri)||G.compareRangesUsingStarts(e.range,t.range)}}var jF=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WF=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let $ie=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof rc||e instanceof UL}getChildren(e){if(e instanceof rc)return e.groups;if(e instanceof UL)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};$ie=jF([WF(0,Lu)],$ie);class qCt{getHeight(){return 23}getTemplateId(e){return e instanceof UL?qL.id:LD.id}}let jie=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof n7){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return V1(e.uri)}};jie=jF([WF(0,Ir)],jie);class GCt{getId(e){return e instanceof n7?e.id:e.uri}}let Wie=class extends Pe{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new yH(i,{supportHighlights:!0})),this.badge=new cie(Ge(i,at(".count")),{},$Ae),e.appendChild(i)}set(e,t){const i=lF(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};Wie=jF([WF(1,iQ)],Wie);let qL=class POe{constructor(e){this._instantiationService=e,this.templateId=POe.id}renderTemplate(e){return this._instantiationService.createInstance(Wie,e)}renderElement(e,t,i){i.set(e.element,pF(e.filterData))}disposeTemplate(e){e.dispose()}};qL.id="FileReferencesRenderer";qL=jF([WF(0,Sn)],qL);class KCt{constructor(e){this.label=new Df(e)}set(e,t){var i;const r=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!r||!r.value)this.label.set(`${V1(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!W2.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,pF(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class LD{constructor(){this.templateId=LD.id}renderTemplate(e){return new KCt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}LD.id="OneReferenceRenderer";class ZCt{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var XCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},j3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class zF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new st,this._callOnModelChange=new st,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(!!e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(JCt,"ReferencesWidget",this._treeContainer,new qCt,[this._instantiationService.createInstance(qL),this._instantiationService.createInstance(LD)],this._instantiationService.createInstance($ie),i),this._splitView.addView({onDidChange:Ut.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},TH.Distribute),this._splitView.addView({onDidChange:Ut.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},TH.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof n7&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),ql(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tr(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=w("noResults","No results"),Uu(this._messageContainer),Promise.resolve(void 0)):(ql(this._messageContainer),this._decorationsManager=new zF(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const r=this._getFocusedReference();!r||this._onDidSelectReference.fire({element:{uri:r.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Uu(this._treeContainer),Uu(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 n7)return e;if(e instanceof UL&&e.children.length>0)return e.children[0]}revealReference(e){return qme(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return qme(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Un.inMemory?this.setTitle(v7t(e.uri),this._uriLabel.getUriLabel(lF(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const r=yield i;if(!this._model){r.dispose();return}$i(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=G.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()})}};zie=XCt([j3(3,Vs),j3(4,Lu),j3(5,Sn),j3(6,IOe),j3(7,iQ),j3(8,uF),j3(9,Ir),j3(10,$r),j3(11,br)],zie);var ewt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},M9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const om=new It("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let i7=class Uie{static get(e){return e.getContribution(Uie.ID)}constructor(e,t,i,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new st,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=om.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),!!r&&e.containsPosition(r))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=YCt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(zie,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:u,kind:c}=l;if(!!u)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":i?this._gotoReference(u,!0):this.openReference(u,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var u;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(u=this._model)===null||u===void 0||u.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(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,d=new De(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(84)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){!this._widget||(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return Gme(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const r=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(r),yield this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return Gme(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const r=G.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=Uie.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,bs(u=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,$n(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};i7.ID="editor.contrib.referencesController";i7=ewt([M9(2,_n),M9(3,Mi),M9(4,Fo),M9(5,Sn),M9(6,qd),M9(7,bi)],i7);function sm(n,e){const t=FCt(n);if(!t)return;const i=i7.get(t);i&&e(i)}wu.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:ws(2089,60),when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});wu.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.goToNextOrPreviousReference(!0)})}});wu.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.goToNextOrPreviousReference(!1)})}});mi.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");mi.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");mi.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");mi.registerCommand("closeReferenceSearch",n=>sm(n,e=>e.closeWidget()));wu.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:ct.and(xu.inPeekEditor,ct.not("config.editor.stablePeek"))});wu.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:ct.and(om,ct.not("config.editor.stablePeek"))});wu.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ct.and(om,lNe,Mue.negate(),Aue.negate()),handler(n){var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.revealReference(i[0]))}});wu.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ct.and(om,lNe,Mue.negate(),Aue.negate()),handler(n){var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.openReference(i[0],!0,!0))}});mi.registerCommand("openReference",n=>{var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.openReference(i[0],!1,!0))});var VOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ow=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const rce=new It("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),UF=oi("ISymbolNavigationService");let qie=class{constructor(e,t,i,r){this._editorService=t,this._notificationService=i,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=rce.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new Gie(this._editorService),r=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let u=!1,c=!1;for(const d of t.references)if(aF(d.uri,a.uri))u=!0,c=c||G.containsPosition(d.range,l);else if(u)break;(!u||!c)&&this.reset()});this._currentState=Dd(i,r)}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:G.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};qie=VOe([Ow(0,_n),Ow(1,Mi),Ow(2,Fo),Ow(3,Ir)],qie);gi(UF,qie,1);vt(new class extends Ps{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:rce,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(UF).revealNext(e)}});wu.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:rce,primary:9,handler(n){n.get(UF).reset()}});let Gie=class{constructor(e){this._listener=new Map,this._disposables=new st,this._onDidChange=new xe,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(),$i(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Dd(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)}};Gie=VOe([Ow(0,Mi)],Gie);var oce=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function SD(n,e,t,i){return oce(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{Cs(l)})),s=yield Promise.all(o);return Rh(s.flat())})}function qF(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideDefinition(o,s,i))}function FOe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideDeclaration(o,s,i))}function BOe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideImplementation(o,s,i))}function $Oe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideTypeDefinition(o,s,i))}function GF(n,e,t,i,r){return SD(e,t,n,(o,s,a)=>oce(this,void 0,void 0,function*(){const l=yield o.provideReferences(s,a,{includeDeclaration:!0},r);if(!i||!l||l.length!==2)return l;const u=yield o.provideReferences(s,a,{includeDeclaration:!1},r);return u&&u.length===1?u:l}))}function DD(n){return oce(this,void 0,void 0,function*(){const e=yield n(),t=new rc(e,""),i=t.references.map(r=>r.link);return t.dispose(),i})}n3("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(Vt),r=qF(i.definitionProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(Vt),r=$Oe(i.typeDefinitionProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(Vt),r=FOe(i.declarationProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeReferenceProvider",(n,e,t)=>{const i=n.get(Vt),r=GF(i.referenceProvider,e,t,!1,Jn.None);return DD(()=>r)});n3("_executeImplementationProvider",(n,e,t)=>{const i=n.get(Vt),r=BOe(i.implementationProvider,e,t,Jn.None);return DD(()=>r)});var kd=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},VZ,FZ,BZ,$Z,jZ,WZ,zZ,UZ;xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class fQ{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof fQ||De.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Cl extends U8{static all(){return Cl._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of pi.wrap(t.menu))(i.id===se.EditorContext||i.id===se.EditorContextPeek)&&(i.when=ct.and(e.precondition,i.when));return t}constructor(e,t){super(Cl._patchConfig(t)),this.configuration=e,Cl._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Fo),s=e.get(Mi),a=e.get(k7),l=e.get(UF),u=e.get(Vt),c=e.get(Sn),d=t.getModel(),h=t.getPosition(),f=fQ.is(i)?i:new fQ(d,h),g=new Jf(t,5),T=FV(this._getLocationModel(u,f.model,f.position,g.token),g.token).then(v=>kd(this,void 0,void 0,function*(){var Q;if(!v||g.token.isCancellationRequested)return;Ys(v.ariaMessage);let b;if(v.referenceAt(d.uri,h)){const C=this._getAlternativeCommand(t);!Cl._activeAlternativeCommands.has(C)&&Cl._allSymbolNavigationCommands.has(C)&&(b=Cl._allSymbolNavigationCommands.get(C))}const _=v.references.length;if(_===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(h);(Q=ic.get(t))===null||Q===void 0||Q.showMessage(this._getNoResultFoundMessage(C),h)}}else if(_===1&&b)Cl._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(C=>b.runEditorCommand(C,t,i,r).finally(()=>{Cl._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)}),v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(T,250),T}_onResult(e,t,i,r,o){return kd(this,void 0,void 0,function*(){const s=this._getGoToPreference(i);if(!(i instanceof t7)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(i,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",u=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&u?this._openInPeek(u,r,o):r.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,i,r,o){return kd(this,void 0,void 0,function*(){let s;if(hdt(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:G.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(!!a){if(o){const l=a.getModel(),u=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&u.clear()},350)}return a}})}_openInPeek(e,t,i){const r=i7.get(e);r&&e.hasModel()?r.toggleWidget(i!=null?i:e.getSelection(),bs(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Cl._allSymbolNavigationCommands=new Map;Cl._activeAlternativeCommands=new Set;class ED extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield qF(e.definitionProvider,t,i,r),w("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(56).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(56).multipleDefinitions}}const jOe=C7&&!ele()?2118:70;ps((VZ=class Kie extends ED{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Kie.id,title:{value:w("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:ct.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:jOe,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.1},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),mi.registerCommandAlias("editor.action.goToDeclaration",Kie.id)}},VZ.id="editor.action.revealDefinition",VZ));ps((FZ=class Zie extends ED{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Zie.id,title:{value:w("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ct.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:ws(2089,jOe),weight:100}}),mi.registerCommandAlias("editor.action.openDeclarationToTheSide",Zie.id)}},FZ.id="editor.action.revealDefinitionAside",FZ));ps((BZ=class Xie extends ED{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Xie.id,title:{value:w("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ct.and(oe.hasDefinitionProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:2}}),mi.registerCommandAlias("editor.action.previewDeclaration",Xie.id)}},BZ.id="editor.action.peekDefinition",BZ));class WOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield FOe(e.declarationProvider,t,i,r),w("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(56).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(56).multipleDeclarations}}ps(($Z=class zOe extends WOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:zOe.id,title:{value:w("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:ct.and(oe.hasDeclarationProvider,oe.isInWalkThroughSnippet.toNegated()),menu:[{id:se.EditorContext,group:"navigation",order:1.3},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},$Z.id="editor.action.revealDeclaration",$Z));ps(class extends WOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:w("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ct.and(oe.hasDeclarationProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:3}})}});class UOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield $Oe(e.typeDefinitionProvider,t,i,r),w("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(56).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(56).multipleTypeDefinitions}}ps((jZ=class qOe extends UOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qOe.ID,title:{value:w("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:ct.and(oe.hasTypeDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:0,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.4},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},jZ.ID="editor.action.goToTypeDefinition",jZ));ps((WZ=class GOe extends UOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:GOe.ID,title:{value:w("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ct.and(oe.hasTypeDefinitionProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:4}})}},WZ.ID="editor.action.peekTypeDefinition",WZ));class KOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield BOe(e.implementationProvider,t,i,r),w("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(56).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(56).multipleImplementations}}ps((zZ=class ZOe extends KOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ZOe.ID,title:{value:w("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:ct.and(oe.hasImplementationProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:2118,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},zZ.ID="editor.action.goToImplementation",zZ));ps((UZ=class XOe extends KOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:XOe.ID,title:{value:w("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ct.and(oe.hasImplementationProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:3142,weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:5}})}},UZ.ID="editor.action.peekImplementation",UZ));class YOe extends Cl{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(56).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(56).multipleReferences}}ps(class extends YOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:w("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:ct.and(oe.hasReferenceProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:1094,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield GF(e.referenceProvider,t,i,!0,r),w("ref.title","References"))})}});ps(class extends YOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:w("references.action.label","Peek References"),original:"Peek References"},precondition:ct.and(oe.hasReferenceProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield GF(e.referenceProvider,t,i,!1,r),w("ref.title","References"))})}});class twt extends Cl{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:w("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ct.and(xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(this._references,w("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(56).multipleReferences}_getAlternativeCommand(){return""}}mi.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:on},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,r,o,s)=>kd(void 0,void 0,void 0,function*(){Xi(on.isUri(e)),Xi(De.isIPosition(t)),Xi(Array.isArray(i)),Xi(typeof r>"u"||typeof r=="string"),Xi(typeof s>"u"||typeof s=="boolean");const a=n.get(Mi),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Uh(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(u=>{const c=new class extends twt{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!Boolean(o),openInPeek:Boolean(s),openToSide:!1},i,r);u.get(Sn).invokeFunction(c.run.bind(c),l)})})});mi.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:on},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,r)=>kd(void 0,void 0,void 0,function*(){n.get(Qo).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)})});mi.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Xi(on.isUri(e)),Xi(De.isIPosition(t));const i=n.get(Vt),r=n.get(Mi);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!Uh(o)||!o.hasModel())return;const s=i7.get(o);if(!s)return;const a=bs(u=>GF(i.referenceProvider,o.getModel(),De.lift(t),!1,u).then(c=>new rc(c,w("ref.title","References")))),l=new G(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});mi.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var nwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Kme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let g8=class fI{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new st,this.toUnhookForKeyboard=new st,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new BF(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,ca(a))})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{$n(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(fI.ID)}startFindDefinitionFromCursor(e){return Kme(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return Kme(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const r=new jL(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=bs(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){$n(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?G.lift(o[0].originSelectionRange):new G(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=G.plusRange(a,l));this.addDecoration(a,new Gl().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:u}}=l,{startLineNumber:c}=a.range;if(c<1||c>u.getLineCount()){l.dispose();return}const d=this.getPreviewValue(u,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(u.uri);this.addDecoration(s,d?new Gl().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=fI.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(85)&&!this.isInPeekEditor(i);return new ED({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(_n);return xu.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};g8.ID="editor.contrib.gotodefinitionatposition";g8.MAX_SOURCE_PREVIEW_LINES=8;g8=nwt([qZ(1,Lu),qZ(2,$r),qZ(3,Vt)],g8);yi(g8.ID,g8,2);const lN=at;class JOe extends Pe{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 cD(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class sce extends Pe{static render(e,t,i){return new sce(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Ge(e,lN("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ge(this.actionContainer,lN("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ge(this.action,lN(`span.icon.${t.iconClass}`));const r=Ge(this.action,lN("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._register(Ye(this.actionContainer,kt.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(Ye(this.actionContainer,kt.KEY_DOWN,o=>{const s=new vr(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}var iwt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},rwt=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}};class owt{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class eIe extends Pe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new xe),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Qr(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Qr(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Qr(()=>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(58).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=U2t(e=>this._computer.computeAsync(e)),iwt(this,void 0,void 0,function*(){var e,t,i,r;try{try{for(var o=!0,s=rwt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;o=!0){r=a.value,o=!1;const l=r;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){$n(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 owt(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 GZ{constructor(e,t,i,r){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=r,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 pI{constructor(e,t,i,r,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=r,this.initialMousePosY=o,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 am=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class gd{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),r;if(r=gd._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(gd.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(gd.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(gd.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(gd.isVariableCharacter(i)||gd.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof gd._table[i]>"u"&&!gd.isDigitCharacter(i)&&!gd.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}}gd._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class ub{constructor(){this._children=[]}appendChild(e){return e instanceof Kl&&this._children[this._children.length-1]instanceof Kl?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,r=i.children.indexOf(e),o=i.children.slice(0);o.splice(r,1,...t),i._children=o,function s(a,l){for(const u of a)u.parent=l,s(u.children,u)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof kD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Kl extends ub{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Kl(this.value)}}class tIe extends ub{}class y1 extends tIe{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 cb?this._children[0]:void 0}clone(){const e=new y1(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class cb extends ub{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Kl&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new cb;return this.options.forEach(e.appendChild,e),e}}class ace extends ub{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,r=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof C2&&Boolean(o.elseValue))&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof C2){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new ace;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 C2 extends ub{constructor(e,t,i,r){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=r}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(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,r)=>r===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new C2(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class GL extends tIe{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 Kl(t)],!0):!1}clone(){const e=new GL(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Zme(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class kD extends ub{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof y1&&(e.push(i),t=!t||t.indexr===e?(i=!0,!1):(t+=r.len(),!0)),i?t:-1}fullLen(e){let t=0;return Zme([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof y1&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof GL&&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 kD;return this._children=this.children.map(t=>t.clone()),e}walk(e){Zme(this.children,e)}}class pQ{constructor(){this._scanner=new gd,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const r=new kD;return this.parseFragment(e,r),this.ensureFinalTabstop(r,i!=null?i:!1,t!=null?t:!1),r}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof y1&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,u)=>{const c=r.get(l.index);if(!c)return;const d=new y1(l.index);d.transform=l.transform;for(const h of c){const f=h.clone();d.appendChild(f),f instanceof y1&&r.has(f.index)&&!u.has(f.index)&&(u.add(f.index),s(f,u),u.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new y1(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Kl(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new y1(Number(t)):new GL(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new y1(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Kl("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new cb;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;i.push(r)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Kl(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new GL(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Kl("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new ace;let i="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Kl(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const r=this._accept(8,!0);if(r)if(i){if(this._accept(4))return e.appendChild(new C2(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new C2(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new C2(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new C2(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Kl(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}const swt=w("defaultLabel","input"),awt=w("label.preserveCaseToggle","Preserve Case");class lwt extends ab{constructor(e){super({icon:_t.preserveCase,title:awt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class uwt extends U1{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new xe),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new xe),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new xe),this._onInput=this._register(new xe),this._onKeyUp=this._register(new xe),this._onPreserveCaseKeyDown=this._register(new xe),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||swt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,u=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new YAe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:u,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new lwt(Object.assign({appendTitle:o,isChecked:!1},r.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 c=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=c.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%c.length:h.equals(15)&&(f===0?g=c.length-1:g=f-1),h.equals(9)?(c[f].blur(),this.inputBox.focus()):g>=0&&c[g].focus(),zn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),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 nIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iIe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const lce=new It("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),uce="historyNavigationWidgetFocus",rIe="historyNavigationForwardsEnabled",oIe="historyNavigationBackwardsEnabled";let F4;const uN=[];function sIe(n,e){if(uN.includes(e))throw new Error("Cannot register the same widget multiple times");uN.push(e);const t=new st,i=new It(uce,!1).bindTo(n),r=new It(rIe,!0).bindTo(n),o=new It(oIe,!0).bindTo(n),s=()=>{i.set(!0),F4=e},a=()=>{i.set(!1),F4===e&&(F4=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Bn(()=>{uN.splice(uN.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let Yie=class extends JAe{constructor(e,t,i,r){super(e,t,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(sIe(o,this.inputBox))}};Yie=nIe([iIe(3,_n)],Yie);let Jie=class extends uwt{constructor(e,t,i,r,o=!1){super(e,t,o,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(sIe(s,this.inputBox))}};Jie=nIe([iIe(3,_n)],Jie);wu.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ct.and(ct.has(uce),ct.equals(oIe,!0),lce.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{F4==null||F4.showPreviousValue()}});wu.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ct.and(ct.has(uce),ct.equals(rIe,!0),lce.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{F4==null||F4.showNextValue()}});var bx=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const jn={Visible:lce,HasFocusedSuggestion:new It("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new It("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new It("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new It("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new It("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new It("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new It("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new It("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Ef=new se("suggestWidgetStatusBar");class cwt{constructor(e,t,i,r){var o;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=W2.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,G.isIRange(t.range)?(this.editStart=new De(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new De(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new De(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||G.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new De(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new De(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new De(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||G.spansMultipleLines(t.range.insert)||G.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 r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return bx(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{u0(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class KL{constructor(e=2,t=new Set,i=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=r,this.showDeprecated=o}}KL.default=new KL;let dwt;function hwt(){return dwt}class fwt{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}function cce(n,e,t,i=KL.default,r={triggerKind:0},o=Jn.None){return bx(this,void 0,void 0,function*(){const s=new nu(!0);t=t.clone();const a=e.getWordAtPosition(t),l=a?new G(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):G.fromPositions(t),u={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},c=[],d=new st,h=[];let f=!1;const g=(v,Q,b)=>{var _,C,L;let S=!1;if(!Q)return S;for(const D of Q.suggestions)if(!i.kindFilter.has(D.kind)){if(!i.showDeprecated&&((_=D==null?void 0:D.tags)===null||_===void 0?void 0:_.includes(1)))continue;D.range||(D.range=u),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=pQ.guessNeedsClipboard(D.insertText)),c.push(new cwt(t,D,Q,v)),S=!0}return Hae(Q)&&d.add(Q),h.push({providerName:(C=v._debugDisplayName)!==null&&C!==void 0?C:"unknown_provider",elapsedProvider:(L=Q.duration)!==null&&L!==void 0?L:-1,elapsedOverall:b.elapsed()}),S},T=(()=>bx(this,void 0,void 0,function*(){}))();for(const v of n.orderedGroups(e)){let Q=!1;if(yield Promise.all(v.map(b=>bx(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const _=i.providerItemsToReuse.get(b);_.forEach(C=>c.push(C)),Q=Q||_.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const _=new nu(!0),C=yield b.provideCompletionItems(e,t,r,o);Q=g(b,C,_)||Q}catch(_){Cs(_)}}))),Q||o.isCancellationRequested)break}return yield T,o.isCancellationRequested?(d.dispose(),Promise.reject(new w7)):new fwt(c.sort(mwt(i.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function dce(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function pwt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return dce(n,e)}function gwt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return dce(n,e)}const KF=new Map;KF.set(0,pwt);KF.set(2,gwt);KF.set(1,dce);function mwt(n){return KF.get(n)}mi.registerCommand("_executeCompletionItemProvider",(n,...e)=>bx(void 0,void 0,void 0,function*(){const[t,i,r,o]=e;Xi(on.isUri(t)),Xi(De.isIPosition(i)),Xi(typeof r=="string"||!r),Xi(typeof o=="number"||!o);const{completionProvider:s}=n.get(Vt),a=yield n.get(Lu).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},u=[],c=a.object.textEditorModel.validatePosition(i),d=yield cce(s,a.object.textEditorModel,c,void 0,{triggerCharacter:r!=null?r:void 0,triggerKind:r?1:0});for(const h of d.items)u.length<(o!=null?o:0)&&u.push(h.resolve(Jn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(u),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function Twt(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class ZT{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}}}var hce=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},MH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Xme=at;let AH=class ere extends Pe{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._widget=this._register(this._instantiationService.createInstance($g,this._editor)),this._currentResult=null,this._participants=[];for(const r of am.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new OH(this._editor,this._participants),this._hoverOperation=this._register(new eIe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new aIe(this._computer.anchor,o,r.isComplete))})),this._register(es(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(no.onDidChange(()=>{this._widget.position&&this._currentResult&&(this._widget.clear(),this._setCurrentResult(this._currentResult))}))}maybeShowAt(e){const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new GZ(0,i.range,e.event.posx,e.event.posy)),i.type===7){const r=this._editor.getOption(48).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,r){this._startShowingOrUpdateHover(new GZ(0,e,void 0,void 0),t,i,r,null)}_startShowingOrUpdateHover(e,t,i,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):!1:this._editor.getOption(58).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}isColorPickerVisible(){return this._widget.isColorPickerVisible}isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}isVisible(){return this._widget.isVisible}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:r,highlightRange:o}=ere.computeHoverRanges(this._editor,e.range,t),s=new st,a=s.add(new NH(this._keybindingService)),l=document.createDocumentFragment();let u=null;const c={fragment:l,statusBar:a,setColorPicker:h=>u=h,onContentsChanged:()=>this._widget.onContentsChanged(),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(c,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:ere._DECORATION_OPTIONS}]),s.add(Bn(()=>{h.clear()}))}this._widget.showAt(l,new Qwt(u,i,r,this._editor.getOption(58).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,i){let r=1;if(e.hasModel()){const u=e._getViewModel(),c=u.coordinatesConverter,d=c.convertModelRangeToViewRange(t),h=new De(d.startLineNumber,u.getLineMinColumn(d.startLineNumber));r=c.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let s=t.startColumn,a=i[0].range,l=null;for(const u of i)a=G.plusRange(a,u.range),u.range.startLineNumber===o&&u.range.endLineNumber===o&&(s=Math.max(Math.min(s,u.range.startColumn),r)),u.forceShowAtRange&&(l=u.range);return{showAtPosition:l?l.getStartPosition():new De(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new De(o,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()}escape(){this._widget.escape()}};AH._DECORATION_OPTIONS=Vn.register({description:"content-hover-highlight",className:"hoverHighlight"});AH=hce([MH(1,Sn),MH(2,Ir)],AH);class aIe{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new vwt(this,this.anchor,t,this.isComplete)}}class vwt extends aIe{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}class Qwt{constructor(e,t,i,r,o,s,a,l,u,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=r,this.stoleFocus=o,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=u,this.disposables=c,this.closestMouseDistance=void 0}}let $g=class lIe extends Pe{get position(){var e,t;return(t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition)!==null&&t!==void 0?t:null}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}constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this.allowEditorOverflow=!0,this._hoverVisibleKey=oe.hoverVisible.bindTo(this._contextKeyService),this._hoverFocusedKey=oe.hoverFocused.bindTo(this._contextKeyService),this._hover=this._register(new JOe),this._focusTracker=this._register(Fh(this.getDomNode())),this._horizontalScrollingBy=30,this._visibleData=null,this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(48)&&this._updateFont()})),this._setVisibleData(null),this._layout(),this._editor.addContentWidget(this),this._register(this._focusTracker.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(this._focusTracker.onDidBlur(()=>{this._hoverFocusedKey.set(!1)}))}dispose(){this._editor.removeContentWidget(this),this._visibleData&&this._visibleData.disposables.dispose(),super.dispose()}getId(){return lIe.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){if(!this._visibleData)return null;let e=this._visibleData.preferAbove;!e&&this._contextKeyService.getContextKeyValue(jn.Visible.key)&&(e=!0);const t=this._visibleData.isBeforeContent?3:void 0;return{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,preference:e?[1,2]:[2,1],positionAffinity:t}}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Os(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Yme(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const r=Yme(e,t,i.left,i.top,i.width,i.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setVisibleData(e){this._visibleData&&this._visibleData.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!this._visibleData),this._hover.containerDomNode.classList.toggle("hidden",!this._visibleData)}_layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(48);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i/t}`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}showAt(e,t){var i;this._setVisibleData(t),this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._hover.contentsDomNode.style.paddingBottom="",this._updateFont(),this.onContentsChanged(),this._editor.render(),this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(i=t.colorPicker)===null||i===void 0||i.layout()}hide(){if(this._visibleData){const e=this._visibleData.stoleFocus;this._setVisibleData(null),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}}onContentsChanged(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged();const e=this._hover.scrollbar.getScrollDimensions();if(e.scrollWidth>e.width){const i=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingBottom!==i&&(this._hover.contentsDomNode.style.paddingBottom=i,this._editor.layoutContentWidget(this),this._hover.onContentsChanged())}}clear(){this._hover.contentsDomNode.textContent=""}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(48);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(48);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-this._horizontalScrollingBy})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+this._horizontalScrollingBy})}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})}escape(){this._editor.focus()}};$g.ID="editor.contrib.contentHoverWidget";$g=hce([MH(1,_n)],$g);let NH=class extends Pe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Xme("div.hover-row.status-bar"),this.actionsElement=Ge(this.hoverElement,Xme("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(sce.render(this.actionsElement,e,i))}append(e){const t=Ge(this.actionsElement,e);return this._hasContent=!0,t}};NH=hce([MH(0,Ir)],NH);class OH{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),r=t.range.startLineNumber;if(r>i.getLineCount())return[];const o=i.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;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 Zo.EMPTY;const i=OH._getLineDecorations(this._editor,t);return Zo.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):Zo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=OH._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Rh(t)}}function Yme(n,e,t,i,r,o){const s=t+r/2,a=i+o/2,l=Math.max(Math.abs(n-s)-r/2,0),u=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+u*u)}var bwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jme=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uIe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let o6=class cIe{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new xe,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new st,o=r.add(hue(e,Object.assign(Object.assign({},this._getRenderOptions(e,r)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,r)=>uIe(this,void 0,void 0,function*(){var o,s,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=Fc);const u=yield zpt(this._languageService,r,l),c=document.createElement("span");if(c.innerHTML=(a=(s=cIe._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(u))!==null&&a!==void 0?a:u,this._options.editor){const d=this._options.editor.getOption(48);Oa(c,d)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>ywt(this._openerService,i,e.isTrusted),disposables:t}}}};o6._ttpTokenizer=m6("tokenizeToString",{createHTML(n){return n}});o6=bwt([Jme(1,$r),Jme(2,ac)],o6);function ywt(n,e,t){return uIe(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:_wt(t)})}catch(i){return $n(i),!1}})}function _wt(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const e9e=at;class Lv extends Pe{constructor(e,t,i){super(),this._renderDisposeables=this._register(new st),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new JOe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new o6({editor:this._editor},t,i)),this._computer=new Cwt(this._editor),this._hoverOperation=this._register(new eIe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(48)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Lv.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const r of t){const o=e9e("div.hover-row.markdown-hover"),s=Ge(o,e9e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(64),s=this._hover.containerDomNode.clientHeight,a=i-r-(s-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Lv.ID="editor.contrib.modesGlyphHoverWidget";class Cwt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const r of t){if(!r.options.glyphMarginClassName)continue;const o=r.options.glyphMarginHoverMessage;!o||nQ(o)||i.push(...Oae(o).map(e))}return i}}var wwt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class xwt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function Lwt(n,e,t,i,r){return wwt(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,r));if(o&&Dwt(o))return new xwt(n,o,e)}catch(o){Cs(o)}})}function fce(n,e,t,i){const o=n.ordered(e).map((s,a)=>Lwt(s,a,e,t,i));return Zo.fromPromises(o).coalesce()}function Swt(n,e,t,i){return fce(n,e,t,i).map(r=>r.hover).toPromise()}n3("_executeHoverProvider",(n,e,t)=>{const i=n.get(Vt);return Swt(i.hoverProvider,e,t,Jn.None)});function Dwt(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var Ewt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const t9e=at;class A2{constructor(e,t,i,r,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let IH=class{constructor(e,t,i,r,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new A2(this,e.range,[new Gl().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];let a=1e3;const l=i.getLineLength(r),u=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(113),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:u});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,s.push(new A2(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new A2(this,e.range,[{value:w("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 T=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,Q=g.options.hoverMessage;if(!Q||nQ(Q))continue;g.options.beforeContentClassName&&(f=!0);const b=new G(e.range.startLineNumber,T,e.range.startLineNumber,v);s.push(new A2(this,b,Oae(Q),f,a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Zo.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Zo.EMPTY;const o=new De(e.range.startLineNumber,e.range.startColumn);return fce(this._languageFeaturesService.hoverProvider,r,o,i).filter(s=>!nQ(s.hover.contents)).map(s=>{const a=s.hover.range?G.lift(s.hover.range):e.range;return new A2(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return dIe(e,t,this._editor,this._languageService,this._openerService)}};IH=Ewt([cN(1,$r),cN(2,ac),cN(3,bi),cN(4,Vt)],IH);function dIe(n,e,t,i,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new st;for(const s of e)for(const a of s.contents){if(nQ(a))continue;const l=t9e("div.hover-row.markdown-hover"),u=Ge(l,t9e("div.hover-contents")),c=o.add(new o6({editor:t},i,r));o.add(c.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n.onContentsChanged()}));const d=o.add(c.render(a));u.appendChild(d.element),n.fragment.appendChild(l)}return o}var hIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class n9e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let tre=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._dispoables=new st,this._markers=[],this._nextIdx=-1,on.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let u=Xx(a.resource.toString(),l.resource.toString());return u===0&&(r==="position"?u=G.compareRangesUsingStarts(a,l)||ro.compare(a.severity,l.severity):u=ro.compare(a.severity,l.severity)||G.compareRangesUsingStarts(a,l)),u},s=()=>{this._markers=this._markerService.read({resource:on.isUri(e)?e:void 0,severities:ro.Error|ro.Warning|ro.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};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 n9e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=Ux(this._markers,{resource:e.uri},(s,a)=>Xx(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},A9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Mwt{constructor(e,t,i,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new st,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(es(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new iMe(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(){$i(this._disposables)}update(e){const{source:t,message:i,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=Ph(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);ys(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=at("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ge(this._codeLink,at("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(ys(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ol(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(64)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),T=document.createElement("a");T.classList.add("filename"),T.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,T.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(T,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(T),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const u=this._editor.getOption(48),c=Math.ceil(u.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=u.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:d})}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 ro.Error:t=w("Error","Error");break;case ro.Warning:t=w("Warning","Warning");break;case ro.Info:t=w("Info","Info");break;case ro.Hint:t=w("Hint","Hint");break}let i=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(i=`${r.getLineContent(e.startLineNumber)}, ${i}`),i}}let gQ=class pIe extends kH{constructor(e,t,i,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new st,this._onDidSelectRelatedInformation=new xe,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ro.Warning,this._backgroundColor=Re.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Iwt);let t=rre,i=Awt;this._severity===ro.Warning?(t=gI,i=Nwt):this._severity===ro.Info&&(t=ore,i=Owt);const r=e.getColor(t),o=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(ROe),secondaryHeadingColor:e.getColor(HOe)})}_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(r=>this.editor.focus()));const t=[],i=this._menuService.createMenu(pIe.TitleMenu,this._contextKeyService);WAe(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Ge(e,at(""))}_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 Mwt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=G.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?w("problems","{0} of {1} problems",t,i):w("change","{0} of {1} problem",t,i);this.setTitle(V1(a.uri),l)}this._icon.className=`codicon ${ire.className(ro.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()}};gQ.TitleMenu=new se("gotoErrorTitleMenu");gQ=kwt([A9(1,Vs),A9(2,ac),A9(3,t3),A9(4,Sn),A9(5,_n),A9(6,iQ)],gQ);const i9e=lL(gh,p4t),r9e=lL(Oc,aL),o9e=lL(Ic,Xte),rre=de("editorMarkerNavigationError.background",{dark:i9e,light:i9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),Awt=de("editorMarkerNavigationError.headerBackground",{dark:Xt(rre,.1),light:Xt(rre,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),gI=de("editorMarkerNavigationWarning.background",{dark:r9e,light:r9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Nwt=de("editorMarkerNavigationWarning.headerBackground",{dark:Xt(gI,.1),light:Xt(gI,.1),hcDark:"#0C141F",hcLight:Xt(gI,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ore=de("editorMarkerNavigationInfo.background",{dark:o9e,light:o9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Owt=de("editorMarkerNavigationInfo.headerBackground",{dark:Xt(ore,.1),light:Xt(ore,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Iwt=de("editorMarkerNavigation.background",{dark:Is,light:Is,hcDark:Is,hcLight:Is},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Rwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gIe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let r7=class mI{static get(e){return e.getContribution(mI.ID)}constructor(e,t,i,r,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new st,this._editor=e,this._widgetVisible=mIe.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(gQ,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!G.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.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 i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:G.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new De(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,r;return gIe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((i=mI.get(s))===null||i===void 0||i.close(),(r=mI.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};r7.ID="editor.contrib.markerController";r7=Rwt([dN(1,fIe),dN(2,_n),dN(3,Mi),dN(4,Sn)],r7);class ZF extends Ot{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return gIe(this,void 0,void 0,function*(){t.hasModel()&&((i=r7.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class kf extends ZF{constructor(){super(!0,!1,{id:kf.ID,label:kf.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:578,weight:100},menuOpts:{menuId:gQ.TitleMenu,title:kf.LABEL,icon:Eo("marker-navigation-next",_t.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}kf.ID="editor.action.marker.next";kf.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class jg extends ZF{constructor(){super(!1,!1,{id:jg.ID,label:jg.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:1602,weight:100},menuOpts:{menuId:gQ.TitleMenu,title:jg.LABEL,icon:Eo("marker-navigation-previous",_t.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}jg.ID="editor.action.marker.prev";jg.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Hwt extends ZF{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("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:oe.focus,primary:66,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Pwt extends ZF{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("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:oe.focus,primary:1090,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}yi(r7.ID,r7,4);dt(kf);dt(jg);dt(Hwt);dt(Pwt);const mIe=new It("markersNavigationVisible",!1),Vwt=Ps.bindToContribution(r7.get);vt(new Vwt({id:"closeMarkersNavigation",precondition:mIe,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:oe.focus,primary:9,secondary:[1033]}}));var Fwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ud=at;class Bwt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const s9e={type:1,filter:{include:Mn.QuickFix},triggerAction:Gc.QuickFixHover};let sre=class{constructor(e,t,i,r){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,u=a.range.endLineNumber===r?a.range.endColumn:o,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const d=new G(e.range.startLineNumber,l,e.range.startLineNumber,u);s.push(new Bwt(this,d,c))}return s}renderHoverParts(e,t){if(!t.length)return Pe.None;const i=new st;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const r=t.length===1?t[0]:t.sort((o,s)=>ro.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),i}renderMarkerHover(e,t){const i=ud("div.hover-row"),r=Ge(i,ud("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const u=Ge(r,ud("span"));if(u.style.whiteSpace="pre-wrap",u.innerText=s,o||a)if(a&&typeof a!="string"){const c=ud("span");if(o){const g=Ge(c,ud("span"));g.innerText=o}const d=Ge(c,ud("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(Ye(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ge(d,ud("span"));h.innerText=a.value;const f=Ge(r,c);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const c=Ge(r,ud("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(ol(l))for(const{message:c,resource:d,startLineNumber:h,startColumn:f}of l){const g=Ge(r,ud("div"));g.style.marginTop="8px";const T=Ge(g,ud("a"));T.innerText=`${V1(d)}(${h}, ${f}): `,T.style.cursor="pointer",t.add(Ye(T,"click",Q=>{Q.stopPropagation(),Q.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch($n)}));const v=Ge(g,ud("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ro.Error||t.marker.severity===ro.Warning||t.marker.severity===ro.Info)&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:kf.ID,run:()=>{var r;e.hide(),(r=r7.get(this._editor))===null||r===void 0||r.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(88)){const r=e.statusBar.append(ud("div"));this.recentMarkerCodeActionsInfo&&(gH.makeKey(this.recentMarkerCodeActionsInfo.marker)===gH.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Pe.None:i.add(Uf(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200));r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(Bn(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(Bn(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:Xue,run:u=>{l=!0;const c=p8.get(this._editor),d=Os(u);e.hide(),c==null||c.showCodeActions(s9e,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},$n)}}getCodeActions(e){return bs(t=>ece(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new G(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),s9e,J8.None,t))}};sre=Fwt([KZ(1,vle),KZ(2,ac),KZ(3,Vt)],sre);let $wt;function o7(){return $wt}let TIe;function jwt(n){TIe=n}class vIe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e){return TIe(()=>{const t=pce(e);return t!==void 0?t:`${this.debugName} (mapped)`},t=>e(this.read(t),t))}}class MD extends vIe{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 _u(n,e){var t,i;const r=new QIe(n,e);try{(t=o7())===null||t===void 0||t.handleBeginTransaction(r),n(r)}finally{r.finish(),(i=o7())===null||i===void 0||i.handleEndTransaction()}}function a9e(n,e,t){n?e(n):_u(e,t)}class QIe{constructor(e,t){this.fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():pce(this.fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;this.updatingObservers=null;for(const{observer:t,observable:i}of e)t.endUpdate(i)}}function pce(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=i?i[1]:void 0;return r==null?void 0:r.trim()}function mQ(n,e){return new bIe(n,e)}class bIe extends MD{constructor(e,t){super(),this.debugName=e,this._value=t}get(){return this._value}set(e,t,i){var r;if(this._value===e)return;let o;t||(t=o=new QIe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=o7())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function are(n,e){return new Wwt(n,e)}class Wwt extends bIe{_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()}}function vd(n,e){return new yIe(n,e,void 0,void 0)}function zwt(n,e,t){return new yIe(n,t,e.createEmptyChangeSummary,e.handleChange)}jwt(vd);class yIe extends MD{get debugName(){return typeof this._debugName=="function"?this._debugName():this._debugName}constructor(e,t,i,r){var o,s;super(),this._debugName=e,this.computeFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=o7())===null||s===void 0||s.handleDerivedCreated(this)}onLastObserverRemoved(){this.state=0,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}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){this.state=3;for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const r=this.state!==0,o=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=r&&o!==this.value;if((t=o7())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new da}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(i&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function oc(n,e){return new _Ie(n,e,void 0,void 0)}function Uwt(n,e){return qwt(e,n)}function qwt(n,e){const t=new st,i=oc(e,r=>{t.clear(),n(r,t)});return Bn(()=>{i.dispose(),t.dispose()})}class _Ie{constructor(e,t,i,r){var o,s;this.debugName=e,this.runFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=o7())===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;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i,this.state=3,(e=o7())===null||e===void 0||e.handleAutorunTriggered(this);try{const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this.runFn(this,r)}finally{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--,wV(()=>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:r=>r===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(n){n.Observer=_Ie})(oc||(oc={}));function CIe(n){return new Gwt(n)}class Gwt extends vIe{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 af(n,e){return new wIe(n,e)}class wIe extends MD{constructor(e,t){super(),this.event=e,this.getValue=t,this.hasValue=!1,this.handleEvent=i=>{var r;const o=this.getValue(i),s=!this.hasValue||this.value!==o;(r=o7())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:s}),s&&(this.value=o,this.hasValue&&_u(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 pce(this.getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this.getValue(void 0)}}(function(n){n.Observer=wIe})(af||(af={}));function Kwt(n,e){return new Zwt(n,e)}class Zwt extends MD{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{_u(i=>{for(const r of this.observers)i.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function Xwt(n){return new Ywt(n)}class Ywt extends MD{constructor(e){super(),this.debugName=e}trigger(e,t){if(!e){_u(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function Jwt(n,e){const t=new ext(e!=null?e:!1);return n.addObserver(t),e&&n.reportChanges(),Bn(()=>{n.removeObserver(t)})}class ext{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){}}const xIe="editor.action.inlineSuggest.commit",LIe="editor.action.inlineSuggest.showPrevious",SIe="editor.action.inlineSuggest.showNext";var txt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class nxt extends Pe{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new B1t),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=new st,this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new ZL(()=>{var r;return(r=this.toggleMenuActionViewItem)===null||r===void 0?void 0:r.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new F1(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,actionViewItemProvider:(r,o)=>{var s;if(r.id===ZL.ID)return this.toggleMenuActionViewItem=new lH(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:dn.asClassNameArray((s=i.moreIcon)!==null&&s!==void 0?s:_t.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(r,o);if(a)return a}if(r instanceof Gv){const a=new lH(r,r.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:r.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,i;const r=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return ca(r==null?void 0:r.getLabel())}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),super.dispose()}}class ZL extends nc{constructor(e,t){t=t||w("moreActions","More Actions..."),super(ZL.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return txt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}ZL.ID="toolbar.toggle.more";var ixt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lre=class extends nxt{constructor(e,t,i,r,o,s,a){super(e,o,Object.assign(Object.assign({getKeyBinding:l=>{var u;return(u=s.lookupKeybinding(l.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0})),this._options=t,this._menuService=i,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new st),t!=null&&t.telemetrySource&&this._store.add(this.actionBar.onDidRun(l=>a.publicLog2("workbenchActionExecuted",{id:l.action.id,from:t.telemetrySource})))}setActions(e,t=[],i){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),u=[];let c=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;f=this._options.maxNumberOfItems&&(a[g]=void 0,d[g]=T)}}L7e(a),L7e(d),super.setActions(a,ea.join(d,l)),u.length>0&&this._sessionDisposables.add(Ye(this.getElement(),"contextmenu",f=>{var g,T,v,Q;const b=this.getItemAction(f.target);if(!b)return;f.preventDefault(),f.stopPropagation();let _=!1;if(c===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){_=!0;for(let S=0;Sthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>f,getActions:()=>L,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(Q=this._options)===null||Q===void 0?void 0:Q.menuOptions),contextKeyService:this._contextKeyService})}))}};lre=ixt([tC(2,t3),tC(3,_n),tC(4,Ud),tC(5,Ir),tC(6,Jc)],lre);var gce=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ure=class extends Pe{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=af(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(60).showToolbar==="always"),this.sessionPosition=void 0,this.position=vd("position",r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const u=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new De(l.lineNumber,Math.min(u,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Uwt("setup content widget",(r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(s7,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var u;return(u=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&u!==void 0?u:[]})));e.addContentWidget(a),o.add(Bn(()=>e.removeContentWidget(a))),o.add(oc("request explicit",l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==H4.Explicit&&s.triggerExplicitly()}))}))}};ure=gce([N2(2,Sn)],ure);const rxt=Eo("inline-suggestion-hints-next",_t.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),oxt=Eo("inline-suggestion-hints-previous",_t.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let s7=class cre extends Pe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new nc(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,i,r,o,s,a,l,u,c,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=u,this._contextKeyService=c,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${cre.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=mw("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[mw("div",{style:{display:"flex"}},[mw("div@actionBar",{className:"custom-actions"}),mw("div@toolBar")])]),this.previousAction=this.createCommandAction(LIe,w("previous","Previous"),dn.asClassName(oxt)),this.availableSuggestionCountAction=new nc("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(SIe,w("next","Next"),dn.asClassName(rxt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(se.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Qr(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Qr(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[];const h=this._register(new F1(this.nodes.actionBar));h.push(this.previousAction,{icon:!0,label:!1}),h.push(this.availableSuggestionCountAction),h.push(this.nextAction,{icon:!0,label:!1}),this.toolBar=this._register(l.createInstance(dre,this.nodes.toolBar,se.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,g)=>f instanceof Hd?l.createInstance(sxt,f,void 0):void 0,telemetrySource:"InlineSuggestionToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{cre._dropDownVisible=f})),this._register(oc("update position",f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(oc("counts",f=>{const g=this._suggestionCount.read(f),T=this._currentSuggestionIdx.read(f);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${T+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(oc("extra commands",f=>{const g=this._extraCommands.read(f);if(Na(this.lastCommands,g))return;this.lastCommands=g;const T=g.map(v=>({class:void 0,id:v.id,enabled:!0,tooltip:v.tooltip||"",label:v.title,run:Q=>this._commandService.executeCommand(v.id)}));for(const[v,Q]of this.inlineCompletionsActionsMenus.getActions())for(const b of Q)b instanceof Hd&&T.push(b);T.length>0&&T.unshift(new ea),this.toolBar.setAdditionalSecondaryActions(T)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};s7._dropDownVisible=!1;s7.id=0;s7=gce([N2(6,Qo),N2(7,Sn),N2(8,Ir),N2(9,_n),N2(10,t3)],s7);class sxt extends o8{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=mw("div.keybinding").root;new vD(t,Ac,Object.assign({disableTitle:!0},_vt)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let dre=class extends lre{constructor(e,t,i,r,o,s,a,l){super(e,Object.assign({resetMenu:t},i),r,o,s,a,l),this.menuId=t,this.options2=i,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,r,o,s,a;const l=[],u=[];WAe(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:u},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),u.push(...this.additionalActions),this.setActions(l,u)}setAdditionalSecondaryActions(e){Na(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};dre=gce([N2(3,t3),N2(4,_n),N2(5,Ud),N2(6,Ir),N2(7,Jc)],dre);var axt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ru=class DIe{static get(e){return e.getContribution(DIe.ID)}constructor(e,t,i,r,o){this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=r,this._keybindingService=o,this._toUnhook=new st,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(s=>{s.hasChanged(58)&&(this._unhookEvents(),this._hookEvents())})}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(58);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target;if(t.type===9&&t.detail===$g.ID){this._hoverClicked=!0;return}t.type===12&&t.detail===Lv.ID||(t.type!==12&&(this._hoverClicked=!1),this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t;const i=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.containsNode(i)||this._hideWidgets()}_onEditorMouseMove(e){var t,i,r,o,s,a,l,u;const c=e.target;if(this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&c.type===9&&c.detail===$g.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&c.type===9&&c.detail===$g.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible())||this._isHoverSticky&&c.type===12&&c.detail===Lv.ID||this._isHoverSticky&&((a=this._contentWidget)===null||a===void 0?void 0:a.isVisibleFromKeyboard()))return;if(!this._isHoverEnabled){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(l=this._glyphWidget)===null||l===void 0||l.hide();return}if(c.type===2&&c.position){(u=this._contentWidget)===null||u===void 0||u.hide(),this._glyphWidget||(this._glyphWidget=new Lv(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(c.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible());e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!r&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||s7.dropDownVisible||(this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(AH,this._editor)),this._contentWidget}isColorPickerVisible(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i,r){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,r)}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()}escape(){var e;(e=this._contentWidget)===null||e===void 0||e.escape()}isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible()}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ru.ID="editor.contrib.hover";ru=axt([hN(1,Sn),hN(2,ac),hN(3,$r),hN(4,Ir)],ru);class lxt extends Ot{constructor(){super({id:"editor.action.showHover",label:w({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:oe.editorTextFocus,primary:ws(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=ru.get(t);if(!r)return;const o=t.getPosition(),s=new G(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);r.isHoverVisible()?r.focus():r.showContentHover(s,1,1,a)}}class uxt extends Ot{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=ru.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const o=new G(r.lineNumber,r.column,r.lineNumber,r.column),s=g8.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(o,1,1,!0)})}}class cxt extends Ot{constructor(){super({id:"editor.action.scrollUpHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollUp()}}class dxt extends Ot{constructor(){super({id:"editor.action.scrollDownHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollDown()}}class hxt extends Ot{constructor(){super({id:"editor.action.scrollLeftHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollLeft()}}class fxt extends Ot{constructor(){super({id:"editor.action.scrollRightHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollRight()}}class pxt extends Ot{constructor(){super({id:"editor.action.pageUpHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ru.get(t);!i||i.pageUp()}}class gxt extends Ot{constructor(){super({id:"editor.action.pageDownHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ru.get(t);!i||i.pageDown()}}class mxt extends Ot{constructor(){super({id:"editor.action.goToTopHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ru.get(t);!i||i.goToTop()}}class Txt extends Ot{constructor(){super({id:"editor.action.goToBottomHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ru.get(t);!i||i.goToBottom()}}class vxt extends Ot{constructor(){super({id:"editor.action.escapeFocusHover",label:w({key:"escapeFocusHover",comment:["Action that allows to escape from the hover widget with the escape command when the hover widget is focused."]},"Escape Focus Hover"),alias:"Escape Focus Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:9,weight:100}})}run(e,t){const i=ru.get(t);!i||i.escape()}}yi(ru.ID,ru,2);dt(lxt);dt(uxt);dt(cxt);dt(dxt);dt(hxt);dt(fxt);dt(pxt);dt(gxt);dt(mxt);dt(Txt);dt(vxt);am.register(IH);am.register(sre);jd((n,e)=>{const t=n.getColor(E4t);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 hre extends Pe{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=e.target;if(t.type!==6||!t.detail.injectedText||t.detail.injectedText.options.attachedData!==xOe||!t.range)return;const i=this._editor.getContribution(ru.ID);if(!!i&&!i.isColorPickerVisible()){const r=new G(t.range.startLineNumber,t.range.startColumn+1,t.range.endLineNumber,t.range.endColumn+1);i.showContentHover(r,1,0,!1)}}}hre.ID="editor.contrib.colorContribution";yi(hre.ID,hre,2);am.register(EH);var EIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},D2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l9e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let a7=class kIe extends Pe{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._modelService=i,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=oe.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=oe.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 HH(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(kIe.ID)}};a7.ID="editor.contrib.standaloneColorPickerController";a7=EIe([D2(1,_n),D2(2,Kr),D2(3,Ir),D2(4,Sn),D2(5,Vt),D2(6,br)],a7);yi(a7.ID,a7,1);const u9e=8,Qxt=22;let HH=class MIe extends Pe{constructor(e,t,i,r,o,s,a,l){var u;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.body=document.createElement("div"),this._position=void 0,this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new xe),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(WL,this._editor),this._position=(u=this._editor._getViewModel())===null||u===void 0?void 0:u.getPrimaryCursorState().viewState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Fh(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 T=(g=f.target.element)===null||g===void 0?void 0:g.classList;T&&T.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return MIe.ID}getDomNode(){return this.body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(58).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 l9e(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new bxt(t.result,t.foundInEditor))})}_computeAsync(e){return l9e(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new nce(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),r=this._register(new NH(this._keybindingService));let o;const s={fragment:i,statusBar:r,setColorPicker:T=>o=T,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this.body.classList.add("standalone-colorpicker-body"),this.body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this.body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this.body.tabIndex=0,this.body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,u=a.domNode.clientWidth-l-Qxt-u9e,c=o.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+u9e+"px";const f=d.originalColorNode;f.style.width=u+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};HH.ID="editor.contrib.standaloneColorPickerWidget";HH=EIe([D2(3,Sn),D2(4,Kr),D2(5,Ir),D2(6,Vt),D2(7,br)],HH);class bxt{constructor(e,t){this.value=e,this.foundInEditor=t}}class yxt extends U8{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:w("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:se.CommandPalette}]})}runEditorCommand(e,t){var i;(i=a7.get(t))===null||i===void 0||i.showOrFocus()}}class _xt extends Ot{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:oe.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=a7.get(t))===null||i===void 0||i.hide()}}class Cxt extends Ot{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({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:oe.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=a7.get(t))===null||i===void 0||i.insertColor()}}dt(_xt);dt(Cxt);ps(yxt);class lf{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const r=t.length,o=e.length;if(i+r>o)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,i,r,o,s){const a=e.startLineNumber,l=e.startColumn,u=e.endLineNumber,c=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(u);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,c-1-i.length);if(f!==-1&&g!==-1)if(a===u)d.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),Q=h.substring(0,g);(v.indexOf(i)>=0||Q.indexOf(i)>=0)&&(f=-1,g=-1)}let T;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),T=lf._createRemoveBlockCommentOperations(new G(a,f+t.length+1,u,g+1),t,i)):(T=lf._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=T.length===1?i:null);for(const v of T)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return G.isEmpty(e)?r.push(Ur.delete(new G(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(Ur.delete(new G(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Ur.delete(new G(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const o=[];return G.isEmpty(e)?o.push(Ur.replace(new G(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Ur.insert(new De(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Ur.insert(new De(e.endLineNumber,e.endColumn),(r?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const r=i[0],o=i[1];return new Ht(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ht(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class i4{constructor(e,t,i,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let u=0,c=i-t+1;u{if(e&&typeof e=="object"||typeof e=="function")for(let r of n_t(e))!i_t.call(n,r)&&r!==t&&e_t(n,r,{get:()=>e[r],enumerable:!(i=t_t(e,r))||i.enumerable});return n},r_t=(n,e,t)=>(Ime(n,e,"default"),t&&Ime(t,e,"default")),o_t="5.0.2",cQ={};r_t(cQ,yD);var qNe=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(qNe||{}),GNe=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(GNe||{}),KNe=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(KNe||{}),ZNe=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(ZNe||{}),XNe=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(XNe||{}),YNe=class{constructor(n,e,t,i,r){lo(this,"_onDidChange",new cQ.Emitter);lo(this,"_onDidExtraLibsChange",new cQ.Emitter);lo(this,"_extraLibs");lo(this,"_removedExtraLibs");lo(this,"_eagerModelSync");lo(this,"_compilerOptions");lo(this,"_diagnosticsOptions");lo(this,"_workerOptions");lo(this,"_onDidExtraLibsChangeTimeout");lo(this,"_inlayHintsOptions");lo(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];!r||r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},s_t=o_t,JNe={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},eOe=new YNe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},JNe),tOe=new YNe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},JNe),a_t=()=>HF().then(n=>n.getTypeScriptWorker()),l_t=()=>HF().then(n=>n.getJavaScriptWorker());cQ.languages.typescript={ModuleKind:qNe,JsxEmit:GNe,NewLineKind:KNe,ScriptTarget:ZNe,ModuleResolutionKind:XNe,typescriptVersion:s_t,typescriptDefaults:eOe,javascriptDefaults:tOe,getTypeScriptWorker:a_t,getJavaScriptWorker:l_t};function HF(){return Gt(()=>import("./tsMode.87c59f2a.js"),[])}cQ.languages.onLanguage("typescript",()=>HF().then(n=>n.setupTypeScript(eOe)));cQ.languages.onLanguage("javascript",()=>HF().then(n=>n.setupJavaScript(tOe)));var u_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},c_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PF=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const VF=new It("selectionAnchorSet",!1);let r6=class nOe{static get(e){return e.getContribution(nOe.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=VF.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(Ht.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Gl().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ys(w("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(Ht.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()}};r6.ID="editor.contrib.selectionAnchorController";r6=u_t([c_t(1,_n)],r6);class d_t extends Ot{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:ws(2089,2080),weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class h_t extends Ot{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:VF})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class f_t extends Ot{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:VF,kbOpts:{kbExpr:oe.editorTextFocus,primary:ws(2089,2089),weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class p_t extends Ot{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:VF,kbOpts:{kbExpr:oe.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return PF(this,void 0,void 0,function*(){(i=r6.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}yi(r6.ID,r6,4);dt(d_t);dt(h_t);dt(f_t);dt(p_t);const g_t=de("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class m_t extends Ot{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.jumpToBracket()}}class T_t extends Ot{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var r;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(r=Ed.get(t))===null||r===void 0||r.selectToBracket(o)}}class v_t extends Ot{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:oe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Ed.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class Q_t{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ed extends Pe{static get(e){return e.getContribution(Ed.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Qr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(69),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(69)&&(this._matchBrackets=this._editor.getOption(69),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const r=i.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new Ht(s.lineNumber,s.column,s.lineNumber,s.column):new Ht(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const u=t.bracketPairs.findNextBracket(o);u&&u.range&&(s=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(G.compareRangesUsingStarts);const[u,c]=s;if(a=e?u.getStartPosition():u.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&i.push(new Ht(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const r=i.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const r=i.brackets;r&&(e[t++]={range:r[0],options:i.options},e[t++]={range:r[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let r=[];this._lastVersionId===i&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(De.compare);const a=[];let l=0,u=0;const c=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}dt(C_t);var w_t=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const c8="9_cutcopypaste",x_t=F2||document.queryCommandSupported("cut"),rOe=F2||document.queryCommandSupported("copy"),L_t=typeof navigator.clipboard>"u"||I1?document.queryCommandSupported("paste"):!0;function Zue(n){return n.register(),n}const S_t=x_t?Zue(new tb({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:F2?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.cutLabel","Cut"),when:oe.writable,order:1}]})):void 0,D_t=rOe?Zue(new tb({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:F2?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;xl.appendMenuItem(se.MenubarEditMenu,{submenu:se.MenubarCopy,title:{value:w("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextCopy,title:{value:w("copy as","Copy As"),original:"Copy As"},group:c8,order:3});xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1,when:ct.and(ct.notEquals("resourceScheme","output"),oe.editorTextFocus)});xl.appendMenuItem(se.EditorTitleContext,{submenu:se.EditorTitleContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1});xl.appendMenuItem(se.ExplorerContext,{submenu:se.ExplorerContextShare,title:{value:w("share","Share"),original:"Share"},group:"11_share",order:-1});const AZ=L_t?Zue(new tb({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:F2?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:se.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:se.EditorContext,group:c8,title:w("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4},{menuId:se.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:se.SimpleEditorContext,group:c8,title:w("actions.clipboard.pasteLabel","Paste"),when:oe.writable,order:4}]})):void 0;class E_t extends Ot{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(35)&&t.getSelection().isEmpty()||(tne.forceCopyWithSyntaxHighlighting=!0,t.focus(),document.execCommand("copy"),tne.forceCopyWithSyntaxHighlighting=!1)}}function oOe(n,e){!n||(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Mi).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(35),s=r.getSelection();return s&&s.isEmpty()&&!o||document.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(document.execCommand(e),!0)))}oOe(S_t,"cut");oOe(D_t,"copy");AZ&&(AZ.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(Mi),i=n.get(Q6),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?!document.execCommand("paste")&&C7?(()=>w_t(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=fL.INSTANCE.get(s);let l=!1,u=null,c=null;a&&(l=r.getOption(35)&&!!a.isFromEmptySelection,u=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),r.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:u,mode:c})}}))():!0:!1}),AZ.addImplementation(0,"generic-dom",(n,e)=>(document.execCommand("paste"),!0)));rOe&&dt(E_t);var k_t=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Mn{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+Mn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Mn(this.value+Mn.sep+e)}}Mn.sep=".";Mn.None=new Mn("@@none@@");Mn.Empty=new Mn("");Mn.QuickFix=new Mn("quickfix");Mn.Refactor=new Mn("refactor");Mn.RefactorExtract=Mn.Refactor.append("extract");Mn.RefactorInline=Mn.Refactor.append("inline");Mn.RefactorMove=Mn.Refactor.append("move");Mn.RefactorRewrite=Mn.Refactor.append("rewrite");Mn.Source=new Mn("source");Mn.SourceOrganizeImports=Mn.Source.append("organizeImports");Mn.SourceFixAll=Mn.Source.append("fixAll");Mn.SurroundWith=Mn.Refactor.append("surround");var Gc;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(Gc||(Gc={}));function M_t(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>sOe(e,t,n.include))||!n.includeSourceActions&&Mn.Source.contains(e))}function A_t(n,e){const t=e.kind?new Mn(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>sOe(t,i,n.include))||!n.includeSourceActions&&t&&Mn.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function sOe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class ch{static fromUser(e,t){return!e||typeof e!="object"?new ch(t.kind,t.apply,!1):new ch(ch.getKindFromUser(e,t.kind),ch.getApplyFromUser(e,t.apply),ch.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 Mn(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class N_t{constructor(e,t){this.action=e,this.provider=t}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 i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(r){Cs(r)}i&&(this.action.edit=i.edit)}return this})}}var LH=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const aOe="editor.action.codeAction",Xue="editor.action.quickFix",lOe="editor.action.autoFix",uOe="editor.action.refactor",cOe="editor.action.sourceAction",Yue="editor.action.organizeImports",Jue="editor.action.fixAll";class Qx extends Pe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return ol(e.diagnostics)?ol(t.diagnostics)?Qx.codeActionsPreferredComparator(e,t):-1:ol(t.diagnostics)?1:Qx.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Qx.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Mn.QuickFix.contains(new Mn(e.kind))&&!!e.isPreferred)}}const Rme={actions:[],documentation:void 0};function ece(n,e,t,i,r,o){var s;return LH(this,void 0,void 0,function*(){const a=i.filter||{},l={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},u=new Wue(e,o),c=O_t(n,e,a),d=new st,h=c.map(g=>LH(this,void 0,void 0,function*(){try{r.report(g);const T=yield g.provideCodeActions(e,t,l,u.token);if(T&&d.add(T),u.token.isCancellationRequested)return Rme;const v=((T==null?void 0:T.actions)||[]).filter(b=>b&&A_t(a,b)),Q=R_t(g,v,a.include);return{actions:v.map(b=>new N_t(b,g)),documentation:Q}}catch(T){if(u0(T))throw T;return Cs(T),Rme}})),f=n.onDidChange(()=>{const g=n.all(e);Na(g,c)||u.cancel()});try{const g=yield Promise.all(h),T=g.map(Q=>Q.actions).flat(),v=[...Rh(g.map(Q=>Q.documentation)),...I_t(n,e,i,T)];return new Qx(T,v,d)}finally{f.dispose(),u.dispose()}})}function O_t(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>M_t(t,new Mn(r))):!0)}function*I_t(n,e,t,i){var r,o,s;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},i.map(l=>l.action)))}function R_t(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new Mn(r.kind),command:r.command}));if(t){let r;for(const o of i)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(!!r.kind){for(const o of i)if(o.kind.contains(new Mn(r.kind)))return o.command}}var SH;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(SH||(SH={}));function H_t(n,e,t,i,r=Jn.None){var o;return LH(this,void 0,void 0,function*(){const s=n.get(gD),a=n.get(Qo),l=n.get(Jc),u=n.get(Fo);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield s.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==SH.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const d=P_t(c);u.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function P_t(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}mi.registerCommand("_executeCodeActionProvider",function(n,e,t,i,r){return LH(this,void 0,void 0,function*(){if(!(e instanceof on))throw E1();const{codeActionProvider:o}=n.get(Vt),s=n.get(Kr).getModel(e);if(!s)throw E1();const a=Ht.isISelection(t)?Ht.liftSelection(t):G.isIRange(t)?s.validateRange(t):void 0;if(!a)throw E1();const l=typeof i=="string"?new Mn(i):void 0,u=yield ece(o,s,a,{type:1,triggerAction:Gc.Default,filter:{includeSourceActions:!0,include:l}},J8.None,Jn.None),c=[],d=Math.min(u.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>u.dispose(),100)}})});var V_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DH=class dOe{constructor(e){this.keybindingService=e}getResolver(){const e=new Jh(()=>this.keybindingService.getKeybindings().filter(t=>dOe.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Yue?i={kind:Mn.SourceOrganizeImports.value}:t.command===Jue&&(i={kind:Mn.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},ch.fromUser(i,{kind:Mn.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Mn(e.kind);return t.filter(r=>r.kind.contains(i)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};DH.codeActionCommands=[uOe,aOe,cOe,Yue,Jue];DH=V_t([F_t(0,Ir)],DH);de("symbolIcon.arrayForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.booleanForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.colorForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.constantForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.fileForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.folderForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.keyForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.keywordForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.moduleForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.namespaceForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.nullForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.numberForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.objectForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.operatorForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.packageForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.propertyForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.referenceForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.snippetForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.stringForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.structForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.textForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.typeParameterForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.unitForeground",{dark:gt,light:gt,hcDark:gt,hcLight:gt},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));de("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const hOe=Object.freeze({kind:Mn.Empty,title:w("codeAction.widget.id.more","More Actions...")}),B_t=Object.freeze([{kind:Mn.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix...")},{kind:Mn.RefactorExtract,title:w("codeAction.widget.id.extract","Extract..."),icon:_t.wrench},{kind:Mn.RefactorInline,title:w("codeAction.widget.id.inline","Inline..."),icon:_t.wrench},{kind:Mn.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite..."),icon:_t.wrench},{kind:Mn.RefactorMove,title:w("codeAction.widget.id.move","Move..."),icon:_t.wrench},{kind:Mn.SurroundWith,title:w("codeAction.widget.id.surround","Surround With..."),icon:_t.symbolSnippet},{kind:Mn.Source,title:w("codeAction.widget.id.source","Source Action..."),icon:_t.symbolFile},hOe]);function $_t(n,e,t){if(!e)return n.map(o=>({kind:"action",item:o,group:hOe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title}));const i=B_t.map(o=>({group:o,actions:[]}));for(const o of n){const s=o.action.kind?new Mn(o.action.kind):Mn.None;for(const a of i)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of i)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions)r.push({kind:"action",item:s,group:o.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return r}var j_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},KT;(function(n){n.Hidden={type:0};class e{constructor(i,r,o,s){this.actions=i,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}n.Showing=e})(KT||(KT={}));let d8=class fOe extends Pe{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new xe),this.onClick=this._onClick.event,this._state=KT.Hidden,this._domNode=at("div.lightBulbWidget"),this._register(gr.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),this._register(u3t(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:o}=Os(this._domNode),s=this._editor.getOption(64);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(62)&&!this._editor.getOption(62).enabled&&this.hide()})),this._register(Ut.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,r;this._preferredKbLabel=ca((i=t.lookupKeybinding(lOe))===null||i===void 0?void 0:i.getLabel()),this._quickFixKbLabel=ca((r=t.lookupKeybinding(Xue))===null||r===void 0?void 0:r.getLabel()),this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const r=this._editor.getOptions();if(!r.get(62).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,u=r.get(48),c=o.getLineContent(s),d=oF(c,l),h=u.spaceWidth*d>22,f=T=>T>2&&this._editor.getTopForLineNumber(T)===this._editor.getTopForLineNumber(T-1);let g=s;if(!h){if(s>1&&!f(s-1))g-=1;else if(!f(s+1))g+=1;else if(a*u.spaceWidth<22)return this.hide()}this.state=new KT.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:fOe._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==KT.Hidden&&(this.state=KT.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(...dn.asClassNameArray(_t.lightBulb)),this._domNode.classList.add(...dn.asClassNameArray(_t.lightbulbAutofix)),this._preferredKbLabel)){this.title=w("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...dn.asClassNameArray(_t.lightbulbAutofix)),this._domNode.classList.add(...dn.asClassNameArray(_t.lightBulb)),this._quickFixKbLabel?this.title=w("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=w("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};d8.ID="editor.contrib.lightbulbWidget";d8._posPref=[0];d8=j_t([W_t(1,Ir)],d8);var z_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},U_t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ic=class Oie{static get(e){return e.getContribution(Oie.ID)}constructor(e,t){this._messageWidget=new Ra,this._messageListeners=new st,this._editor=e,this._visible=Oie.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Ys(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new Hme(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(new W1(()=>this.closeMessage(),3e3));let i;this._messageListeners.add(this._editor.onMouseMove(r=>{!r.target.position||(i?i.containsPosition(r.target.position)||this.closeMessage():i=new G(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Hme.fadeOut(this._messageWidget.value))}};ic.ID="editor.contrib.messageController";ic.MESSAGE_VISIBLE=new It("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));ic=z_t([U_t(1,_n)],ic);const q_t=Ps.bindToContribution(ic.get);vt(new q_t({id:"leaveEditorMessage",precondition:ic.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));class Hme{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("message"),s.textContent=r,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)}}yi(ic.ID,ic,4);var pOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Iie=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const gOe="acceptSelectedCodeAction",mOe="previewSelectedCodeAction";class G_t{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var r,o;i.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Rie=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const r=new vD(e,Ac);return{container:e,icon:t,text:i,keybinding:r}}renderElement(e,t,i){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(i.icon.className=dn.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=At(e.group.icon.color.id))):(i.icon.className=dn.asClassName(_t.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=TOe(e.label),i.keybinding.set(e.keybinding),b3t(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(gOe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(mOe))===null||s===void 0?void 0:s.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview?i.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};Rie=pOe([Iie(1,Ir)],Rie);class K_t extends UIEvent{constructor(){super("acceptSelectedAction")}}class Pme extends UIEvent{constructor(){super("previewSelectedAction")}}let Hie=class extends Pe{constructor(e,t,i,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,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 Wd(e,this.domNode,a,[new Rie(t,this._keybindingService),new G_t],{keyboardSupport:!1,accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let u=l.label?TOe(l==null?void 0:l.label):"";return l.disabled&&(u=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",u,l.disabled)),u}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(em),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this._list.domFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(u=>u.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);const o=this._allMenuItems.map((u,c)=>{const d=document.getElementById(this._list.getElementID(c));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...o,e),a=.7,l=Math.min(r,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 i=t[0],r=this._list.element(i);if(!this.focusCondition(r))return;const o=e?new Pme:new K_t;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Pme):this._list.setSelection([])}onListHover(e){this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Hie=pOe([Iie(4,b6),Iie(5,Ir)],Hie);function TOe(n){return n.replace(/\r\n|\r|\n/g," ")}var Z_t=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const h8={Visible:new It("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},im=oi("actionWidgetService");let f8=class extends Pe{get isVisible(){return h8.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ra)}show(e,t,i,r,o,s,a){const l=h8.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Hie,e,t,i,r);this._contextViewService.showContextView({getAnchor:()=>o,render:c=>(l.set(!0),this._renderWidget(c,u,a!=null?a:[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},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,i){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new st,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(Ye(l,kt.MOUSE_DOWN,g=>g.stopPropagation()));const u=document.createElement("div"),c=e.appendChild(u);c.classList.add("context-view-pointerBlock"),s.add(Ye(c,kt.POINTER_MOVE,()=>c.remove())),s.add(Ye(c,kt.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(Fh(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const i=at(e),r=new F1(i);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};f8=Z_t([NZ(0,b6),NZ(1,_n),NZ(2,Sn)],f8);gi(im,f8,1);const CD=100+1e3;ps(class extends T6{constructor(){super({id:"hideCodeActionWidget",title:{value:w("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:h8.Visible,keybinding:{weight:CD,primary:9,secondary:[1033]}})}run(n){n.get(im).hide()}});ps(class extends T6{constructor(){super({id:"selectPrevCodeAction",title:{value:w("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:h8.Visible,keybinding:{weight:CD,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(im);e instanceof f8&&e.focusPrevious()}});ps(class extends T6{constructor(){super({id:"selectNextCodeAction",title:{value:w("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:h8.Visible,keybinding:{weight:CD,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(im);e instanceof f8&&e.focusNext()}});ps(class extends T6{constructor(){super({id:gOe,title:{value:w("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:h8.Visible,keybinding:{weight:CD,primary:3,secondary:[2137]}})}run(n){const e=n.get(im);e instanceof f8&&e.acceptSelected()}});ps(class extends T6{constructor(){super({id:mOe,title:{value:w("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:h8.Visible,keybinding:{weight:CD,primary:2051}})}run(n){const e=n.get(im);e instanceof f8&&e.acceptSelected(!0)}});var OZ=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},X_t=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},pT;const vOe=new It("supportedCodeAction","");class Y_t extends Pe{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new W1),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>aF(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Gc.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:r,column:o}=i.getPosition(),s=t.getLineContent(r);if(s.length===0)return;if(o===1){if(/\s/.test(s[0]))return}else if(o===t.getLineMaxColumn(r)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return i}}var pg;(function(n){n.Empty={type:0};class e{constructor(i,r,o){this.trigger=i,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(u0(s))return J_t;throw s})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(pg||(pg={}));const J_t=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class eCt extends Pe{constructor(e,t,i,r,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._codeActionOracle=this._register(new Ra),this._state=pg.Empty,this._onDidChangeState=this._register(new xe),this.onDidChangeState=this._onDidChangeState.event,pT.set(this,!1),this._supportedCodeActions=vOe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){OZ(this,pT,"f")||(X_t(this,pT,!0,"f"),super.dispose(),this.setState(pg.Empty,!0))}_update(){if(OZ(this,pT,"f"))return;this._codeActionOracle.value=void 0,this.setState(pg.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(88)){const t=this._registry.all(e).flatMap(i=>{var r;return(r=i.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Y_t(this._editor,this._markerService,i=>{var r;if(!i){this.setState(pg.Empty);return}const o=bs(s=>ece(this._registry,e,i.selection,i.trigger,J8.None,s));i.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(o,250)),this.setState(new pg.Triggered(i.trigger,i.selection.getStartPosition(),o))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Gc.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&&!OZ(this,pT,"f")&&this._onDidChangeState.fire(e))}}pT=new WeakMap;var tCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},nCt=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},iCt=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},dI;let p8=class QOe extends Pe{static get(e){return e.getContribution(QOe.ID)}constructor(e,t,i,r,o,s,a,l,u,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=u,this._instantiationService=c,this._activeCodeActions=this._register(new Ra),this._showDisabled=!1,dI.set(this,!1),this._editor=e,this._model=this._register(new eCt(this._editor,o.codeActionProvider,t,i,s)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Jh(()=>{const d=this._editor.getContribution(d8.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=r.createInstance(DH),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){nCt(this,dI,!0,"f"),super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,r){var o;if(!this._editor.hasModel())return;(o=ic.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return sN(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(H_t,e,SH.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Gc.QuickFix,filter:{}})}})}update(e){var t,i,r,o,s,a,l;return sN(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let u;try{u=yield e.actions}catch(c){$n(c);return}if(!iCt(this,dI,"f"))if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(u,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,u);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(d,!1,!1)}finally{u.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,u);if(h&&h.action.disabled){(s=ic.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),u.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!u.allActions.length||!c&&!u.validActions.length)){(l=ic.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=u,u.dispose();return}this._activeCodeActions.value=u,this.showCodeActionList(u,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?u.dispose():this._activeCodeActions.value=u})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(!!t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(!!t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return sN(this,void 0,void 0,function*(){const r=this._editor.getDomNode();if(!r)return;const o=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!o.length)return;const s=De.isIPosition(t)?this.toCoords(t):t,a={onSelect:(l,u)=>sN(this,void 0,void 0,function*(){this._applyCodeAction(l,!0,!!u),this._actionWidgetService.hide()}),onHide:()=>{var l;(l=this._editor)===null||l===void 0||l.focus()}};this._actionWidgetService.show("codeActionWidget",!0,$_t(o,this._shouldShowHeaders(),this._resolver.getResolver()),a,s,r,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Os(this._editor.getDomNode()),r=i.left+t.left,o=i.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}};dI=new WeakMap;p8.ID="editor.contrib.codeActionController";p8=tCt([B3(1,i3),B3(2,_n),B3(3,Sn),B3(4,Vt),B3(5,k7),B3(6,Qo),B3(7,bi),B3(8,im),B3(9,Sn)],p8);function wD(n){return ct.regex(vOe.keys()[0],new RegExp("(\\s|^)"+zc(n.value)+"\\b"))}const tce={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function rm(n,e,t,i,r=Gc.Default){if(n.hasModel()){const o=p8.get(n);o==null||o.manualTriggerAtCurrentPosition(e,r,t,i)}}class rCt extends Ot{constructor(){super({id:Xue,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:2137,weight:100}})}run(e,t){return rm(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Gc.QuickFix)}}class oCt extends Ps{constructor(){super({id:aOe,precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:tce}]}})}runEditorCommand(e,t,i){const r=ch.fromUser(i,{kind:Mn.Empty,apply:"ifSingle"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class sCt extends Ot{constructor(){super({id:uOe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),kbOpts:{kbExpr:oe.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ct.and(oe.writable,wD(Mn.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:tce}]}})}run(e,t,i){const r=ch.fromUser(i,{kind:Mn.Refactor,apply:"never"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:Mn.Refactor.contains(r.kind)?r.kind:Mn.None,onlyIncludePreferredActions:r.preferred},r.apply,Gc.Refactor)}}class aCt extends Ot{constructor(){super({id:cOe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:ct.and(oe.writable,oe.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ct.and(oe.writable,wD(Mn.Source))},description:{description:"Source Action...",args:[{name:"args",schema:tce}]}})}run(e,t,i){const r=ch.fromUser(i,{kind:Mn.Source,apply:"never"});return rm(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:Mn.Source.contains(r.kind)?r.kind:Mn.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Gc.SourceAction)}}class lCt extends Ot{constructor(){super({id:Yue,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ct.and(oe.writable,wD(Mn.SourceOrganizeImports)),kbOpts:{kbExpr:oe.textInputFocus,primary:1581,weight:100}})}run(e,t){return rm(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:Mn.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Gc.OrganizeImports)}}class uCt extends Ot{constructor(){super({id:Jue,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:ct.and(oe.writable,wD(Mn.SourceFixAll))})}run(e,t){return rm(t,w("fixAll.noneMessage","No fix all action available"),{include:Mn.SourceFixAll,includeSourceActions:!0},"ifSingle",Gc.FixAll)}}class cCt extends Ot{constructor(){super({id:lOe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ct.and(oe.writable,wD(Mn.QuickFix)),kbOpts:{kbExpr:oe.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return rm(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Mn.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Gc.AutoFix)}}yi(p8.ID,p8,3);yi(d8.ID,d8,4);dt(rCt);dt(sCt);dt(aCt);dt(lCt);dt(cCt);dt(uCt);vt(new oCt);vo.as(g6.Configuration).registerConfiguration(Object.assign(Object.assign({},HAe),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));var Vme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class Pie{constructor(){this.lenses=[],this._disposables=new st}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function bOe(n,e,t){return Vme(this,void 0,void 0,function*(){const i=n.ordered(e),r=new Map,o=new Pie,s=i.map((a,l)=>Vme(this,void 0,void 0,function*(){r.set(a,l);try{const u=yield Promise.resolve(a.provideCodeLenses(e,t));u&&o.add(u,a)}catch(u){Cs(u)}}));return yield Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o})}mi.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Xi(on.isUri(t)),Xi(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(Vt),o=n.get(Kr).getModel(t);if(!o)throw E1();const s=[],a=new st;return bOe(r,o,Jn.None).then(l=>{a.add(l);const u=[];for(const c of l.lenses)i==null||Boolean(c.symbol.command)?s.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&u.push(Promise.resolve(c.provider.resolveCodeLens(o,c.symbol,Jn.None)).then(d=>s.push(d||c.symbol)));return Promise.all(u)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var dCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hCt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const yOe=oi("ICodeLensCache");class Fme{constructor(e,t){this.lineCount=e,this.data=t}}let Vie=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new E7(20,.75);const t="codelens/cache";y4(()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r),Hh(e.onWillSaveState)(o=>{o.reason===uH.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=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}}}),r=new Pie;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new Fme(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const r=new Set;for(const o of i.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const r=t[i],o=[];for(const a of r.lines)o.push({range:new G(a,1,a,11)});const s=new Pie;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new Fme(r.lineCount,s))}}catch{}}};Vie=dCt([hCt(0,qd)],Vie);gi(yOe,Vie,1);class fCt{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class FF{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${FF._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let r=!1;for(let o=0;o{u.symbol.command&&l.push(u.symbol),i.addDecoration({range:u.symbol.range,options:Bme},d=>this._decorationIds[c]=d),a?a=G.plusRange(a,u.symbol.range):a=G.lift(u.symbol.range)}),this._viewZone=new fCt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new FF(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(i&&G.isEmpty(r.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,r)=>{t.addDecoration({range:i.symbol.range,options:Bme},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let dQ=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new st,this._localToDispose=new st,this._lenses=[],this._oldCodeLensModels=new st,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Qr(()=>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(48)||a.hasChanged(17)||a.hasChanged(16))&&this._updateLensStyle(),a.hasChanged(15)&&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(64)/this._editor.getOption(50));let t=this._editor.getOption(17);return(!t||t<5)&&(t=this._editor.getOption(50)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(16),r=this._editor.getOption(48),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Ju.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(15))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Uf(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new Qr(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=bs(s=>bOe(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()-o);i.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},$n)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Bn(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(s),l=c.getLineNumber())});const u=new IZ;a.forEach(c=>{c.dispose(u,s),this._lenses.splice(this._lenses.indexOf(c),1)}),u.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Bn(()=>{if(this._editor.getModel()){const r=Y2.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new IZ;for(const r of this._lenses)r.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],i.push(r)))}if(!i.length&&!this._lenses.length)return;const o=Y2.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const u=new IZ;let c=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),c++,d++)}for(;cthis._resolveCodeLensesInViewportSoon())),d++;u.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),r.push(a))}),i.length===0)return;const o=Date.now(),s=bs(a=>{const l=i.map((u,c)=>{const d=new Array(u.length),h=u.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(T=>{d[g]=T},Cs):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[c].isDisposed()&&r[c].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{$n(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){return this._currentCodeLensModel}};dQ.ID="css.editor.codeLens";dQ=pCt([eC(1,Vt),eC(2,G1),eC(3,Qo),eC(4,Fo),eC(5,yOe)],dQ);yi(dQ.ID,dQ,1);dt(class extends Ot{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:oe.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return gCt(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(c0),r=e.get(Qo),o=e.get(Fo),s=t.getSelection().positionLineNumber,a=t.getContribution(dQ.ID);if(!a)return;const l=a.getModel();if(!l)return;const u=[];for(const d of l.lenses)d.symbol.command&&d.symbol.range.startLineNumber===s&&u.push({label:d.symbol.command.title,command:d.symbol.command});if(u.length===0)return;const c=yield i.pick(u,{canPickMany:!1});if(!!c){if(l.isDisposed)return yield r.executeCommand(this.id);try{yield r.executeCommand(c.command.id,...c.command.arguments||[])}catch(d){o.error(d)}}})}});var mCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class nce{constructor(e,t){this._editorWorkerClient=new dle(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return TCt(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const r=t.range,o=t.color,s=o.alpha,a=new Re(new ci(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?Re.Format.CSS.formatRGB(a):Re.Format.CSS.formatRGBA(a),u=s?Re.Format.CSS.formatHSL(a):Re.Format.CSS.formatHSLA(a),c=s?Re.Format.CSS.formatHex(a):Re.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:u,textEdit:{range:r,text:u}}),d.push({label:c,textEdit:{range:r,text:c}}),d}}let Fie=class extends Pe{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new nce(e,t)))}};Fie=mCt([RZ(0,Kr),RZ(1,br),RZ(2,Vt)],Fie);MF(Fie);var xD=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function _Oe(n,e,t,i=!0){return xD(this,void 0,void 0,function*(){return ice(new vCt,n,e,t,i)})}function COe(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class vCt{constructor(){}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)})}}class QCt{constructor(){}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)})}}class bCt{constructor(e){this.colorInfo=e}compute(e,t,i,r){return xD(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,Jn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)})}}function ice(n,e,t,i,r){return xD(this,void 0,void 0,function*(){let o=!1,s;const a=[],l=e.ordered(t);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c instanceof nce)s=c;else try{(yield n.compute(c,t,i,a))&&(o=!0)}catch(d){Cs(d)}}return o?a:s&&r?(yield n.compute(s,t,i,a),a):[]})}function wOe(n,e){const{colorProvider:t}=n.get(Vt),i=n.get(Kr).getModel(e);if(!i)throw E1();const r=n.get(bi).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}mi.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof on))throw E1();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=wOe(n,t);return ice(new QCt,r,i,Jn.None,o)});mi.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:o}=i;if(!(r instanceof on)||!Array.isArray(t)||t.length!==4||!G.isIRange(o))throw E1();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=wOe(n,r),[u,c,d,h]=t;return ice(new bCt({range:o,color:{red:u,green:c,blue:d,alpha:h}}),a,s,Jn.None,l)});var yCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const xOe=Object.create({});let e7=class LOe extends Pe{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new st),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new aD(this._editor),this._decoratorLimitReporter=new _Ct,this._colorDecorationClassRefs=this._register(new st),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:LOe.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(142);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(19),l=o.hasChanged(142);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(142),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const r=i.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(18)}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 W1,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return jme(this,void 0,void 0,function*(){this._computePromise=bs(e=>jme(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new nu(!1),r=yield _Oe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),r}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){$n(e)}})}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:Vn.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(19);for(let o=0;othis._colorDatas.has(r.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};e7.ID="editor.contrib.colorDetector";e7.RECOMPUTE_TIME=1e3;e7=yCt([HZ(1,bi),HZ(2,Vt),HZ(3,G1)],e7);class _Ct{constructor(){this._onDidChange=new xe,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}yi(e7.ID,e7,1);class CCt{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new xe,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new xe,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let r=0;r{this.backgroundColor=s.getColor(DR)||Re.white})),this._register(Ye(this._pickedColorNode,kt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Ye(this._originalColorNode,kt.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=Re.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 xCt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Re.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:"",this._pickedColorNode.prepend(kc(".codicon.codicon-color-mode"))}}class xCt extends Pe{constructor(e){super(),this._onClicked=this._register(new xe),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ge(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ge(this._button,t),Ge(t,kc(".button"+dn.asCSSSelector(Eo("color-picker-close",_t.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class LCt extends Pe{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=kc(".colorpicker-body"),Ge(e,this._domNode),this._saturationBox=new SCt(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 DCt(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new ECt(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new kCt(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Re(new hh(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Re(new hh(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Re(new hh(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class SCt extends Pe{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,this._domNode=kc(".saturation-wrap"),Ge(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ge(this._domNode,this._canvas),this.selection=kc(".saturation-selection"),Ge(this._domNode,this.selection),this.layout(),this._register(Ye(this._domNode,kt.POINTER_DOWN,r=>this.onPointerDown(r))),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 nb);const t=Os(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const i=Ye(document,kt.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,r),this._onDidChange.fire({s:i,v:r})}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 Re(new hh(e.h,1,1,1)),i=this._canvas.getContext("2d"),r=i.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Re.Format.CSS.format(t),i.fill(),i.fillStyle=r,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class SOe extends Pe{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new xe,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Ge(e,kc(".standalone-strip")),this.overlay=Ge(this.domNode,kc(".standalone-overlay"))):(this.domNode=Ge(e,kc(".strip")),this.overlay=Ge(this.domNode,kc(".overlay"))),this.slider=Ge(this.domNode,kc(".slider")),this.slider.style.top="0px",this._register(Ye(this.domNode,kt.POINTER_DOWN,r=>this.onPointerDown(r))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new nb),i=Os(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const r=Ye(document,kt.POINTER_UP,()=>{this._onColorFlushed.fire(),r.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 DCt extends SOe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:r}=e.rgba,o=new Re(new ci(t,i,r,1)),s=new Re(new ci(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class ECt extends SOe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class kCt extends Pe{constructor(e){super(),this._onClicked=this._register(new xe),this.onClicked=this._onClicked.event,this._button=Ge(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class MCt extends U1{constructor(e,t,i,r,o=!1){super(),this.model=t,this.pixelRatio=i,this._register($v.onDidChange(()=>this.layout()));const s=kc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new wCt(s,this.model,r,o)),this.body=this._register(new LCt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var DOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hQ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class ACt{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let EH=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Zo.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const r=e7.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[yield kOe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return MOe(this,this._editor,this._themeService,t,e)}};EH=DOe([EOe(1,Vs)],EH);class NCt{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let WL=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!e7.get(this._editor))return null;const o=yield _Oe(i,this._editor.getModel(),Jn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;G.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s!=null?s:e,u=a!=null?a:t,c=!!s;return{colorHover:yield kOe(this,this._editor.getModel(),l,u),foundInEditor:c}})}updateEditorModel(e){return hQ(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new G(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield hI(this._editor.getModel(),t,this._color,i,e),i=AOe(this._editor,i,t))})}renderHoverParts(e,t){return MOe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};WL=DOe([EOe(1,Vs)],WL);function kOe(n,e,t,i){return hQ(this,void 0,void 0,function*(){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,u=new ci(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),c=new Re(u),d=yield COe(e,t,i,Jn.None),h=new CCt(c,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(c,r),n instanceof EH?new ACt(n,G.lift(t.range),h,i):new NCt(n,G.lift(t.range),h,i)})}function MOe(n,e,t,i,r){if(i.length===0||!e.hasModel())return Pe.None;const o=new st,s=i[0],a=e.getModel(),l=s.model,u=o.add(new MCt(r.fragment,l,e.getOption(138),t,n instanceof WL));r.setColorPicker(u);let c=new G(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(n instanceof WL){const d=i[0].model.color;n.color=d,hI(a,l,d,c,s),o.add(l.onColorFlushed(h=>{n.color=h}))}else o.add(l.onColorFlushed(d=>hQ(this,void 0,void 0,function*(){yield hI(a,l,d,c,s),c=AOe(e,c,l,r)})));return o.add(l.onDidChangeColor(d=>{hI(a,l,d,c,s)})),o}function AOe(n,e,t,i){let r,o;if(t.presentation.textEdit){r=[t.presentation.textEdit],o=new G(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",r),o=n.getModel()._getTrackedRange(s)||o}else r=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",r);return t.presentation.additionalTextEdits&&(r=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",r),i&&i.hide()),n.pushUndoStop(),o}function hI(n,e,t,i,r){return hQ(this,void 0,void 0,function*(){const o=yield COe(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Jn.None);e.colorPresentations=o||[]})}function Bie(n,e){return!!n[e]}class PZ{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Bie(e.event,t.triggerModifier),this.hasSideBySideModifier=Bie(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Wme{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Bie(e,t.triggerModifier)}}class aN{constructor(e,t,i,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function zme(n){return n==="altKey"?Yn?new aN(57,"metaKey",6,"altKey"):new aN(5,"ctrlKey",6,"altKey"):Yn?new aN(6,"altKey",57,"metaKey"):new aN(6,"altKey",5,"ctrlKey")}class BF extends Pe{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new xe),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new xe),this.onExecute=this._onExecute.event,this._onCancel=this._register(new xe),this.onCancel=this._onCancel.event,this._editor=e,this._alwaysFireExecuteOnMouseUp=t,this._opts=zme(this._editor.getOption(75)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(75)){const r=zme(this._editor.getOption(75));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(i=>this._onEditorMouseMove(new PZ(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new PZ(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new PZ(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new Wme(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new Wme(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;(this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t||this._alwaysFireExecuteOnMouseUp)&&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 OCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let t7=class extends eQ{constructor(e,t,i,r,o,s,a,l,u,c,d,h,f){super(e,Object.assign(Object.assign({},r.getRawOptions()),{overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()}),i,o,s,a,l,u,c,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){GS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};t7=OCt([$3(4,Sn),$3(5,Mi),$3(6,Qo),$3(7,_n),$3(8,Vs),$3(9,Fo),$3(10,L7),$3(11,br),$3(12,Vt)],t7);const Ume=new Re(new ci(0,122,204)),ICt={showArrow:!0,showFrame:!0,className:"",frameColor:Ume,arrowColor:Ume,keepEditorSelection:!1},RCt="vs.editor.contrib.zoneWidget";class HCt{constructor(e,t,i,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class PCt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class $F{constructor(e){this._editor=e,this._ruleName=$F._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Vpe(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(){Vpe(this._ruleName),Wte(`.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:G.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}$F._IdGenerator=new due(".arrow-decoration-");class VCt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new st,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=r4(t),GS(this.options,ICt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const r=this._getWidth(i);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(r)}))}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 $F(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const r=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(!!e)return e.getStartPosition()}show(e,t){const i=G.isIRange(e)?G.lift(e):G.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Vn.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(64);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(64);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,u=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(u=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 HCt(s,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new PCt(RCt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:u;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new G(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.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 Ya(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(64),r=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var NOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const IOe=oi("IPeekViewService");gi(IOe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const r=this._widgets.get(n);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var xu;(function(n){n.inPeekEditor=new It("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(xu||(xu={}));let zL=class{constructor(e,t){e instanceof t7&&xu.inPeekEditor.bindTo(t)}dispose(){}};zL.ID="editor.contrib.referenceController";zL=NOe([OOe(1,_n)],zL);yi(zL.ID,zL,0);function FCt(n){const e=n.get(Mi).getFocusedCodeEditor();return e instanceof t7?e.getParentEditor():e}const BCt={headerBackgroundColor:Re.white,primaryHeadingColor:Re.fromHex("#333333"),secondaryHeadingColor:Re.fromHex("#6c6c6cb3")};let kH=class extends VCt{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new xe,this.onDidClose=this._onDidClose.event,GS(this.options,BCt,!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=at(".head"),this._bodyElement=at(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=at(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),es(this._titleElement,"click",o=>this._onTitleClick(o))),Ge(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=at("span.filename"),this._secondaryHeading=at("span.dirname"),this._metaHeading=at("span.meta"),Ge(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=at(".peekview-actions");Ge(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new F1(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new nc("peekview.close",w("label.close","Close"),dn.asClassName(_t.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:rTt.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:ys(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Uu(this._metaHeading)):ql(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(64)*1.2),r=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(r,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`)}};kH=NOe([OOe(2,Sn)],kH);const $Ct=de("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Re.black,hcLight:Re.white},w("peekViewTitleBackground","Background color of the peek view title area.")),ROe=de("peekViewTitleLabel.foreground",{dark:Re.white,light:Re.black,hcDark:Re.white,hcLight:_d},w("peekViewTitleForeground","Color of the peek view title.")),HOe=de("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),jCt=de("peekView.border",{dark:Ic,light:Ic,hcDark:ri,hcLight:ri},w("peekViewBorder","Color of the peek view borders and arrow.")),WCt=de("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Re.black,hcLight:Re.white},w("peekViewResultsBackground","Background color of the peek view result list."));de("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Re.white,hcLight:_d},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));de("peekViewResult.fileForeground",{dark:Re.white,light:"#1E1E1E",hcDark:Re.white,hcLight:_d},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));de("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));de("peekViewResult.selectionForeground",{dark:Re.white,light:"#6C6C6C",hcDark:Re.white,hcLight:_d},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const sf=de("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Re.black,hcLight:Re.white},w("peekViewEditorBackground","Background color of the peek view editor."));de("peekViewEditorGutter.background",{dark:sf,light:sf,hcDark:sf,hcLight:sf},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));de("peekViewEditorStickyScroll.background",{dark:sf,light:sf,hcDark:sf,hcLight:sf},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));de("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));de("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));de("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Nr,hcLight:Nr},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var zCt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class n7{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=xne.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?w({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,V1(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",V1(this.uri),this.range.startLineNumber,this.range.startColumn)}}class UCt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:r,column:o-t}),u=new G(r,l.startColumn,r,o),c=new G(s,a,s,1073741824),d=i.getValueInRange(u).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(c).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class UL{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new wl}dispose(){$i(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",V1(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,V1(this.uri),this.uri.fsPath)}resolve(e){return zCt(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new UCt(i))}catch(i){$n(i)}return this})}}class rc{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new xe,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(rc._compareReferences);let r;for(const o of e)if((!r||!Or.isEqual(r.uri,o.uri,!0))&&(r=new UL(this,o.uri),this.groups.push(r)),r.children.length===0||rc._compareReferences(o,r.children[r.children.length-1])!==0){const s=new n7(i===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){$i(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new rc(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let r=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,i.children[r]):(r=i.parent.groups.indexOf(i),t?(r=(r+1)%s,i.parent.groups[r].children[0]):(r=(r+s-1)%s,i.parent.groups[r].children[i.parent.groups[r].children.length-1]))}nearestReference(e,t){const i=this.references.map((r,o)=>({idx:o,prefixLen:Xg(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&G.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Or.compare(e.uri,t.uri)||G.compareRangesUsingStarts(e.range,t.range)}}var jF=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WF=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let $ie=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof rc||e instanceof UL}getChildren(e){if(e instanceof rc)return e.groups;if(e instanceof UL)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};$ie=jF([WF(0,Lu)],$ie);class qCt{getHeight(){return 23}getTemplateId(e){return e instanceof UL?qL.id:LD.id}}let jie=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof n7){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return V1(e.uri)}};jie=jF([WF(0,Ir)],jie);class GCt{getId(e){return e instanceof n7?e.id:e.uri}}let Wie=class extends Pe{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new yH(i,{supportHighlights:!0})),this.badge=new cie(Ge(i,at(".count")),{},$Ae),e.appendChild(i)}set(e,t){const i=lF(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};Wie=jF([WF(1,iQ)],Wie);let qL=class POe{constructor(e){this._instantiationService=e,this.templateId=POe.id}renderTemplate(e){return this._instantiationService.createInstance(Wie,e)}renderElement(e,t,i){i.set(e.element,pF(e.filterData))}disposeTemplate(e){e.dispose()}};qL.id="FileReferencesRenderer";qL=jF([WF(0,Sn)],qL);class KCt{constructor(e){this.label=new Df(e)}set(e,t){var i;const r=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!r||!r.value)this.label.set(`${V1(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!W2.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,pF(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class LD{constructor(){this.templateId=LD.id}renderTemplate(e){return new KCt(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}LD.id="OneReferenceRenderer";class ZCt{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var XCt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},j3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class zF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new st,this._callOnModelChange=new st,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(!!e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(JCt,"ReferencesWidget",this._treeContainer,new qCt,[this._instantiationService.createInstance(qL),this._instantiationService.createInstance(LD)],this._instantiationService.createInstance($ie),i),this._splitView.addView({onDidChange:Ut.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},TH.Distribute),this._splitView.addView({onDidChange:Ut.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},TH.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof n7&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),ql(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tr(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=w("noResults","No results"),Uu(this._messageContainer),Promise.resolve(void 0)):(ql(this._messageContainer),this._decorationsManager=new zF(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const r=this._getFocusedReference();!r||this._onDidSelectReference.fire({element:{uri:r.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Uu(this._treeContainer),Uu(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 n7)return e;if(e instanceof UL&&e.children.length>0)return e.children[0]}revealReference(e){return qme(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return qme(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Un.inMemory?this.setTitle(v7t(e.uri),this._uriLabel.getUriLabel(lF(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const r=yield i;if(!this._model){r.dispose();return}$i(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=G.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()})}};zie=XCt([j3(3,Vs),j3(4,Lu),j3(5,Sn),j3(6,IOe),j3(7,iQ),j3(8,uF),j3(9,Ir),j3(10,$r),j3(11,br)],zie);var ewt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},M9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const om=new It("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let i7=class Uie{static get(e){return e.getContribution(Uie.ID)}constructor(e,t,i,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new st,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=om.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),!!r&&e.containsPosition(r))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=YCt.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(zie,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:u,kind:c}=l;if(!!u)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(u,!1,!1);break;case"side":this.openReference(u,!0,!1);break;case"goto":i?this._gotoReference(u,!0):this.openReference(u,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var u;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(u=this._model)===null||u===void 0||u.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(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,d=new De(e.startLineNumber,e.startColumn),h=this._model.nearestReference(c,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(84)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){!this._widget||(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return Gme(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const r=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(r),yield this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return Gme(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const r=G.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=Uie.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,bs(u=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,$n(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};i7.ID="editor.contrib.referencesController";i7=ewt([M9(2,_n),M9(3,Mi),M9(4,Fo),M9(5,Sn),M9(6,qd),M9(7,bi)],i7);function sm(n,e){const t=FCt(n);if(!t)return;const i=i7.get(t);i&&e(i)}wu.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:ws(2089,60),when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});wu.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.goToNextOrPreviousReference(!0)})}});wu.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:ct.or(om,xu.inPeekEditor),handler(n){sm(n,e=>{e.goToNextOrPreviousReference(!1)})}});mi.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");mi.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");mi.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");mi.registerCommand("closeReferenceSearch",n=>sm(n,e=>e.closeWidget()));wu.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:ct.and(xu.inPeekEditor,ct.not("config.editor.stablePeek"))});wu.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:ct.and(om,ct.not("config.editor.stablePeek"))});wu.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ct.and(om,lNe,Mue.negate(),Aue.negate()),handler(n){var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.revealReference(i[0]))}});wu.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ct.and(om,lNe,Mue.negate(),Aue.negate()),handler(n){var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.openReference(i[0],!0,!0))}});mi.registerCommand("openReference",n=>{var e;const i=(e=n.get(K1).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof n7&&sm(n,r=>r.openReference(i[0],!1,!0))});var VOe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ow=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const rce=new It("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),UF=oi("ISymbolNavigationService");let qie=class{constructor(e,t,i,r){this._editorService=t,this._notificationService=i,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=rce.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new Gie(this._editorService),r=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let u=!1,c=!1;for(const d of t.references)if(aF(d.uri,a.uri))u=!0,c=c||G.containsPosition(d.range,l);else if(u)break;(!u||!c)&&this.reset()});this._currentState=Dd(i,r)}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:G.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};qie=VOe([Ow(0,_n),Ow(1,Mi),Ow(2,Fo),Ow(3,Ir)],qie);gi(UF,qie,1);vt(new class extends Ps{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:rce,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(UF).revealNext(e)}});wu.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:rce,primary:9,handler(n){n.get(UF).reset()}});let Gie=class{constructor(e){this._listener=new Map,this._disposables=new st,this._onDidChange=new xe,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(),$i(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Dd(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)}};Gie=VOe([Ow(0,Mi)],Gie);var oce=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function SD(n,e,t,i){return oce(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{Cs(l)})),s=yield Promise.all(o);return Rh(s.flat())})}function qF(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideDefinition(o,s,i))}function FOe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideDeclaration(o,s,i))}function BOe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideImplementation(o,s,i))}function $Oe(n,e,t,i){return SD(e,t,n,(r,o,s)=>r.provideTypeDefinition(o,s,i))}function GF(n,e,t,i,r){return SD(e,t,n,(o,s,a)=>oce(this,void 0,void 0,function*(){const l=yield o.provideReferences(s,a,{includeDeclaration:!0},r);if(!i||!l||l.length!==2)return l;const u=yield o.provideReferences(s,a,{includeDeclaration:!1},r);return u&&u.length===1?u:l}))}function DD(n){return oce(this,void 0,void 0,function*(){const e=yield n(),t=new rc(e,""),i=t.references.map(r=>r.link);return t.dispose(),i})}n3("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(Vt),r=qF(i.definitionProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(Vt),r=$Oe(i.typeDefinitionProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(Vt),r=FOe(i.declarationProvider,e,t,Jn.None);return DD(()=>r)});n3("_executeReferenceProvider",(n,e,t)=>{const i=n.get(Vt),r=GF(i.referenceProvider,e,t,!1,Jn.None);return DD(()=>r)});n3("_executeImplementationProvider",(n,e,t)=>{const i=n.get(Vt),r=BOe(i.implementationProvider,e,t,Jn.None);return DD(()=>r)});var kd=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},VZ,FZ,BZ,$Z,jZ,WZ,zZ,UZ;xl.appendMenuItem(se.EditorContext,{submenu:se.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class fQ{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof fQ||De.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Cl extends U8{static all(){return Cl._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of pi.wrap(t.menu))(i.id===se.EditorContext||i.id===se.EditorContextPeek)&&(i.when=ct.and(e.precondition,i.when));return t}constructor(e,t){super(Cl._patchConfig(t)),this.configuration=e,Cl._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Fo),s=e.get(Mi),a=e.get(k7),l=e.get(UF),u=e.get(Vt),c=e.get(Sn),d=t.getModel(),h=t.getPosition(),f=fQ.is(i)?i:new fQ(d,h),g=new Jf(t,5),T=FV(this._getLocationModel(u,f.model,f.position,g.token),g.token).then(v=>kd(this,void 0,void 0,function*(){var Q;if(!v||g.token.isCancellationRequested)return;Ys(v.ariaMessage);let b;if(v.referenceAt(d.uri,h)){const C=this._getAlternativeCommand(t);!Cl._activeAlternativeCommands.has(C)&&Cl._allSymbolNavigationCommands.has(C)&&(b=Cl._allSymbolNavigationCommands.get(C))}const _=v.references.length;if(_===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(h);(Q=ic.get(t))===null||Q===void 0||Q.showMessage(this._getNoResultFoundMessage(C),h)}}else if(_===1&&b)Cl._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(C=>b.runEditorCommand(C,t,i,r).finally(()=>{Cl._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)}),v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(T,250),T}_onResult(e,t,i,r,o){return kd(this,void 0,void 0,function*(){const s=this._getGoToPreference(i);if(!(i instanceof t7)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(i,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",u=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&u?this._openInPeek(u,r,o):r.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,i,r,o){return kd(this,void 0,void 0,function*(){let s;if(hdt(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:G.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(!!a){if(o){const l=a.getModel(),u=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&u.clear()},350)}return a}})}_openInPeek(e,t,i){const r=i7.get(e);r&&e.hasModel()?r.toggleWidget(i!=null?i:e.getSelection(),bs(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Cl._allSymbolNavigationCommands=new Map;Cl._activeAlternativeCommands=new Set;class ED extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield qF(e.definitionProvider,t,i,r),w("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(56).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(56).multipleDefinitions}}const jOe=C7&&!ele()?2118:70;ps((VZ=class Kie extends ED{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Kie.id,title:{value:w("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:ct.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:jOe,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.1},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),mi.registerCommandAlias("editor.action.goToDeclaration",Kie.id)}},VZ.id="editor.action.revealDefinition",VZ));ps((FZ=class Zie extends ED{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Zie.id,title:{value:w("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:ct.and(oe.hasDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:ws(2089,jOe),weight:100}}),mi.registerCommandAlias("editor.action.openDeclarationToTheSide",Zie.id)}},FZ.id="editor.action.revealDefinitionAside",FZ));ps((BZ=class Xie extends ED{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Xie.id,title:{value:w("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:ct.and(oe.hasDefinitionProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:2}}),mi.registerCommandAlias("editor.action.previewDeclaration",Xie.id)}},BZ.id="editor.action.peekDefinition",BZ));class WOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield FOe(e.declarationProvider,t,i,r),w("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(56).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(56).multipleDeclarations}}ps(($Z=class zOe extends WOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:zOe.id,title:{value:w("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:ct.and(oe.hasDeclarationProvider,oe.isInWalkThroughSnippet.toNegated()),menu:[{id:se.EditorContext,group:"navigation",order:1.3},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},$Z.id="editor.action.revealDeclaration",$Z));ps(class extends WOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:w("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:ct.and(oe.hasDeclarationProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:3}})}});class UOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield $Oe(e.typeDefinitionProvider,t,i,r),w("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(56).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(56).multipleTypeDefinitions}}ps((jZ=class qOe extends UOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qOe.ID,title:{value:w("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:ct.and(oe.hasTypeDefinitionProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:0,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.4},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},jZ.ID="editor.action.goToTypeDefinition",jZ));ps((WZ=class GOe extends UOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:GOe.ID,title:{value:w("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:ct.and(oe.hasTypeDefinitionProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:4}})}},WZ.ID="editor.action.peekTypeDefinition",WZ));class KOe extends Cl{_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield BOe(e.implementationProvider,t,i,r),w("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(56).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(56).multipleImplementations}}ps((zZ=class ZOe extends KOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ZOe.ID,title:{value:w("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:ct.and(oe.hasImplementationProvider,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:2118,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},zZ.ID="editor.action.goToImplementation",zZ));ps((UZ=class XOe extends KOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:XOe.ID,title:{value:w("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:ct.and(oe.hasImplementationProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:3142,weight:100},menu:{id:se.EditorContextPeek,group:"peek",order:5}})}},UZ.ID="editor.action.peekImplementation",UZ));class YOe extends Cl{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(56).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(56).multipleReferences}}ps(class extends YOe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:w("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:ct.and(oe.hasReferenceProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),keybinding:{when:oe.editorTextFocus,primary:1094,weight:100},menu:[{id:se.EditorContext,group:"navigation",order:1.45},{id:se.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield GF(e.referenceProvider,t,i,!0,r),w("ref.title","References"))})}});ps(class extends YOe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:w("references.action.label","Peek References"),original:"Peek References"},precondition:ct.and(oe.hasReferenceProvider,xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated()),menu:{id:se.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(yield GF(e.referenceProvider,t,i,!1,r),w("ref.title","References"))})}});class twt extends Cl{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:w("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:ct.and(xu.notInPeekEditor,oe.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,r){return kd(this,void 0,void 0,function*(){return new rc(this._references,w("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(56).multipleReferences}_getAlternativeCommand(){return""}}mi.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:on},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,r,o,s)=>kd(void 0,void 0,void 0,function*(){Xi(on.isUri(e)),Xi(De.isIPosition(t)),Xi(Array.isArray(i)),Xi(typeof r>"u"||typeof r=="string"),Xi(typeof s>"u"||typeof s=="boolean");const a=n.get(Mi),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(Uh(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(u=>{const c=new class extends twt{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!Boolean(o),openInPeek:Boolean(s),openToSide:!1},i,r);u.get(Sn).invokeFunction(c.run.bind(c),l)})})});mi.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:on},{name:"position",description:"The position at which to start",constraint:De.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,r)=>kd(void 0,void 0,void 0,function*(){n.get(Qo).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)})});mi.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Xi(on.isUri(e)),Xi(De.isIPosition(t));const i=n.get(Vt),r=n.get(Mi);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!Uh(o)||!o.hasModel())return;const s=i7.get(o);if(!s)return;const a=bs(u=>GF(i.referenceProvider,o.getModel(),De.lift(t),!1,u).then(c=>new rc(c,w("ref.title","References")))),l=new G(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});mi.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var nwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Kme=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let g8=class fI{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new st,this.toUnhookForKeyboard=new st,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new BF(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,ca(a))})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{$n(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(fI.ID)}startFindDefinitionFromCursor(e){return Kme(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return Kme(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const r=new jL(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=bs(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){$n(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?G.lift(o[0].originSelectionRange):new G(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=G.plusRange(a,l));this.addDecoration(a,new Gl().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:u}}=l,{startLineNumber:c}=a.range;if(c<1||c>u.getLineCount()){l.dispose();return}const d=this.getPreviewValue(u,c,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(u.uri);this.addDecoration(s,d?new Gl().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=fI.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(85)&&!this.isInPeekEditor(i);return new ED({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(_n);return xu.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};g8.ID="editor.contrib.gotodefinitionatposition";g8.MAX_SOURCE_PREVIEW_LINES=8;g8=nwt([qZ(1,Lu),qZ(2,$r),qZ(3,Vt)],g8);yi(g8.ID,g8,2);const lN=at;class JOe extends Pe{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 cD(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class sce extends Pe{static render(e,t,i){return new sce(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Ge(e,lN("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ge(this.actionContainer,lN("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ge(this.action,lN(`span.icon.${t.iconClass}`));const r=Ge(this.action,lN("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._register(Ye(this.actionContainer,kt.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(Ye(this.actionContainer,kt.KEY_DOWN,o=>{const s=new vr(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}var iwt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},rwt=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}};class owt{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class eIe extends Pe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new xe),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Qr(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Qr(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Qr(()=>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(58).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=U2t(e=>this._computer.computeAsync(e)),iwt(this,void 0,void 0,function*(){var e,t,i,r;try{try{for(var o=!0,s=rwt(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;o=!0){r=a.value,o=!1;const l=r;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){$n(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 owt(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 GZ{constructor(e,t,i,r){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=r,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 pI{constructor(e,t,i,r,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=r,this.initialMousePosY=o,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 am=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class gd{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),r;if(r=gd._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(gd.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(gd.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(gd.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(gd.isVariableCharacter(i)||gd.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof gd._table[i]>"u"&&!gd.isDigitCharacter(i)&&!gd.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}}gd._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class ub{constructor(){this._children=[]}appendChild(e){return e instanceof Kl&&this._children[this._children.length-1]instanceof Kl?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,r=i.children.indexOf(e),o=i.children.slice(0);o.splice(r,1,...t),i._children=o,function s(a,l){for(const u of a)u.parent=l,s(u.children,u)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof kD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Kl extends ub{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Kl(this.value)}}class tIe extends ub{}class y1 extends tIe{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 cb?this._children[0]:void 0}clone(){const e=new y1(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class cb extends ub{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Kl&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new cb;return this.options.forEach(e.appendChild,e),e}}class ace extends ub{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,r=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof C2&&Boolean(o.elseValue))&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof C2){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new ace;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 C2 extends ub{constructor(e,t,i,r){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=r}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(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,r)=>r===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new C2(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class GL extends tIe{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 Kl(t)],!0):!1}clone(){const e=new GL(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Zme(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class kD extends ub{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof y1&&(e.push(i),t=!t||t.indexr===e?(i=!0,!1):(t+=r.len(),!0)),i?t:-1}fullLen(e){let t=0;return Zme([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof y1&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof GL&&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 kD;return this._children=this.children.map(t=>t.clone()),e}walk(e){Zme(this.children,e)}}class pQ{constructor(){this._scanner=new gd,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const r=new kD;return this.parseFragment(e,r),this.ensureFinalTabstop(r,i!=null?i:!1,t!=null?t:!1),r}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof y1&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,u)=>{const c=r.get(l.index);if(!c)return;const d=new y1(l.index);d.transform=l.transform;for(const h of c){const f=h.clone();d.appendChild(f),f instanceof y1&&r.has(f.index)&&!u.has(f.index)&&(u.add(f.index),s(f,u),u.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new y1(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Kl(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new y1(Number(t)):new GL(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new y1(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Kl("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new cb;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;i.push(r)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Kl(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new GL(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Kl("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new ace;let i="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Kl(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const r=this._accept(8,!0);if(r)if(i){if(this._accept(4))return e.appendChild(new C2(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new C2(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new C2(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new C2(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new C2(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Kl(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}const swt=w("defaultLabel","input"),awt=w("label.preserveCaseToggle","Preserve Case");class lwt extends ab{constructor(e){super({icon:_t.preserveCase,title:awt+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class uwt extends U1{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new xe),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new xe),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new xe),this._onInput=this._register(new xe),this._onKeyUp=this._register(new xe),this._onPreserveCaseKeyDown=this._register(new xe),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||swt;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,u=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new YAe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:u,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new lwt(Object.assign({appendTitle:o,isChecked:!1},r.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 c=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=c.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%c.length:h.equals(15)&&(f===0?g=c.length-1:g=f-1),h.equals(9)?(c[f].blur(),this.inputBox.focus()):g>=0&&c[g].focus(),zn.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),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 nIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iIe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const lce=new It("suggestWidgetVisible",!1,w("suggestWidgetVisible","Whether suggestion are visible")),uce="historyNavigationWidgetFocus",rIe="historyNavigationForwardsEnabled",oIe="historyNavigationBackwardsEnabled";let F4;const uN=[];function sIe(n,e){if(uN.includes(e))throw new Error("Cannot register the same widget multiple times");uN.push(e);const t=new st,i=new It(uce,!1).bindTo(n),r=new It(rIe,!0).bindTo(n),o=new It(oIe,!0).bindTo(n),s=()=>{i.set(!0),F4=e},a=()=>{i.set(!1),F4===e&&(F4=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Bn(()=>{uN.splice(uN.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let Yie=class extends JAe{constructor(e,t,i,r){super(e,t,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(sIe(o,this.inputBox))}};Yie=nIe([iIe(3,_n)],Yie);let Jie=class extends uwt{constructor(e,t,i,r,o=!1){super(e,t,o,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(sIe(s,this.inputBox))}};Jie=nIe([iIe(3,_n)],Jie);wu.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ct.and(ct.has(uce),ct.equals(oIe,!0),lce.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{F4==null||F4.showPreviousValue()}});wu.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ct.and(ct.has(uce),ct.equals(rIe,!0),lce.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{F4==null||F4.showNextValue()}});var bx=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const jn={Visible:lce,HasFocusedSuggestion:new It("suggestWidgetHasFocusedSuggestion",!1,w("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new It("suggestWidgetDetailsVisible",!1,w("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new It("suggestWidgetMultipleSuggestions",!1,w("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new It("suggestionMakesTextEdit",!0,w("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new It("acceptSuggestionOnEnter",!0,w("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new It("suggestionHasInsertAndReplaceRange",!1,w("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new It("suggestionInsertMode",void 0,{type:"string",description:w("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new It("suggestionCanResolve",!1,w("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},Ef=new se("suggestWidgetStatusBar");class cwt{constructor(e,t,i,r){var o;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=W2.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,G.isIRange(t.range)?(this.editStart=new De(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new De(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new De(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||G.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new De(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new De(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new De(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||G.spansMultipleLines(t.range.insert)||G.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 r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return bx(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._isResolved=!1});this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(i=>{Object.assign(this.completion,i),this._isResolved=!0,t.dispose()},i=>{u0(i)&&(this._resolveCache=void 0,this._isResolved=!1)})}return this._resolveCache})}}class KL{constructor(e=2,t=new Set,i=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=r,this.showDeprecated=o}}KL.default=new KL;let dwt;function hwt(){return dwt}class fwt{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}function cce(n,e,t,i=KL.default,r={triggerKind:0},o=Jn.None){return bx(this,void 0,void 0,function*(){const s=new nu(!0);t=t.clone();const a=e.getWordAtPosition(t),l=a?new G(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):G.fromPositions(t),u={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},c=[],d=new st,h=[];let f=!1;const g=(v,Q,b)=>{var _,C,L;let S=!1;if(!Q)return S;for(const D of Q.suggestions)if(!i.kindFilter.has(D.kind)){if(!i.showDeprecated&&((_=D==null?void 0:D.tags)===null||_===void 0?void 0:_.includes(1)))continue;D.range||(D.range=u),D.sortText||(D.sortText=typeof D.label=="string"?D.label:D.label.label),!f&&D.insertTextRules&&D.insertTextRules&4&&(f=pQ.guessNeedsClipboard(D.insertText)),c.push(new cwt(t,D,Q,v)),S=!0}return Hae(Q)&&d.add(Q),h.push({providerName:(C=v._debugDisplayName)!==null&&C!==void 0?C:"unknown_provider",elapsedProvider:(L=Q.duration)!==null&&L!==void 0?L:-1,elapsedOverall:b.elapsed()}),S},T=(()=>bx(this,void 0,void 0,function*(){}))();for(const v of n.orderedGroups(e)){let Q=!1;if(yield Promise.all(v.map(b=>bx(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const _=i.providerItemsToReuse.get(b);_.forEach(C=>c.push(C)),Q=Q||_.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const _=new nu(!0),C=yield b.provideCompletionItems(e,t,r,o);Q=g(b,C,_)||Q}catch(_){Cs(_)}}))),Q||o.isCancellationRequested)break}return yield T,o.isCancellationRequested?(d.dispose(),Promise.reject(new w7)):new fwt(c.sort(mwt(i.snippetSortOrder)),f,{entries:h,elapsed:s.elapsed()},d)})}function dce(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function pwt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return dce(n,e)}function gwt(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return dce(n,e)}const KF=new Map;KF.set(0,pwt);KF.set(2,gwt);KF.set(1,dce);function mwt(n){return KF.get(n)}mi.registerCommand("_executeCompletionItemProvider",(n,...e)=>bx(void 0,void 0,void 0,function*(){const[t,i,r,o]=e;Xi(on.isUri(t)),Xi(De.isIPosition(i)),Xi(typeof r=="string"||!r),Xi(typeof o=="number"||!o);const{completionProvider:s}=n.get(Vt),a=yield n.get(Lu).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},u=[],c=a.object.textEditorModel.validatePosition(i),d=yield cce(s,a.object.textEditorModel,c,void 0,{triggerCharacter:r!=null?r:void 0,triggerKind:r?1:0});for(const h of d.items)u.length<(o!=null?o:0)&&u.push(h.resolve(Jn.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(u),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function Twt(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class ZT{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}}}var hce=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},MH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Xme=at;let AH=class ere extends Pe{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._widget=this._register(this._instantiationService.createInstance($g,this._editor)),this._currentResult=null,this._participants=[];for(const r of am.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new OH(this._editor,this._participants),this._hoverOperation=this._register(new eIe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new aIe(this._computer.anchor,o,r.isComplete))})),this._register(es(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(no.onDidChange(()=>{this._widget.position&&this._currentResult&&(this._widget.clear(),this._setCurrentResult(this._currentResult))}))}maybeShowAt(e){const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new GZ(0,i.range,e.event.posx,e.event.posy)),i.type===7){const r=this._editor.getOption(48).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,r){this._startShowingOrUpdateHover(new GZ(0,e,void 0,void 0),t,i,r,null)}_startShowingOrUpdateHover(e,t,i,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):!1:this._editor.getOption(58).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}isColorPickerVisible(){return this._widget.isColorPickerVisible}isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}isVisible(){return this._widget.isVisible}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:r,highlightRange:o}=ere.computeHoverRanges(this._editor,e.range,t),s=new st,a=s.add(new NH(this._keybindingService)),l=document.createDocumentFragment();let u=null;const c={fragment:l,statusBar:a,setColorPicker:h=>u=h,onContentsChanged:()=>this._widget.onContentsChanged(),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(c,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:ere._DECORATION_OPTIONS}]),s.add(Bn(()=>{h.clear()}))}this._widget.showAt(l,new Qwt(u,i,r,this._editor.getOption(58).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,i){let r=1;if(e.hasModel()){const u=e._getViewModel(),c=u.coordinatesConverter,d=c.convertModelRangeToViewRange(t),h=new De(d.startLineNumber,u.getLineMinColumn(d.startLineNumber));r=c.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let s=t.startColumn,a=i[0].range,l=null;for(const u of i)a=G.plusRange(a,u.range),u.range.startLineNumber===o&&u.range.endLineNumber===o&&(s=Math.max(Math.min(s,u.range.startColumn),r)),u.forceShowAtRange&&(l=u.range);return{showAtPosition:l?l.getStartPosition():new De(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new De(o,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()}escape(){this._widget.escape()}};AH._DECORATION_OPTIONS=Vn.register({description:"content-hover-highlight",className:"hoverHighlight"});AH=hce([MH(1,Sn),MH(2,Ir)],AH);class aIe{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new vwt(this,this.anchor,t,this.isComplete)}}class vwt extends aIe{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}class Qwt{constructor(e,t,i,r,o,s,a,l,u,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=r,this.stoleFocus=o,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=u,this.disposables=c,this.closestMouseDistance=void 0}}let $g=class lIe extends Pe{get position(){var e,t;return(t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition)!==null&&t!==void 0?t:null}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}constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this.allowEditorOverflow=!0,this._hoverVisibleKey=oe.hoverVisible.bindTo(this._contextKeyService),this._hoverFocusedKey=oe.hoverFocused.bindTo(this._contextKeyService),this._hover=this._register(new JOe),this._focusTracker=this._register(Fh(this.getDomNode())),this._horizontalScrollingBy=30,this._visibleData=null,this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(48)&&this._updateFont()})),this._setVisibleData(null),this._layout(),this._editor.addContentWidget(this),this._register(this._focusTracker.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(this._focusTracker.onDidBlur(()=>{this._hoverFocusedKey.set(!1)}))}dispose(){this._editor.removeContentWidget(this),this._visibleData&&this._visibleData.disposables.dispose(),super.dispose()}getId(){return lIe.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){if(!this._visibleData)return null;let e=this._visibleData.preferAbove;!e&&this._contextKeyService.getContextKeyValue(jn.Visible.key)&&(e=!0);const t=this._visibleData.isBeforeContent?3:void 0;return{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,preference:e?[1,2]:[2,1],positionAffinity:t}}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Os(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Yme(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const r=Yme(e,t,i.left,i.top,i.width,i.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setVisibleData(e){this._visibleData&&this._visibleData.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!this._visibleData),this._hover.containerDomNode.classList.toggle("hidden",!this._visibleData)}_layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(48);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i/t}`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}showAt(e,t){var i;this._setVisibleData(t),this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._hover.contentsDomNode.style.paddingBottom="",this._updateFont(),this.onContentsChanged(),this._editor.render(),this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(i=t.colorPicker)===null||i===void 0||i.layout()}hide(){if(this._visibleData){const e=this._visibleData.stoleFocus;this._setVisibleData(null),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}}onContentsChanged(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged();const e=this._hover.scrollbar.getScrollDimensions();if(e.scrollWidth>e.width){const i=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingBottom!==i&&(this._hover.contentsDomNode.style.paddingBottom=i,this._editor.layoutContentWidget(this),this._hover.onContentsChanged())}}clear(){this._hover.contentsDomNode.textContent=""}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(48);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(48);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-this._horizontalScrollingBy})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+this._horizontalScrollingBy})}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})}escape(){this._editor.focus()}};$g.ID="editor.contrib.contentHoverWidget";$g=hce([MH(1,_n)],$g);let NH=class extends Pe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Xme("div.hover-row.status-bar"),this.actionsElement=Ge(this.hoverElement,Xme("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(sce.render(this.actionsElement,e,i))}append(e){const t=Ge(this.actionsElement,e);return this._hasContent=!0,t}};NH=hce([MH(0,Ir)],NH);class OH{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),r=t.range.startLineNumber;if(r>i.getLineCount())return[];const o=i.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;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 Zo.EMPTY;const i=OH._getLineDecorations(this._editor,t);return Zo.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):Zo.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=OH._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Rh(t)}}function Yme(n,e,t,i,r,o){const s=t+r/2,a=i+o/2,l=Math.max(Math.abs(n-s)-r/2,0),u=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+u*u)}var bwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jme=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uIe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let o6=class cIe{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new xe,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new st,o=r.add(hue(e,Object.assign(Object.assign({},this._getRenderOptions(e,r)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,r)=>uIe(this,void 0,void 0,function*(){var o,s,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=Fc);const u=yield zpt(this._languageService,r,l),c=document.createElement("span");if(c.innerHTML=(a=(s=cIe._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(u))!==null&&a!==void 0?a:u,this._options.editor){const d=this._options.editor.getOption(48);Oa(c,d)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>ywt(this._openerService,i,e.isTrusted),disposables:t}}}};o6._ttpTokenizer=m6("tokenizeToString",{createHTML(n){return n}});o6=bwt([Jme(1,$r),Jme(2,ac)],o6);function ywt(n,e,t){return uIe(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:_wt(t)})}catch(i){return $n(i),!1}})}function _wt(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const e9e=at;class Lv extends Pe{constructor(e,t,i){super(),this._renderDisposeables=this._register(new st),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new JOe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new o6({editor:this._editor},t,i)),this._computer=new Cwt(this._editor),this._hoverOperation=this._register(new eIe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(48)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Lv.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const r of t){const o=e9e("div.hover-row.markdown-hover"),s=Ge(o,e9e("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),i.appendChild(o)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(64),s=this._hover.containerDomNode.clientHeight,a=i-r-(s-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Lv.ID="editor.contrib.modesGlyphHoverWidget";class Cwt{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const r of t){if(!r.options.glyphMarginClassName)continue;const o=r.options.glyphMarginHoverMessage;!o||nQ(o)||i.push(...Oae(o).map(e))}return i}}var wwt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class xwt{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function Lwt(n,e,t,i,r){return wwt(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,r));if(o&&Dwt(o))return new xwt(n,o,e)}catch(o){Cs(o)}})}function fce(n,e,t,i){const o=n.ordered(e).map((s,a)=>Lwt(s,a,e,t,i));return Zo.fromPromises(o).coalesce()}function Swt(n,e,t,i){return fce(n,e,t,i).map(r=>r.hover).toPromise()}n3("_executeHoverProvider",(n,e,t)=>{const i=n.get(Vt);return Swt(i.hoverProvider,e,t,Jn.None)});function Dwt(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var Ewt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},cN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const t9e=at;class A2{constructor(e,t,i,r,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let IH=class{constructor(e,t,i,r,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new A2(this,e.range,[new Gl().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];let a=1e3;const l=i.getLineLength(r),u=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(113),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:u});let h=!1;c>=0&&l>c&&e.range.startColumn>=c&&(h=!0,s.push(new A2(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new A2(this,e.range,[{value:w("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 T=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,Q=g.options.hoverMessage;if(!Q||nQ(Q))continue;g.options.beforeContentClassName&&(f=!0);const b=new G(e.range.startLineNumber,T,e.range.startLineNumber,v);s.push(new A2(this,b,Oae(Q),f,a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Zo.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Zo.EMPTY;const o=new De(e.range.startLineNumber,e.range.startColumn);return fce(this._languageFeaturesService.hoverProvider,r,o,i).filter(s=>!nQ(s.hover.contents)).map(s=>{const a=s.hover.range?G.lift(s.hover.range):e.range;return new A2(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return dIe(e,t,this._editor,this._languageService,this._openerService)}};IH=Ewt([cN(1,$r),cN(2,ac),cN(3,bi),cN(4,Vt)],IH);function dIe(n,e,t,i,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new st;for(const s of e)for(const a of s.contents){if(nQ(a))continue;const l=t9e("div.hover-row.markdown-hover"),u=Ge(l,t9e("div.hover-contents")),c=o.add(new o6({editor:t},i,r));o.add(c.onDidRenderAsync(()=>{u.className="hover-contents code-hover-contents",n.onContentsChanged()}));const d=o.add(c.render(a));u.appendChild(d.element),n.fragment.appendChild(l)}return o}var hIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class n9e{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let tre=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new xe,this.onDidChange=this._onDidChange.event,this._dispoables=new st,this._markers=[],this._nextIdx=-1,on.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let u=Xx(a.resource.toString(),l.resource.toString());return u===0&&(r==="position"?u=G.compareRangesUsingStarts(a,l)||ro.compare(a.severity,l.severity):u=ro.compare(a.severity,l.severity)||G.compareRangesUsingStarts(a,l)),u},s=()=>{this._markers=this._markerService.read({resource:on.isUri(e)?e:void 0,severities:ro.Error|ro.Warning|ro.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};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 n9e(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=Ux(this._markers,{resource:e.uri},(s,a)=>Xx(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},A9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Mwt{constructor(e,t,i,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new st,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(es(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new iMe(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(){$i(this._disposables)}update(e){const{source:t,message:i,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=Ph(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);ys(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=at("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=Ge(this._codeLink,at("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(ys(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),ol(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(64)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),T=document.createElement("a");T.classList.add("filename"),T.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,T.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(T,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(T),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const u=this._editor.getOption(48),c=Math.ceil(u.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=u.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:d})}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 ro.Error:t=w("Error","Error");break;case ro.Warning:t=w("Warning","Warning");break;case ro.Info:t=w("Info","Info");break;case ro.Hint:t=w("Hint","Hint");break}let i=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(i=`${r.getLineContent(e.startLineNumber)}, ${i}`),i}}let gQ=class pIe extends kH{constructor(e,t,i,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new st,this._onDidSelectRelatedInformation=new xe,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ro.Warning,this._backgroundColor=Re.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Iwt);let t=rre,i=Awt;this._severity===ro.Warning?(t=gI,i=Nwt):this._severity===ro.Info&&(t=ore,i=Owt);const r=e.getColor(t),o=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(ROe),secondaryHeadingColor:e.getColor(HOe)})}_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(r=>this.editor.focus()));const t=[],i=this._menuService.createMenu(pIe.TitleMenu,this._contextKeyService);WAe(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Ge(e,at(""))}_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 Mwt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=G.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?w("problems","{0} of {1} problems",t,i):w("change","{0} of {1} problem",t,i);this.setTitle(V1(a.uri),l)}this._icon.className=`codicon ${ire.className(ro.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()}};gQ.TitleMenu=new se("gotoErrorTitleMenu");gQ=kwt([A9(1,Vs),A9(2,ac),A9(3,t3),A9(4,Sn),A9(5,_n),A9(6,iQ)],gQ);const i9e=lL(gh,p4t),r9e=lL(Oc,aL),o9e=lL(Ic,Xte),rre=de("editorMarkerNavigationError.background",{dark:i9e,light:i9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),Awt=de("editorMarkerNavigationError.headerBackground",{dark:Xt(rre,.1),light:Xt(rre,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),gI=de("editorMarkerNavigationWarning.background",{dark:r9e,light:r9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Nwt=de("editorMarkerNavigationWarning.headerBackground",{dark:Xt(gI,.1),light:Xt(gI,.1),hcDark:"#0C141F",hcLight:Xt(gI,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),ore=de("editorMarkerNavigationInfo.background",{dark:o9e,light:o9e,hcDark:ri,hcLight:ri},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Owt=de("editorMarkerNavigationInfo.headerBackground",{dark:Xt(ore,.1),light:Xt(ore,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Iwt=de("editorMarkerNavigation.background",{dark:Is,light:Is,hcDark:Is,hcLight:Is},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Rwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gIe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let r7=class mI{static get(e){return e.getContribution(mI.ID)}constructor(e,t,i,r,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new st,this._editor=e,this._widgetVisible=mIe.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(gQ,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!G.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.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 i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:G.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new De(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,r;return gIe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((i=mI.get(s))===null||i===void 0||i.close(),(r=mI.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};r7.ID="editor.contrib.markerController";r7=Rwt([dN(1,fIe),dN(2,_n),dN(3,Mi),dN(4,Sn)],r7);class ZF extends Ot{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return gIe(this,void 0,void 0,function*(){t.hasModel()&&((i=r7.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class kf extends ZF{constructor(){super(!0,!1,{id:kf.ID,label:kf.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:578,weight:100},menuOpts:{menuId:gQ.TitleMenu,title:kf.LABEL,icon:Eo("marker-navigation-next",_t.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}kf.ID="editor.action.marker.next";kf.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class jg extends ZF{constructor(){super(!1,!1,{id:jg.ID,label:jg.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:oe.focus,primary:1602,weight:100},menuOpts:{menuId:gQ.TitleMenu,title:jg.LABEL,icon:Eo("marker-navigation-previous",_t.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}jg.ID="editor.action.marker.prev";jg.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Hwt extends ZF{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("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:oe.focus,primary:66,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Pwt extends ZF{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("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:oe.focus,primary:1090,weight:100},menuOpts:{menuId:se.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}yi(r7.ID,r7,4);dt(kf);dt(jg);dt(Hwt);dt(Pwt);const mIe=new It("markersNavigationVisible",!1),Vwt=Ps.bindToContribution(r7.get);vt(new Vwt({id:"closeMarkersNavigation",precondition:mIe,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:oe.focus,primary:9,secondary:[1033]}}));var Fwt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ud=at;class Bwt{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const s9e={type:1,filter:{include:Mn.QuickFix},triggerAction:Gc.QuickFixHover};let sre=class{constructor(e,t,i,r){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,u=a.range.endLineNumber===r?a.range.endColumn:o,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const d=new G(e.range.startLineNumber,l,e.range.startLineNumber,u);s.push(new Bwt(this,d,c))}return s}renderHoverParts(e,t){if(!t.length)return Pe.None;const i=new st;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const r=t.length===1?t[0]:t.sort((o,s)=>ro.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),i}renderMarkerHover(e,t){const i=ud("div.hover-row"),r=Ge(i,ud("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const u=Ge(r,ud("span"));if(u.style.whiteSpace="pre-wrap",u.innerText=s,o||a)if(a&&typeof a!="string"){const c=ud("span");if(o){const g=Ge(c,ud("span"));g.innerText=o}const d=Ge(c,ud("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(Ye(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=Ge(d,ud("span"));h.innerText=a.value;const f=Ge(r,c);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const c=Ge(r,ud("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(ol(l))for(const{message:c,resource:d,startLineNumber:h,startColumn:f}of l){const g=Ge(r,ud("div"));g.style.marginTop="8px";const T=Ge(g,ud("a"));T.innerText=`${V1(d)}(${h}, ${f}): `,T.style.cursor="pointer",t.add(Ye(T,"click",Q=>{Q.stopPropagation(),Q.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch($n)}));const v=Ge(g,ud("span"));v.innerText=c,this._editor.applyFontInfo(v)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ro.Error||t.marker.severity===ro.Warning||t.marker.severity===ro.Info)&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:kf.ID,run:()=>{var r;e.hide(),(r=r7.get(this._editor))===null||r===void 0||r.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(88)){const r=e.statusBar.append(ud("div"));this.recentMarkerCodeActionsInfo&&(gH.makeKey(this.recentMarkerCodeActionsInfo.marker)===gH.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Pe.None:i.add(Uf(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200));r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(Bn(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(Bn(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:Xue,run:u=>{l=!0;const c=p8.get(this._editor),d=Os(u);e.hide(),c==null||c.showCodeActions(s9e,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},$n)}}getCodeActions(e){return bs(t=>ece(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new G(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),s9e,J8.None,t))}};sre=Fwt([KZ(1,vle),KZ(2,ac),KZ(3,Vt)],sre);let $wt;function o7(){return $wt}let TIe;function jwt(n){TIe=n}class vIe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e){return TIe(()=>{const t=pce(e);return t!==void 0?t:`${this.debugName} (mapped)`},t=>e(this.read(t),t))}}class MD extends vIe{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 _u(n,e){var t,i;const r=new QIe(n,e);try{(t=o7())===null||t===void 0||t.handleBeginTransaction(r),n(r)}finally{r.finish(),(i=o7())===null||i===void 0||i.handleEndTransaction()}}function a9e(n,e,t){n?e(n):_u(e,t)}class QIe{constructor(e,t){this.fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():pce(this.fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;this.updatingObservers=null;for(const{observer:t,observable:i}of e)t.endUpdate(i)}}function pce(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=i?i[1]:void 0;return r==null?void 0:r.trim()}function mQ(n,e){return new bIe(n,e)}class bIe extends MD{constructor(e,t){super(),this.debugName=e,this._value=t}get(){return this._value}set(e,t,i){var r;if(this._value===e)return;let o;t||(t=o=new QIe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=o7())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function are(n,e){return new Wwt(n,e)}class Wwt extends bIe{_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()}}function vd(n,e){return new yIe(n,e,void 0,void 0)}function zwt(n,e,t){return new yIe(n,t,e.createEmptyChangeSummary,e.handleChange)}jwt(vd);class yIe extends MD{get debugName(){return typeof this._debugName=="function"?this._debugName():this._debugName}constructor(e,t,i,r){var o,s;super(),this._debugName=e,this.computeFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=o7())===null||s===void 0||s.handleDerivedCreated(this)}onLastObserverRemoved(){this.state=0,this.value=void 0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}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){this.state=3;for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const r=this.state!==0,o=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=r&&o!==this.value;if((t=o7())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new da}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(i&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function oc(n,e){return new _Ie(n,e,void 0,void 0)}function Uwt(n,e){return qwt(e,n)}function qwt(n,e){const t=new st,i=oc(e,r=>{t.clear(),n(r,t)});return Bn(()=>{i.dispose(),t.dispose()})}class _Ie{constructor(e,t,i,r){var o,s;this.debugName=e,this.runFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=o7())===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;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i,this.state=3,(e=o7())===null||e===void 0||e.handleAutorunTriggered(this);try{const r=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this.runFn(this,r)}finally{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--,wV(()=>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:r=>r===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(n){n.Observer=_Ie})(oc||(oc={}));function CIe(n){return new Gwt(n)}class Gwt extends vIe{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 af(n,e){return new wIe(n,e)}class wIe extends MD{constructor(e,t){super(),this.event=e,this.getValue=t,this.hasValue=!1,this.handleEvent=i=>{var r;const o=this.getValue(i),s=!this.hasValue||this.value!==o;(r=o7())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:s}),s&&(this.value=o,this.hasValue&&_u(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 pce(this.getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this.getValue(void 0)}}(function(n){n.Observer=wIe})(af||(af={}));function Kwt(n,e){return new Zwt(n,e)}class Zwt extends MD{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{_u(i=>{for(const r of this.observers)i.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function Xwt(n){return new Ywt(n)}class Ywt extends MD{constructor(e){super(),this.debugName=e}trigger(e,t){if(!e){_u(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function Jwt(n,e){const t=new ext(e!=null?e:!1);return n.addObserver(t),e&&n.reportChanges(),Bn(()=>{n.removeObserver(t)})}class ext{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){}}const xIe="editor.action.inlineSuggest.commit",LIe="editor.action.inlineSuggest.showPrevious",SIe="editor.action.inlineSuggest.showNext";var txt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};class nxt extends Pe{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new B1t),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=new st,this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new ZL(()=>{var r;return(r=this.toggleMenuActionViewItem)===null||r===void 0?void 0:r.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new F1(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,actionViewItemProvider:(r,o)=>{var s;if(r.id===ZL.ID)return this.toggleMenuActionViewItem=new lH(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:dn.asClassNameArray((s=i.moreIcon)!==null&&s!==void 0?s:_t.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(r,o);if(a)return a}if(r instanceof Gv){const a=new lH(r,r.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:r.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,i;const r=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return ca(r==null?void 0:r.getLabel())}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),super.dispose()}}class ZL extends nc{constructor(e,t){t=t||w("moreActions","More Actions..."),super(ZL.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return txt(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}ZL.ID="toolbar.toggle.more";var ixt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tC=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lre=class extends nxt{constructor(e,t,i,r,o,s,a){super(e,o,Object.assign(Object.assign({getKeyBinding:l=>{var u;return(u=s.lookupKeybinding(l.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0})),this._options=t,this._menuService=i,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new st),t!=null&&t.telemetrySource&&this._store.add(this.actionBar.onDidRun(l=>a.publicLog2("workbenchActionExecuted",{id:l.action.id,from:t.telemetrySource})))}setActions(e,t=[],i){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),u=[];let c=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let f=0;f=this._options.maxNumberOfItems&&(a[g]=void 0,d[g]=T)}}L7e(a),L7e(d),super.setActions(a,ea.join(d,l)),u.length>0&&this._sessionDisposables.add(Ye(this.getElement(),"contextmenu",f=>{var g,T,v,Q;const b=this.getItemAction(f.target);if(!b)return;f.preventDefault(),f.stopPropagation();let _=!1;if(c===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){_=!0;for(let S=0;Sthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>f,getActions:()=>L,menuId:(v=this._options)===null||v===void 0?void 0:v.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(Q=this._options)===null||Q===void 0?void 0:Q.menuOptions),contextKeyService:this._contextKeyService})}))}};lre=ixt([tC(2,t3),tC(3,_n),tC(4,Ud),tC(5,Ir),tC(6,Jc)],lre);var gce=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},N2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ure=class extends Pe{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=af(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(60).showToolbar==="always"),this.sessionPosition=void 0,this.position=vd("position",r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const u=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new De(l.lineNumber,Math.min(u,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(Uwt("setup content widget",(r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(s7,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var u;return(u=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&u!==void 0?u:[]})));e.addContentWidget(a),o.add(Bn(()=>e.removeContentWidget(a))),o.add(oc("request explicit",l=>{!this.position.read(l)||s.lastTriggerKind.read(l)!==H4.Explicit&&s.triggerExplicitly()}))}))}};ure=gce([N2(2,Sn)],ure);const rxt=Eo("inline-suggestion-hints-next",_t.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),oxt=Eo("inline-suggestion-hints-previous",_t.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let s7=class cre extends Pe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new nc(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,i,r,o,s,a,l,u,c,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=u,this._contextKeyService=c,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${cre.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=mw("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[mw("div",{style:{display:"flex"}},[mw("div@actionBar",{className:"custom-actions"}),mw("div@toolBar")])]),this.previousAction=this.createCommandAction(LIe,w("previous","Previous"),dn.asClassName(oxt)),this.availableSuggestionCountAction=new nc("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(SIe,w("next","Next"),dn.asClassName(rxt)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(se.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Qr(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Qr(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[];const h=this._register(new F1(this.nodes.actionBar));h.push(this.previousAction,{icon:!0,label:!1}),h.push(this.availableSuggestionCountAction),h.push(this.nextAction,{icon:!0,label:!1}),this.toolBar=this._register(l.createInstance(dre,this.nodes.toolBar,se.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,g)=>f instanceof Hd?l.createInstance(sxt,f,void 0):void 0,telemetrySource:"InlineSuggestionToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{cre._dropDownVisible=f})),this._register(oc("update position",f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(oc("counts",f=>{const g=this._suggestionCount.read(f),T=this._currentSuggestionIdx.read(f);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${T+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(oc("extra commands",f=>{const g=this._extraCommands.read(f);if(Na(this.lastCommands,g))return;this.lastCommands=g;const T=g.map(v=>({class:void 0,id:v.id,enabled:!0,tooltip:v.tooltip||"",label:v.title,run:Q=>this._commandService.executeCommand(v.id)}));for(const[v,Q]of this.inlineCompletionsActionsMenus.getActions())for(const b of Q)b instanceof Hd&&T.push(b);T.length>0&&T.unshift(new ea),this.toolBar.setAdditionalSecondaryActions(T)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};s7._dropDownVisible=!1;s7.id=0;s7=gce([N2(6,Qo),N2(7,Sn),N2(8,Ir),N2(9,_n),N2(10,t3)],s7);class sxt extends o8{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=mw("div.keybinding").root;new vD(t,Ac,Object.assign({disableTitle:!0},_vt)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let dre=class extends lre{constructor(e,t,i,r,o,s,a,l){super(e,Object.assign({resetMenu:t},i),r,o,s,a,l),this.menuId=t,this.options2=i,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,r,o,s,a;const l=[],u=[];WAe(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:u},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),u.push(...this.additionalActions),this.setActions(l,u)}setAdditionalSecondaryActions(e){Na(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};dre=gce([N2(3,t3),N2(4,_n),N2(5,Ud),N2(6,Ir),N2(7,Jc)],dre);var axt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ru=class DIe{static get(e){return e.getContribution(DIe.ID)}constructor(e,t,i,r,o){this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=r,this._keybindingService=o,this._toUnhook=new st,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration(s=>{s.hasChanged(58)&&(this._unhookEvents(),this._hookEvents())})}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(58);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target;if(t.type===9&&t.detail===$g.ID){this._hoverClicked=!0;return}t.type===12&&t.detail===Lv.ID||(t.type!==12&&(this._hoverClicked=!1),this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t;const i=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.containsNode(i)||this._hideWidgets()}_onEditorMouseMove(e){var t,i,r,o,s,a,l,u;const c=e.target;if(this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&c.type===9&&c.detail===$g.ID||this._isHoverSticky&&((t=this._contentWidget)===null||t===void 0?void 0:t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&c.type===9&&c.detail===$g.ID&&((s=this._contentWidget)===null||s===void 0?void 0:s.isColorPickerVisible())||this._isHoverSticky&&c.type===12&&c.detail===Lv.ID||this._isHoverSticky&&((a=this._contentWidget)===null||a===void 0?void 0:a.isVisibleFromKeyboard()))return;if(!this._isHoverEnabled){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(l=this._glyphWidget)===null||l===void 0||l.hide();return}if(c.type===2&&c.position){(u=this._contentWidget)===null||u===void 0||u.hide(),this._glyphWidget||(this._glyphWidget=new Lv(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(c.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible());e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!r&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||s7.dropDownVisible||(this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(AH,this._editor)),this._contentWidget}isColorPickerVisible(){var e;return((e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i,r){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,r)}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()}escape(){var e;(e=this._contentWidget)===null||e===void 0||e.escape()}isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible()}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};ru.ID="editor.contrib.hover";ru=axt([hN(1,Sn),hN(2,ac),hN(3,$r),hN(4,Ir)],ru);class lxt extends Ot{constructor(){super({id:"editor.action.showHover",label:w({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:oe.editorTextFocus,primary:ws(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=ru.get(t);if(!r)return;const o=t.getPosition(),s=new G(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);r.isHoverVisible()?r.focus():r.showContentHover(s,1,1,a)}}class uxt extends Ot{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=ru.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const o=new G(r.lineNumber,r.column,r.lineNumber,r.column),s=g8.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(o,1,1,!0)})}}class cxt extends Ot{constructor(){super({id:"editor.action.scrollUpHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:16,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollUp()}}class dxt extends Ot{constructor(){super({id:"editor.action.scrollDownHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:18,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollDown()}}class hxt extends Ot{constructor(){super({id:"editor.action.scrollLeftHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:15,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollLeft()}}class fxt extends Ot{constructor(){super({id:"editor.action.scrollRightHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:17,weight:100}})}run(e,t){const i=ru.get(t);!i||i.scrollRight()}}class pxt extends Ot{constructor(){super({id:"editor.action.pageUpHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=ru.get(t);!i||i.pageUp()}}class gxt extends Ot{constructor(){super({id:"editor.action.pageDownHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=ru.get(t);!i||i.pageDown()}}class mxt extends Ot{constructor(){super({id:"editor.action.goToTopHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=ru.get(t);!i||i.goToTop()}}class Txt extends Ot{constructor(){super({id:"editor.action.goToBottomHover",label:w({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:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=ru.get(t);!i||i.goToBottom()}}class vxt extends Ot{constructor(){super({id:"editor.action.escapeFocusHover",label:w({key:"escapeFocusHover",comment:["Action that allows to escape from the hover widget with the escape command when the hover widget is focused."]},"Escape Focus Hover"),alias:"Escape Focus Hover",precondition:oe.hoverFocused,kbOpts:{kbExpr:oe.hoverFocused,primary:9,weight:100}})}run(e,t){const i=ru.get(t);!i||i.escape()}}yi(ru.ID,ru,2);dt(lxt);dt(uxt);dt(cxt);dt(dxt);dt(hxt);dt(fxt);dt(pxt);dt(gxt);dt(mxt);dt(Txt);dt(vxt);am.register(IH);am.register(sre);jd((n,e)=>{const t=n.getColor(E4t);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 hre extends Pe{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=e.target;if(t.type!==6||!t.detail.injectedText||t.detail.injectedText.options.attachedData!==xOe||!t.range)return;const i=this._editor.getContribution(ru.ID);if(!!i&&!i.isColorPickerVisible()){const r=new G(t.range.startLineNumber,t.range.startColumn+1,t.range.endLineNumber,t.range.endColumn+1);i.showContentHover(r,1,0,!1)}}}hre.ID="editor.contrib.colorContribution";yi(hre.ID,hre,2);am.register(EH);var EIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},D2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},l9e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let a7=class kIe extends Pe{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._modelService=i,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=oe.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=oe.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 HH(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(kIe.ID)}};a7.ID="editor.contrib.standaloneColorPickerController";a7=EIe([D2(1,_n),D2(2,Kr),D2(3,Ir),D2(4,Sn),D2(5,Vt),D2(6,br)],a7);yi(a7.ID,a7,1);const u9e=8,Qxt=22;let HH=class MIe extends Pe{constructor(e,t,i,r,o,s,a,l){var u;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.body=document.createElement("div"),this._position=void 0,this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new xe),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(WL,this._editor),this._position=(u=this._editor._getViewModel())===null||u===void 0?void 0:u.getPrimaryCursorState().viewState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(Fh(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 T=(g=f.target.element)===null||g===void 0?void 0:g.classList;T&&T.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return MIe.ID}getDomNode(){return this.body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(58).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 l9e(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);!t||this._onResult.fire(new bxt(t.result,t.foundInEditor))})}_computeAsync(e){return l9e(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new nce(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),r=this._register(new NH(this._keybindingService));let o;const s={fragment:i,statusBar:r,setColorPicker:T=>o=T,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this.body.classList.add("standalone-colorpicker-body"),this.body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this.body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this.body.tabIndex=0,this.body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,u=a.domNode.clientWidth-l-Qxt-u9e,c=o.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+u9e+"px";const f=d.originalColorNode;f.style.width=u+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};HH.ID="editor.contrib.standaloneColorPickerWidget";HH=EIe([D2(3,Sn),D2(4,Kr),D2(5,Ir),D2(6,Vt),D2(7,br)],HH);class bxt{constructor(e,t){this.value=e,this.foundInEditor=t}}class yxt extends U8{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:w("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:se.CommandPalette}]})}runEditorCommand(e,t){var i;(i=a7.get(t))===null||i===void 0||i.showOrFocus()}}class _xt extends Ot{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:oe.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=a7.get(t))===null||i===void 0||i.hide()}}class Cxt extends Ot{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({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:oe.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=a7.get(t))===null||i===void 0||i.insertColor()}}dt(_xt);dt(Cxt);ps(yxt);class lf{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const r=t.length,o=e.length;if(i+r>o)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,i,r,o,s){const a=e.startLineNumber,l=e.startColumn,u=e.endLineNumber,c=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(u);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(i,c-1-i.length);if(f!==-1&&g!==-1)if(a===u)d.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),Q=h.substring(0,g);(v.indexOf(i)>=0||Q.indexOf(i)>=0)&&(f=-1,g=-1)}let T;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(i=" "+i,g-=1),T=lf._createRemoveBlockCommentOperations(new G(a,f+t.length+1,u,g+1),t,i)):(T=lf._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=T.length===1?i:null);for(const v of T)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return G.isEmpty(e)?r.push(Ur.delete(new G(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(Ur.delete(new G(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Ur.delete(new G(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const o=[];return G.isEmpty(e)?o.push(Ur.replace(new G(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(Ur.insert(new De(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Ur.insert(new De(e.endLineNumber,e.endColumn),(r?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const r=i[0],o=i[1];return new Ht(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ht(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class i4{constructor(e,t,i,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let u=0,c=i-t+1;uo?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class mce extends Ot{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(br);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(21),l=t.getSelections().map((c,d)=>({selection:c,index:d,ignoreFirstLine:!1}));l.sort((c,d)=>G.compareRangesUsingStarts(c.selection,d.selection));let u=l[0];for(let c=1;c=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ap=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let TQ=class AIe{static get(e){return e.getContribution(AIe.ID)}constructor(e,t,i,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new st,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(u=>this._onContextMenu(u))),this._toDispose.add(this._editor.onMouseWheel(u=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),d=u.srcElement;d.shadowRoot&&e8(c)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(u=>{!this._editor.getOption(22)||u.keyCode===58&&(u.preventDefault(),u.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(22)){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({x:e.event.posx-1,width:2,y:e.event.posy-1,height:2});if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t={x:e.event.posx-1,width:2,y:e.event.posy-1,height:2}),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(22)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?se.SimpleEditorContext:se.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const u of a)if(u instanceof oL){const c=this._getMenuActions(e,u.item.submenu);c.length>0&&(i.push(new Gv(u.id,u.label,c)),l++)}else i.push(u),l++;l&&i.push(new ea)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(58);if(this._editor.updateOptions({hover:{enabled:!1}}),!t){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),s=Os(this._editor.getDomNode()),a=s.left+o.left,l=s.top+o.top+o.height;t={x:a,y:l}}const r=this._editor.getOption(123)&&!G2;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>t,getActions:()=>e,getActionViewItem:o=>{const s=this._keybindingFor(o);if(s)return new SL(o,o,{label:!0,keybinding:s.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new SL(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||O9t(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(70);let i=0;const r=u=>({id:`menu-action-${++i}`,label:u.label,tooltip:"",class:void 0,enabled:typeof u.enabled>"u"?!0:u.enabled,checked:u.checked,run:u.run}),o=(u,c)=>new Gv(`menu-action-${++i}`,u,c,void 0),s=(u,c,d,h,f)=>{if(!c)return r({label:u,enabled:c,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},T=[];for(const v of f)T.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(u,T)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new ea),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(123)&&!G2;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:u=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};TQ.ID="editor.contrib.contextmenu";TQ=Dxt([Ap(1,Ud),Ap(2,b6),Ap(3,_n),Ap(4,Ir),Ap(5,t3),Ap(6,bi),Ap(7,r8)],TQ);class Ext extends Ot{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=TQ.get(t))===null||i===void 0||i.showContextMenu()}}yi(TQ.ID,TQ,2);dt(Ext);class ZZ{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let r=0;r{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new ZZ(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new XZ(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new XZ(new ZZ(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 XZ(new ZZ(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}}m8.ID="editor.contrib.cursorUndoRedoController";class kxt extends Ot{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:oe.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var r;(r=m8.get(t))===null||r===void 0||r.cursorUndo()}}class Mxt extends Ot{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var r;(r=m8.get(t))===null||r===void 0||r.cursorRedo()}}yi(m8.ID,m8,0);dt(kxt);dt(Mxt);class Axt{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new G(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Ht(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 Ht(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(33)||this._editor.getOption(20)||(N9(e)&&(this._modifierPressed=!0),this._mouseDown&&N9(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(33)||this._editor.getOption(20)||(N9(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===B4.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 r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}N9(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 De(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;i=[new Ht(o,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new Ht(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(N9(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(B4.ID,new Axt(this._dragSelection,t,N9(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 G(e.lineNumber,e.column,e.lineNumber,e.column),options:B4._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()}}B4.ID="editor.contrib.dragAndDrop";B4.TRIGGER_KEY_VALUE=Yn?6:5;B4._DECORATION_OPTIONS=Vn.register({description:"dnd-target",className:"dnd-target"});yi(B4.ID,B4,2);const XF=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let r=0;rNIe(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function Nxt(n,e,t){const i={id:XF(),name:n,uri:e,data:t};return{asString:()=>NIe(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class OIe{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 pi.some(this,([i,r])=>r.asFile())&&t.push("files"),IIe(PH(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return PH(e)}}function PH(n){return n.toLowerCase()}function Oxt(n,e){return IIe(PH(n),e.map(PH))}function IIe(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const YF=Object.freeze({create:n=>Bf(n.map(e=>e.toString())).join(`\r `),split:n=>n.split(`\r `),parse:n=>YF.split(n).filter(e=>!e.startsWith("#"))}),c9e={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Ixt{}const Rxt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};vo.add(Rxt.DragAndDropContribution,new Ixt);class XL{constructor(){}static getInstance(){return XL.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}XL.INSTANCE=new XL;var Hxt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};function RIe(n){const e=new OIe;for(const t of n.items){const i=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(i,Tce(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(i,Pxt(r))}}return e}function Pxt(n){const e=n.path?on.parse(n.path):void 0;return Nxt(n.name,e,()=>Hxt(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const Vxt=Object.freeze([c9e.EDITORS,c9e.FILES,LL.RESOURCES,LL.INTERNAL_URI_LIST]);function HIe(n,e=!1){const t=RIe(n),i=t.get(LL.INTERNAL_URI_LIST);if(i)t.replace(cs.uriList,i);else if(e||!t.has(cs.uriList)){const r=[];for(const o of n.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(on.file(a).toString()):r.push(on.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(cs.uriList,Tce(YF.create(r)))}for(const r of Vxt)t.delete(r);return t}function Fxt(n,e,t){var i,r;return{edits:[...e.map(o=>new V4(n,typeof t.insertText=="string"?{range:o,text:t.insertText,insertAsSnippet:!1}:{range:o,text:t.insertText.snippet,insertAsSnippet:!0})),...(r=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&r!==void 0?r:[]]}}var Bxt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$xt=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jxt=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const Wxt=Vn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:REe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class JF extends Pe{constructor(e,t,i,r,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=at(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=at("span.icon");this.domNode.append(t),t.classList.add(...dn.asClassNameArray(_t.loading),"codicon-modifier-spin");const i=()=>{const r=this.editor.getOption(64);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};i(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(50)||r.hasChanged(64))&&i()})),this._register(Ye(this.domNode,kt.CLICK,r=>{this.delegate.cancel()}))}getId(){return JF.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)}}JF.baseId="editor.widget.inlineProgressWidget";let VH=class extends Pe{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ra),this._currentWidget=new Ra,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return jxt(this,void 0,void 0,function*(){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Uf(()=>{const o=G.fromPositions(e);this._currentDecorations.set([{range:o,options:Wxt}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(JF,this.id,this._editor,o,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};VH=Bxt([$xt(2,Sn)],VH);var PIe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yx=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},d9e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};let FH=class VIe extends Pe{constructor(e,t,i,r,o,s,a,l,u,c){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Bn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Bn(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(Ut.runAndSubscribe(c.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=at(".post-edit-widget"),this.button=this._register(new uie(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Ye(this.domNode,kt.CLICK,()=>this.showSelector()))}getId(){return VIe.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Os(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>dv({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};FH.baseId="editor.widget.postEditWidget";FH=PIe([yx(7,Ud),yx(8,_n),yx(9,Ir)],FH);let BH=class extends Pe{constructor(e,t,i,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Ra),this._register(Ut.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,r){var o,s;return d9e(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;const u={edits:[...e.map(g=>new V4(a.uri,typeof l.insertText=="string"?{range:g,text:l.insertText,insertAsSnippet:!1}:{range:g,text:l.insertText.snippet,insertAsSnippet:!0})),...(s=(o=l.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]},c=e[0],d=a.deltaDecorations([],[{range:c,options:{description:"paste-line-suffix",stickiness:0}}]);let h,f;try{h=yield this._bulkEditService.apply(u,{editor:this._editor,token:r}),f=a.getDecorationRange(d[0])}finally{a.deltaDecorations(d,[])}i&&h.isApplied&&t.allEdits.length>1&&this.show(f!=null?f:c,t,g=>d9e(this,void 0,void 0,function*(){const T=this._editor.getModel();!T||(yield T.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:g,allEdits:t.allEdits},i,r))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(FH,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};BH=PIe([yx(4,Sn),yx(5,gD)],BH);var zxt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},O9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},f5=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const FIe="editor.changePasteType",BIe=new It("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),YZ="application/vnd.code.copyMetadata";let T8=class $Ie extends Pe{static get(e){return e.getContribution($Ie.ID)}constructor(e,t,i,r,o,s,a){super(),this._bulkEditService=i,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(Ye(l,"copy",u=>this.handleCopy(u))),this._register(Ye(l,"cut",u=>this.handleCopy(u))),this._register(Ye(l,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new VH("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(BH,"pasteIntoEditor",e,BIe,{id:FIe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},document.execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(82).enabled&&!this._editor.getOption(88)}handleCopy(e){var t,i;if(!e.clipboardData||!this._editor.hasTextFocus()||!this.isPasteAsEnabled())return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(35);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new G(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const u=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,ta),d={multicursorText:Array.isArray(u)?u:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(Q=>!!Q.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=RIe(e.clipboardData),g=h.flatMap(Q=>{var b;return(b=Q.copyMimeTypes)!==null&&b!==void 0?b:[]}),T=XF();this.setCopyMetadata(e.clipboardData,{id:T,providerCopyMimeTypes:g,defaultPastePayload:d});const v=bs(Q=>f5(this,void 0,void 0,function*(){const b=Rh(yield Promise.all(h.map(_=>f5(this,void 0,void 0,function*(){try{return yield _.prepareDocumentPaste(r,a,f,Q)}catch(C){console.error(C);return}}))));b.reverse();for(const _ of b)for(const[C,L]of _)f.replace(C,L);return f}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:T,dataTransferPromise:v}}handlePaste(e){var t,i;return f5(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 r=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!r||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e.clipboardData),a=HIe(e.clipboardData);a.delete(YZ);const l=[...e.clipboardData.types,...(i=s==null?void 0:s.providerCopyMimeTypes)!==null&&i!==void 0?i:[],cs.uriList],u=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(c=>{var d;return(d=c.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>Oxt(h,l))});!u.length||(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,u,o,a,s):this.doPasteInline(u,o,a,s))})}doPasteInline(e,t,i,r){const o=bs(s=>f5(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),u=new Jf(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(i,r,u.token),u.token.isCancellationRequested)return;const c=e.filter(h=>h9e(h,i));if(!c.length||c.length===1&&c[0].id==="text"){yield this.applyDefaultPasteHandler(i,r,u.token);return}const d=yield this.getPasteEdits(c,i,l,t,u.token);if(u.token.isCancellationRequested)return;if(d.length){const h=a.getOption(82).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:d},h,u.token)}yield this.applyDefaultPasteHandler(i,r,u.token)}finally{u.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,r,o){const s=bs(a=>f5(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const u=l.getModel(),c=new Jf(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(r,o,c.token),c.token.isCancellationRequested)return;const d=t.filter(T=>h9e(T,r)),h=yield this.getPasteEdits(d,r,u,i,c.token);if(c.token.isCancellationRequested||!h.length)return;let f;if(typeof e=="string")f=h.find(T=>T.id===e);else{const T=yield this._quickInputService.pick(h.map(v=>({label:v.label,description:v.id,detail:v.detail,edit:v})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});f=T==null?void 0:T.edit}if(!f)return;const g=Fxt(u.uri,i,f);yield this._bulkEditService.apply(g,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(YZ,JSON.stringify(t))}fetchCopyMetadata(e){const t=e.getData(YZ);if(t)try{return JSON.parse(t)}catch{return}}mergeInDataFromCopy(e,t,i){var r;return f5(this,void 0,void 0,function*(){if((t==null?void 0:t.id)&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(cs.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(cs.uriList,Tce(YF.create(o)))}})}getPasteEdits(e,t,i,r,o){return f5(this,void 0,void 0,function*(){const s=yield FV(Promise.all(e.map(a=>{var l;try{return(l=a.provideDocumentPasteEdits)===null||l===void 0?void 0:l.call(a,i,r,t,o)}catch(u){console.error(u);return}})).then(Rh),o);return s==null||s.sort((a,l)=>l.priority-a.priority),s!=null?s:[]})}applyDefaultPasteHandler(e,t,i){var r,o,s;return f5(this,void 0,void 0,function*(){const a=(r=e.get(cs.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const u={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",u)})}};T8.ID="editor.contrib.copyPasteActionController";T8=zxt([O9(1,Sn),O9(2,gD),O9(3,Q6),O9(4,Vt),O9(5,c0),O9(6,bAe)],T8);function h9e(n,e){var t;return Boolean((t=n.pasteMimeTypes)===null||t===void 0?void 0:t.some(i=>e.matches(i)))}var vce=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YL=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},vQ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const Qce=w("builtIn","Built-in");class bce{provideDocumentPasteEdits(e,t,i,r){return vQ(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{id:this.id,insertText:o.insertText,label:o.label,detail:o.detail,priority:o.priority}:void 0})}provideDocumentOnDropEdits(e,t,i,r){return vQ(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{id:this.id,insertText:o.insertText,label:o.label,priority:o.priority}:void 0})}}class jIe extends bce{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[cs.text],this.pasteMimeTypes=[cs.text]}getEdit(e,t){return vQ(this,void 0,void 0,function*(){const i=e.get(cs.text);if(!i||e.has(cs.uriList))return;const r=yield i.asString();return{id:this.id,priority:0,label:w("text.label","Insert Plain Text"),detail:Qce,insertText:r}})}}class WIe extends bce{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[cs.uriList],this.pasteMimeTypes=[cs.uriList]}getEdit(e,t){return vQ(this,void 0,void 0,function*(){const i=yield zIe(e);if(!i.length||t.isCancellationRequested)return;let r=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Un.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=i.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=i.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{id:this.id,priority:0,insertText:o,label:s,detail:Qce}})}}let $H=class extends bce{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[cs.uriList],this.pasteMimeTypes=[cs.uriList]}getEdit(e,t){return vQ(this,void 0,void 0,function*(){const i=yield zIe(e);if(!i.length||t.isCancellationRequested)return;const r=Rh(i.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?_7t(s.uri,o):void 0}));if(!!r.length)return{id:this.id,priority:0,insertText:r.join(" "),label:i.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:Qce}})}};$H=vce([YL(0,r8)],$H);function zIe(n){return vQ(this,void 0,void 0,function*(){const e=n.get(cs.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const r of YF.parse(t))try{i.push({uri:on.parse(r),originalText:r})}catch{}return i})}let fre=class extends Pe{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new jIe)),this._register(e.documentOnDropEditProvider.register("*",new WIe)),this._register(e.documentOnDropEditProvider.register("*",new $H(t)))}};fre=vce([YL(0,Vt),YL(1,r8)],fre);let pre=class extends Pe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new jIe)),this._register(e.documentPasteEditProvider.register("*",new WIe)),this._register(e.documentPasteEditProvider.register("*",new $H(t)))}};pre=vce([YL(0,Vt),YL(1,r8)],pre);yi(T8.ID,T8,0);MF(pre);vt(new class extends Ps{constructor(){super({id:FIe,precondition:BIe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=T8.get(e))===null||i===void 0?void 0:i.changePasteType()}});dt(class extends Ot{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(n,e,t){var i;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=T8.get(e))===null||i===void 0?void 0:i.pasteAs(r)}});class Uxt{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 f9e{constructor(e){this.identifier=e}}const UIe=oi("treeViewsDndService");gi(UIe,Uxt,1);var qxt=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},fN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(d){s(d)}}function l(c){try{u(i.throw(c))}catch(d){s(d)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})};const qIe="editor.changeDropType",GIe=new It("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let QQ=class KIe extends Pe{static get(e){return e.getContribution(KIe.ID)}constructor(e,t,i,r){super(),this._languageFeaturesService=i,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=XL.getInstance(),this._dropProgressManager=this._register(t.createInstance(VH,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(BH,"dropIntoEditor",e,GIe,{id:qIe,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var r;return fN(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=bs(s=>fN(this,void 0,void 0,function*(){const a=new Jf(e,1,void 0,s);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const u=e.getModel();if(!u)return;const c=this._languageFeaturesService.documentOnDropEditProvider.ordered(u).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=yield this.getDropEdits(c,u,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=e.getOption(34).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([G.fromPositions(t)],{activeEditIndex:0,allEdits:d},h,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,r,o){return fN(this,void 0,void 0,function*(){const s=yield FV(Promise.all(e.map(l=>l.provideDocumentOnDropEdits(t,i,r,o.token))),o.token),a=Rh(s!=null?s:[]);return a.sort((l,u)=>u.priority-l.priority),a})}extractDataTransferData(e){return fN(this,void 0,void 0,function*(){if(!e.dataTransfer)return new OIe;const t=HIe(e.dataTransfer);if(this.treeItemsTransfer.hasData(f9e.prototype)){const i=this.treeItemsTransfer.getData(f9e.prototype);if(Array.isArray(i))for(const r of i){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t})}};QQ.ID="editor.contrib.dropIntoEditorController";QQ=qxt([JZ(1,Sn),JZ(2,Vt),JZ(3,UIe)],QQ);yi(QQ.ID,QQ,2);vt(new class extends Ps{constructor(){super({id:qIe,precondition:GIe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=QQ.get(e))===null||i===void 0||i.changeDropType()}});MF(fre);class yl{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&&(r.changeDecorationOptions(this._highlightedDecorationId,yl._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,yl._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new G(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,yl._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let r=yl._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=yl._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),u=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/u));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=T.startLineNumber?T.endLineNumber>h&&(h=T.endLineNumber):(o.push({range:new G(d,1,h,1),options:yl._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=T.startLineNumber,h=T.endLineNumber)}o.push({range:new G(d,1,h,1),options:yl._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,yl._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],r=this._editor.getModel().getDecorationRange(i);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let s=0;sG.compareRangesUsingStarts(s.range,a.range));const r=[];let o=i[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function p9e(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function g9e(n,e,t){const i=e.split(t),r=n[0].split(t);let o="";return i.forEach((s,a)=>{o+=ZIe([r[a]],s)+t}),o.slice(0,-1)}class m9e{constructor(e){this.staticValue=e,this.kind=0}}class Kxt{constructor(e){this.pieces=e,this.kind=1}}class bQ{static fromStaticValue(e){return new bQ([Wg.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new m9e(""):e.length===1&&e[0].staticValue!==null?this._state=new m9e(e[0].staticValue):this._state=new Kxt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?ZIe(e,this._state.staticValue):this._state.staticValue;let i="";for(let r=0,o=this._state.pieces.length;r0){const l=[],u=s.caseOps.length;let c=0;for(let d=0,h=a.length;d=u){l.push(a.slice(d));break}switch(s.caseOps[c]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),c++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),c++;break;default:l.push(a[d])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=r)break;const s=n.charCodeAt(i);switch(s){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` @@ -1346,7 +1346,7 @@ world! Hello! world! \`\`\` -`,Mnn=()=>{const[n,e]=$.exports.useState(""),[t,i]=$.exports.useState(""),[r,o]=$.exports.useState(""),[s,a]=$.exports.useState(["default"]),[l,u]=$.exports.useState(""),{t:c}=Ab(),d=h=>{a(s.filter(f=>f!==h))};return me($c,{children:[me("div",{className:"flex justify-between",children:[me("h1",{className:"text-3xl font-bold",children:c("Create Problem")},void 0,!1,{fileName:dr,lineNumber:61,columnNumber:9},void 0),me("div",{className:"flex gap-4",children:[me(kg,{variant:"bordered",onClick:()=>{window.history.back()},children:c("Cancel")},void 0,!1,{fileName:dr,lineNumber:63,columnNumber:11},void 0),me(kg,{color:"primary",children:c("Create")},void 0,!1,{fileName:dr,lineNumber:71,columnNumber:11},void 0)]},void 0,!0,{fileName:dr,lineNumber:62,columnNumber:9},void 0)]},void 0,!0,{fileName:dr,lineNumber:60,columnNumber:7},void 0),me("div",{children:[me("p",{className:"text-gray-500",children:c("Please fill in the information below to create a new problem.")},void 0,!1,{fileName:dr,lineNumber:75,columnNumber:9},void 0),me("p",{className:"text-gray-500",children:c("The information marked with * is required.")},void 0,!1,{fileName:dr,lineNumber:78,columnNumber:9},void 0)]},void 0,!0,{fileName:dr,lineNumber:74,columnNumber:7},void 0),me(wee,{className:"mt-4",children:me(Cee,{className:"gap-4",children:[me("div",{className:"flex items-center gap-4",children:[me(oK,{className:"w-1/2",isRequired:!0,label:c("Problem slug"),placeholder:"example-problem",value:n,onChange:h=>{e(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:85,columnNumber:13},void 0),n&&n!=="slug"&&me("div",{className:"flex items-center gap-2",children:[me(PLe,{color:"warning","aria-label":"Checking..."},void 0,!1,{fileName:dr,lineNumber:97,columnNumber:17},void 0),me("p",{className:"text-sm text-gray-500",children:c("Checking slug is valid...")},void 0,!1,{fileName:dr,lineNumber:98,columnNumber:17},void 0)]},void 0,!0,{fileName:dr,lineNumber:96,columnNumber:15},void 0),n==="slug"&&me(Mtn,{className:"h-8 fill-green-500"},void 0,!1,{fileName:dr,lineNumber:104,columnNumber:15},void 0),!n&&me("div",{className:"flex items-center gap-2",children:[me(Htn,{className:"h-8 fill-red-500","aria-label":"Error"},void 0,!1,{fileName:dr,lineNumber:108,columnNumber:17},void 0),me("p",{className:"text-sm text-gray-500",children:c("Slug is not valid.")},void 0,!1,{fileName:dr,lineNumber:109,columnNumber:17},void 0)]},void 0,!0,{fileName:dr,lineNumber:107,columnNumber:15},void 0)]},void 0,!0,{fileName:dr,lineNumber:84,columnNumber:11},void 0),me(a7e,{},void 0,!1,{fileName:dr,lineNumber:116,columnNumber:11},void 0),me(oK,{className:"w-1/2",isRequired:!0,label:c("Problem title"),placeholder:"Example Problem",value:t,onChange:h=>{i(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:117,columnNumber:11},void 0),me(uct,{"aria-label":"Options",children:[me(y7e,{title:c("Raw"),children:me(uut,{className:"-mt-3",label:c("Problem description"),isRequired:!0,placeholder:E_e,value:r,onChange:h=>{o(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:129,columnNumber:15},void 0)},"raw",!1,{fileName:dr,lineNumber:128,columnNumber:13},void 0),me(y7e,{title:c("Preview"),children:me(wee,{className:"-mt-3",shadow:"sm",children:me(Cee,{children:me(qFe,{content:r||E_e},void 0,!1,{fileName:dr,lineNumber:143,columnNumber:19},void 0)},void 0,!1,{fileName:dr,lineNumber:142,columnNumber:17},void 0)},void 0,!1,{fileName:dr,lineNumber:141,columnNumber:15},void 0)},"preview",!1,{fileName:dr,lineNumber:140,columnNumber:13},void 0)]},void 0,!0,{fileName:dr,lineNumber:127,columnNumber:11},void 0),me(a7e,{},void 0,!1,{fileName:dr,lineNumber:150,columnNumber:11},void 0),me("div",{className:"flex flex-col gap-4",children:[s.length>0&&me("div",{className:"flex gap-2",children:s.map((h,f)=>me(xae,{onClose:()=>{d(h)},variant:"flat",children:h},f,!1,{fileName:dr,lineNumber:155,columnNumber:19},void 0))},void 0,!1,{fileName:dr,lineNumber:153,columnNumber:15},void 0),me("div",{className:"flex items-center gap-4",children:[me(oK,{className:"w-1/2",label:c("Add problem tag"),placeholder:"new-tag",value:l,onChange:h=>{u(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:168,columnNumber:15},void 0),me(kg,{size:"sm",radius:"full",isIconOnly:!0,color:"secondary",onClick:()=>{l&&(a([...s,l]),u(""))},children:me(VBe,{className:"h-6 w-6"},void 0,!1,{fileName:dr,lineNumber:189,columnNumber:17},void 0)},void 0,!1,{fileName:dr,lineNumber:177,columnNumber:15},void 0)]},void 0,!0,{fileName:dr,lineNumber:167,columnNumber:13},void 0)]},void 0,!0,{fileName:dr,lineNumber:151,columnNumber:11},void 0)]},void 0,!0,{fileName:dr,lineNumber:83,columnNumber:9},void 0)},void 0,!1,{fileName:dr,lineNumber:82,columnNumber:7},void 0)]},void 0,!0)};var hr="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/Sidebar.tsx";const k_e="/images/oj-lab-icon.svg",M_e=[{name:"Problem",href:"/admin/problem",icon:stn,current:!0},{name:"User",href:"/admin/user",icon:Ltn,current:!1}];function Ann(n){const e=KQ(),{t}=Ab();return me($c,{children:me("div",{children:[me(ev.Root,{show:n.open,as:$.exports.Fragment,children:me(u_e,{as:"div",className:"relative z-50 lg:hidden",onClose:n.onClose,children:[me(ev.Child,{as:$.exports.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:me("div",{className:"fixed inset-0 bg-gray-900/80"},void 0,!1,{fileName:hr,lineNumber:42,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:33,columnNumber:13},this),me("div",{className:"fixed inset-0 flex",children:me(ev.Child,{as:$.exports.Fragment,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:me(u_e.Panel,{className:"relative mr-16 flex w-full max-w-xs flex-1",children:[me(ev.Child,{as:$.exports.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:me("div",{className:"absolute left-full top-0 flex w-16 justify-center pt-5",children:me("button",{type:"button",className:"-m-2.5 p-2.5",onClick:n.onClose,children:[me("span",{className:"sr-only",children:"Close sidebar"},void 0,!1,{fileName:hr,lineNumber:71,columnNumber:25},this),me(FBe,{className:"h-6 w-6 text-white","aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:72,columnNumber:25},this)]},void 0,!0,{fileName:hr,lineNumber:66,columnNumber:23},this)},void 0,!1,{fileName:hr,lineNumber:65,columnNumber:21},this)},void 0,!1,{fileName:hr,lineNumber:56,columnNumber:19},this),me("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-indigo-600 px-6 pb-4",children:[me("div",{className:"flex h-16 shrink-0 items-center",children:[me("img",{className:"h-14 w-auto gap-4",src:k_e,alt:"OJ Lab"},void 0,!1,{fileName:hr,lineNumber:82,columnNumber:23},this),me("h1",{className:"text-xl font-bold text-white",children:"OJ Lab Admin"},void 0,!1,{fileName:hr,lineNumber:87,columnNumber:23},this)]},void 0,!0,{fileName:hr,lineNumber:81,columnNumber:21},this),me("nav",{className:"flex flex-1 flex-col",children:me("ul",{className:"flex flex-1 flex-col gap-y-7",children:me("li",{children:me("ul",{className:"-mx-2 cursor-pointer space-y-1",children:M_e.map(i=>me("li",{children:me("div",{className:N4(i.current?"bg-indigo-700 text-white":"text-indigo-200 hover:bg-indigo-700 hover:text-white","group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"),onClick:()=>{e(i.href)},children:[me(i.icon,{className:N4(i.current?"text-white":"text-indigo-200 group-hover:text-white","h-6 w-6 shrink-0"),"aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:108,columnNumber:35},this),t(i.name)]},void 0,!0,{fileName:hr,lineNumber:97,columnNumber:33},this)},i.name,!1,{fileName:hr,lineNumber:96,columnNumber:31},this))},void 0,!1,{fileName:hr,lineNumber:94,columnNumber:27},this)},void 0,!1,{fileName:hr,lineNumber:93,columnNumber:25},this)},void 0,!1,{fileName:hr,lineNumber:92,columnNumber:23},this)},void 0,!1,{fileName:hr,lineNumber:91,columnNumber:21},this)]},void 0,!0,{fileName:hr,lineNumber:80,columnNumber:19},this)]},void 0,!0,{fileName:hr,lineNumber:55,columnNumber:17},this)},void 0,!1,{fileName:hr,lineNumber:46,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:45,columnNumber:13},this)]},void 0,!0,{fileName:hr,lineNumber:28,columnNumber:11},this)},void 0,!1,{fileName:hr,lineNumber:27,columnNumber:9},this),me("div",{className:"hidden max-w-xs lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-80 lg:flex-col",children:me("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-indigo-600 px-6 pb-4",children:[me("div",{className:"flex h-16 shrink-0 items-center gap-4",children:[me("img",{className:"h-14 w-auto",src:k_e,alt:"OJ Lab"},void 0,!1,{fileName:hr,lineNumber:137,columnNumber:15},this),me("h1",{className:"text-xl font-bold text-white",children:"OJ Lab Admin"},void 0,!1,{fileName:hr,lineNumber:138,columnNumber:15},this)]},void 0,!0,{fileName:hr,lineNumber:136,columnNumber:13},this),me("nav",{className:"flex flex-1 flex-col",children:me("ul",{className:"flex flex-1 flex-col gap-y-7",children:me("li",{children:me("ul",{className:"-mx-2 space-y-1",children:M_e.map(i=>me("li",{children:me("div",{className:N4(i.current?"bg-indigo-700 text-white":"text-indigo-200 hover:bg-indigo-700 hover:text-white","group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"),onClick:()=>{e(i.href)},children:[me(i.icon,{className:N4(i.current?"text-white":"text-indigo-200 group-hover:text-white","h-6 w-6 shrink-0"),"aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:157,columnNumber:27},this),t(i.name)]},void 0,!0,{fileName:hr,lineNumber:146,columnNumber:25},this)},i.name,!1,{fileName:hr,lineNumber:145,columnNumber:23},this))},void 0,!1,{fileName:hr,lineNumber:143,columnNumber:19},this)},void 0,!1,{fileName:hr,lineNumber:142,columnNumber:17},this)},void 0,!1,{fileName:hr,lineNumber:141,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:140,columnNumber:13},this)]},void 0,!0,{fileName:hr,lineNumber:135,columnNumber:11},this)},void 0,!1,{fileName:hr,lineNumber:133,columnNumber:9},this)]},void 0,!0,{fileName:hr,lineNumber:26,columnNumber:7},this)},void 0,!1)}var w5="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/Header.tsx";const A_e={name:"Tom Cook",email:"tom@example.com",imageUrl:"/avatars/male-avatar-1.svg"},Nnn=[{name:"Main page",href:"/problem"},{name:"Sign out",href:"#"}],Onn=n=>me($c,{children:me("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm sm:gap-x-6",children:[me("button",{type:"button",className:"-m-2.5 p-2.5 text-gray-700 lg:hidden",onClick:n.onClickSidebarButton,children:[me("span",{className:"sr-only",children:"Open sidebar"},void 0,!1,{fileName:w5,lineNumber:29,columnNumber:11},void 0),me(PBe,{className:"h-6 w-6","aria-hidden":"true"},void 0,!1,{fileName:w5,lineNumber:30,columnNumber:11},void 0)]},void 0,!0,{fileName:w5,lineNumber:24,columnNumber:9},void 0),me("div",{className:"flex flex-1 justify-end gap-x-4 self-stretch lg:gap-x-6",children:me("div",{className:"flex flex-row items-center justify-center gap-2",children:[me(UBe,{},void 0,!1,{fileName:w5,lineNumber:35,columnNumber:13},void 0),me(jBe,{userName:A_e.name,avatarUrl:A_e.imageUrl,navigation:Nnn},void 0,!1,{fileName:w5,lineNumber:37,columnNumber:13},void 0)]},void 0,!0,{fileName:w5,lineNumber:34,columnNumber:11},void 0)},void 0,!1,{fileName:w5,lineNumber:33,columnNumber:9},void 0)]},void 0,!0,{fileName:w5,lineNumber:23,columnNumber:7},void 0)},void 0,!1);var sT="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/AdminLayout.tsx";const Inn=()=>{const[n,e]=$.exports.useState(!1);return me($c,{children:[me(Ann,{open:n,onClose:()=>{e(!1)}},void 0,!1,{fileName:sT,lineNumber:11,columnNumber:7},void 0),me("div",{children:me("div",{className:"lg:pl-80",children:[me(Onn,{onClickSidebarButton:()=>{e(!0)}},void 0,!1,{fileName:sT,lineNumber:19,columnNumber:11},void 0),me("main",{className:"p-6",children:me(ott,{},void 0,!1,{fileName:sT,lineNumber:25,columnNumber:13},void 0)},void 0,!1,{fileName:sT,lineNumber:24,columnNumber:11},void 0)]},void 0,!0,{fileName:sT,lineNumber:18,columnNumber:9},void 0)},void 0,!1,{fileName:sT,lineNumber:17,columnNumber:7},void 0)]},void 0,!0)};var X3="/home/runner/work/oj-lab-front/oj-lab-front/src/components/NewsCard.tsx";function Rnn(){return me(wee,{className:"py-4",children:[me(wlt,{className:"flex-col items-start px-4 pb-0 pt-2",children:[me("p",{className:"text-tiny font-bold uppercase",children:"Release Note"},void 0,!1,{fileName:X3,lineNumber:7,columnNumber:9},this),me("small",{className:"text-default-500",children:"v0.0.1"},void 0,!1,{fileName:X3,lineNumber:8,columnNumber:9},this),me("h4",{className:"text-large font-bold",children:"Hello OJ Lab front \u{1F495}"},void 0,!1,{fileName:X3,lineNumber:9,columnNumber:9},this)]},void 0,!0,{fileName:X3,lineNumber:6,columnNumber:7},this),me(Cee,{className:"overflow-visible py-2",children:[me("p",{children:"OJ Lab front is now in alpha stage. We are working hard to bring you the best experience."},void 0,!1,{fileName:X3,lineNumber:12,columnNumber:9},this),me("br",{},void 0,!1,{fileName:X3,lineNumber:16,columnNumber:9},this),me("p",{children:"Stay tuned!"},void 0,!1,{fileName:X3,lineNumber:17,columnNumber:9},this)]},void 0,!0,{fileName:X3,lineNumber:11,columnNumber:7},this)]},void 0,!0,{fileName:X3,lineNumber:5,columnNumber:5},this)}var aT="/home/runner/work/oj-lab-front/oj-lab-front/src/pages/ProblemList.tsx";const Hnn=()=>{const{getProblemInfoList:n}=pBe();return me(qBe,{children:me("div",{className:"flex gap-8",children:[me("div",{className:"w-2/3",children:me(GBe,{data:n(),showActions:!1,enableNavigation:!0},void 0,!1,{fileName:aT,lineNumber:13,columnNumber:11},void 0)},void 0,!1,{fileName:aT,lineNumber:12,columnNumber:9},void 0),me("div",{className:"w-1/3",children:me(Rnn,{},void 0,!1,{fileName:aT,lineNumber:20,columnNumber:11},void 0)},void 0,!1,{fileName:aT,lineNumber:19,columnNumber:9},void 0)]},void 0,!0,{fileName:aT,lineNumber:11,columnNumber:7},void 0)},void 0,!1,{fileName:aT,lineNumber:10,columnNumber:5},void 0)};var $l="/home/runner/work/oj-lab-front/oj-lab-front/src/routes/Router.tsx";const Pnn=()=>me(btt,{children:me($.exports.Suspense,{children:me(att,{children:[me(L5,{path:"/",element:me(rtt,{replace:!0,to:"/problem"},void 0,!1,{fileName:$l,lineNumber:14,columnNumber:36},void 0)},void 0,!1,{fileName:$l,lineNumber:14,columnNumber:11},void 0),me(L5,{path:"/problem",element:me(Hnn,{},void 0,!1,{fileName:$l,lineNumber:15,columnNumber:43},void 0)},void 0,!1,{fileName:$l,lineNumber:15,columnNumber:11},void 0),me(L5,{path:"/problem/*",element:me(Lnn,{},void 0,!1,{fileName:$l,lineNumber:16,columnNumber:45},void 0)},void 0,!1,{fileName:$l,lineNumber:16,columnNumber:11},void 0),me(L5,{path:"/admin",element:me(Inn,{},void 0,!1,{fileName:$l,lineNumber:17,columnNumber:41},void 0),children:[me(L5,{path:"problem",element:me(knn,{},void 0,!1,{fileName:$l,lineNumber:18,columnNumber:44},void 0)},void 0,!1,{fileName:$l,lineNumber:18,columnNumber:13},void 0),me(L5,{path:"new/problem",element:me(Mnn,{},void 0,!1,{fileName:$l,lineNumber:19,columnNumber:48},void 0)},void 0,!1,{fileName:$l,lineNumber:19,columnNumber:13},void 0),me(L5,{path:"user",element:me("div",{children:"user"},void 0,!1,{fileName:$l,lineNumber:20,columnNumber:41},void 0)},void 0,!1,{fileName:$l,lineNumber:20,columnNumber:13},void 0)]},void 0,!0,{fileName:$l,lineNumber:17,columnNumber:11},void 0)]},void 0,!0,{fileName:$l,lineNumber:13,columnNumber:9},void 0)},void 0,!1,{fileName:$l,lineNumber:12,columnNumber:7},void 0)},void 0,!1,{fileName:$l,lineNumber:11,columnNumber:5},void 0);var N_e="/home/runner/work/oj-lab-front/oj-lab-front/src/App.tsx";function Vnn(){return me(jnt,{children:me(Pnn,{},void 0,!1,{fileName:N_e,lineNumber:8,columnNumber:7},this)},void 0,!1,{fileName:N_e,lineNumber:7,columnNumber:5},this)}var Cse={},lJ=tae.exports;{var QO=lJ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Cse.createRoot=function(n,e){QO.usingClientEntryPoint=!0;try{return lJ.createRoot(n,e)}finally{QO.usingClientEntryPoint=!1}},Cse.hydrateRoot=function(n,e,t){QO.usingClientEntryPoint=!0;try{return lJ.hydrateRoot(n,e,t)}finally{QO.usingClientEntryPoint=!1}}}const Fnn=n=>{n&&n instanceof Function&&Gt(()=>import("./web-vitals.67dce932.js"),[]).then(({getCLS:e,getFID:t,getFCP:i,getLCP:r,getTTFB:o})=>{e(n),t(n),i(n),r(n),o(n)})};var Nb={exports:{}},tv={decodeValues:!0,map:!1,silent:!1};function wse(n){return typeof n=="string"&&!!n.trim()}function xse(n,e){var t=n.split(";").filter(wse),i=t.shift(),r=Bnn(i),o=r.name,s=r.value;e=e?Object.assign({},tv,e):tv;try{s=e.decodeValues?decodeURIComponent(s):s}catch(l){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+s+"'. Set options.decodeValues to false to disable this feature.",l)}var a={name:o,value:s};return t.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase(),d=u.join("=");c==="expires"?a.expires=new Date(d):c==="max-age"?a.maxAge=parseInt(d,10):c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=d:a[c]=d}),a}function Bnn(n){var e="",t="",i=n.split("=");return i.length>1?(e=i.shift(),t=i.join("=")):t=n,{name:e,value:t}}function KBe(n,e){if(e=e?Object.assign({},tv,e):tv,!n)return e.map?{}:[];if(n.headers)if(typeof n.headers.getSetCookie=="function")n=n.headers.getSetCookie();else if(n.headers["set-cookie"])n=n.headers["set-cookie"];else{var t=n.headers[Object.keys(n.headers).find(function(r){return r.toLowerCase()==="set-cookie"})];!t&&n.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),n=t}if(Array.isArray(n)||(n=[n]),e=e?Object.assign({},tv,e):tv,e.map){var i={};return n.filter(wse).reduce(function(r,o){var s=xse(o,e);return r[s.name]=s,r},i)}else return n.filter(wse).map(function(r){return xse(r,e)})}function $nn(n){if(Array.isArray(n))return n;if(typeof n!="string")return[];var e=[],t=0,i,r,o,s,a;function l(){for(;t=n.length)&&e.push(n.substring(i,n.length))}return e}Nb.exports=KBe;Nb.exports.parse=KBe;Nb.exports.parseString=xse;Nb.exports.splitCookiesString=$nn;var zde=Object.defineProperty,jnn=Object.getOwnPropertyDescriptor,Wnn=Object.getOwnPropertyNames,znn=Object.prototype.hasOwnProperty,Unn=(n,e)=>{for(var t in e)zde(n,t,{get:e[t],enumerable:!0})},qnn=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Wnn(e))!znn.call(n,r)&&r!==t&&zde(n,r,{get:()=>e[r],enumerable:!(i=jnn(e,r))||i.enumerable});return n},Gnn=n=>qnn(zde({},"__esModule",{value:!0}),n),ZBe={};Unn(ZBe,{Headers:()=>DE,flattenHeadersList:()=>rin,flattenHeadersObject:()=>oin,headersToList:()=>XBe,headersToObject:()=>ein,headersToString:()=>Ynn,listToHeaders:()=>nin,objectToHeaders:()=>iin,reduceHeadersObject:()=>Ude,stringToHeaders:()=>tin});var Zd=Gnn(ZBe),Knn=Nb.exports,Znn=/[^a-z0-9\-#$%&'*+.^_`|~]/i;function YC(n){if(typeof n!="string"&&(n=String(n)),Znn.test(n)||n.trim()==="")throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function Xnn(n){return typeof n!="string"&&(n=String(n)),n}var dd=Symbol("normalizedHeaders"),bO=Symbol("rawHeaderNames"),O_e=", ",I_e,R_e,DE=class{constructor(n){this[I_e]={},this[R_e]=new Map,["Headers","HeadersPolyfill"].includes(n==null?void 0:n.constructor.name)||n instanceof DE?n.forEach((t,i)=>{this.append(i,t)},this):Array.isArray(n)?n.forEach(([e,t])=>{this.append(e,Array.isArray(t)?t.join(O_e):t)}):n&&Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e];this.append(e,Array.isArray(t)?t.join(O_e):t)})}[(I_e=dd,R_e=bO,Symbol.iterator)](){return this.entries()}*keys(){for(const n of Object.keys(this[dd]))yield n}*values(){for(const n of Object.values(this[dd]))yield n}*entries(){for(const n of Object.keys(this[dd]))yield[n,this.get(n)]}get(n){var e;return(e=this[dd][YC(n)])!=null?e:null}set(n,e){const t=YC(n);this[dd][t]=Xnn(e),this[bO].set(t,n)}append(n,e){const t=YC(n);let i=this.has(t)?`${this.get(t)}, ${e}`:e;this.set(n,i)}delete(n){if(!this.has(n))return;const e=YC(n);delete this[dd][e],this[bO].delete(e)}all(){return this[dd]}raw(){const n={};for(const[e,t]of this.entries())n[this[bO].get(e)]=t;return n}has(n){return this[dd].hasOwnProperty(YC(n))}forEach(n,e){for(const t in this[dd])this[dd].hasOwnProperty(t)&&n.call(e,this[dd][t],t,this)}getSetCookie(){const n=this.get("set-cookie");return n===null?[]:n===""?[""]:(0,Knn.splitCookiesString)(n)}};function XBe(n){const e=[];return n.forEach((t,i)=>{const r=t.includes(",")?t.split(",").map(o=>o.trim()):t;e.push([i,r])}),e}function Ynn(n){return XBe(n).map(([i,r])=>{const o=[].concat(r);return`${i}: ${o.join(", ")}`}).join(`\r +`,Mnn=()=>{const[n,e]=$.exports.useState(""),[t,i]=$.exports.useState(""),[r,o]=$.exports.useState(""),[s,a]=$.exports.useState(["default"]),[l,u]=$.exports.useState(""),{t:c}=Ab(),d=h=>{a(s.filter(f=>f!==h))};return me($c,{children:[me("div",{className:"flex justify-between",children:[me("h1",{className:"text-3xl font-bold",children:c("Create Problem")},void 0,!1,{fileName:dr,lineNumber:61,columnNumber:9},void 0),me("div",{className:"flex gap-4",children:[me(kg,{variant:"bordered",onClick:()=>{window.history.back()},children:c("Cancel")},void 0,!1,{fileName:dr,lineNumber:63,columnNumber:11},void 0),me(kg,{color:"primary",children:c("Create")},void 0,!1,{fileName:dr,lineNumber:71,columnNumber:11},void 0)]},void 0,!0,{fileName:dr,lineNumber:62,columnNumber:9},void 0)]},void 0,!0,{fileName:dr,lineNumber:60,columnNumber:7},void 0),me("div",{children:[me("p",{className:"text-gray-500",children:c("Please fill in the information below to create a new problem.")},void 0,!1,{fileName:dr,lineNumber:75,columnNumber:9},void 0),me("p",{className:"text-gray-500",children:c("The information marked with * is required.")},void 0,!1,{fileName:dr,lineNumber:78,columnNumber:9},void 0)]},void 0,!0,{fileName:dr,lineNumber:74,columnNumber:7},void 0),me(wee,{className:"mt-4",children:me(Cee,{className:"gap-4",children:[me("div",{className:"flex items-center gap-4",children:[me(oK,{className:"w-1/2",isRequired:!0,label:c("Problem slug"),placeholder:"example-problem",value:n,onChange:h=>{e(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:85,columnNumber:13},void 0),n&&n!=="slug"&&me("div",{className:"flex items-center gap-2",children:[me(PLe,{color:"warning","aria-label":"Checking..."},void 0,!1,{fileName:dr,lineNumber:97,columnNumber:17},void 0),me("p",{className:"text-sm text-gray-500",children:c("Checking slug is valid...")},void 0,!1,{fileName:dr,lineNumber:98,columnNumber:17},void 0)]},void 0,!0,{fileName:dr,lineNumber:96,columnNumber:15},void 0),n==="slug"&&me(Mtn,{className:"h-8 fill-green-500"},void 0,!1,{fileName:dr,lineNumber:104,columnNumber:15},void 0),!n&&me("div",{className:"flex items-center gap-2",children:[me(Htn,{className:"h-8 fill-red-500","aria-label":"Error"},void 0,!1,{fileName:dr,lineNumber:108,columnNumber:17},void 0),me("p",{className:"text-sm text-gray-500",children:c("Slug is not valid.")},void 0,!1,{fileName:dr,lineNumber:109,columnNumber:17},void 0)]},void 0,!0,{fileName:dr,lineNumber:107,columnNumber:15},void 0)]},void 0,!0,{fileName:dr,lineNumber:84,columnNumber:11},void 0),me(a7e,{},void 0,!1,{fileName:dr,lineNumber:116,columnNumber:11},void 0),me(oK,{className:"w-1/2",isRequired:!0,label:c("Problem title"),placeholder:"Example Problem",value:t,onChange:h=>{i(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:117,columnNumber:11},void 0),me(uct,{"aria-label":"Options",children:[me(y7e,{title:c("Raw"),children:me(uut,{className:"-mt-3",label:c("Problem description"),isRequired:!0,placeholder:E_e,value:r,onChange:h=>{o(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:129,columnNumber:15},void 0)},"raw",!1,{fileName:dr,lineNumber:128,columnNumber:13},void 0),me(y7e,{title:c("Preview"),children:me(wee,{className:"-mt-3",shadow:"sm",children:me(Cee,{children:me(qFe,{content:r||E_e},void 0,!1,{fileName:dr,lineNumber:143,columnNumber:19},void 0)},void 0,!1,{fileName:dr,lineNumber:142,columnNumber:17},void 0)},void 0,!1,{fileName:dr,lineNumber:141,columnNumber:15},void 0)},"preview",!1,{fileName:dr,lineNumber:140,columnNumber:13},void 0)]},void 0,!0,{fileName:dr,lineNumber:127,columnNumber:11},void 0),me(a7e,{},void 0,!1,{fileName:dr,lineNumber:150,columnNumber:11},void 0),me("div",{className:"flex flex-col gap-4",children:[s.length>0&&me("div",{className:"flex gap-2",children:s.map((h,f)=>me(xae,{onClose:()=>{d(h)},variant:"flat",children:h},f,!1,{fileName:dr,lineNumber:155,columnNumber:19},void 0))},void 0,!1,{fileName:dr,lineNumber:153,columnNumber:15},void 0),me("div",{className:"flex items-center gap-4",children:[me(oK,{className:"w-1/2",label:c("Add problem tag"),placeholder:"new-tag",value:l,onChange:h=>{u(h.target.value)}},void 0,!1,{fileName:dr,lineNumber:168,columnNumber:15},void 0),me(kg,{size:"sm",radius:"full",isIconOnly:!0,color:"secondary",onClick:()=>{l&&(a([...s,l]),u(""))},children:me(VBe,{className:"h-6 w-6"},void 0,!1,{fileName:dr,lineNumber:189,columnNumber:17},void 0)},void 0,!1,{fileName:dr,lineNumber:177,columnNumber:15},void 0)]},void 0,!0,{fileName:dr,lineNumber:167,columnNumber:13},void 0)]},void 0,!0,{fileName:dr,lineNumber:151,columnNumber:11},void 0)]},void 0,!0,{fileName:dr,lineNumber:83,columnNumber:9},void 0)},void 0,!1,{fileName:dr,lineNumber:82,columnNumber:7},void 0)]},void 0,!0)};var hr="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/Sidebar.tsx";const k_e="/images/oj-lab-icon.svg",M_e=[{name:"Problem",href:"/admin/problem",icon:stn,current:!0},{name:"User",href:"/admin/user",icon:Ltn,current:!1}];function Ann(n){const e=KQ(),{t}=Ab();return me($c,{children:me("div",{children:[me(ev.Root,{show:n.open,as:$.exports.Fragment,children:me(u_e,{as:"div",className:"relative z-50 lg:hidden",onClose:n.onClose,children:[me(ev.Child,{as:$.exports.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:me("div",{className:"fixed inset-0 bg-gray-900/80"},void 0,!1,{fileName:hr,lineNumber:42,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:33,columnNumber:13},this),me("div",{className:"fixed inset-0 flex",children:me(ev.Child,{as:$.exports.Fragment,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:me(u_e.Panel,{className:"relative mr-16 flex w-full max-w-xs flex-1",children:[me(ev.Child,{as:$.exports.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:me("div",{className:"absolute left-full top-0 flex w-16 justify-center pt-5",children:me("button",{type:"button",className:"-m-2.5 p-2.5",onClick:n.onClose,children:[me("span",{className:"sr-only",children:"Close sidebar"},void 0,!1,{fileName:hr,lineNumber:71,columnNumber:25},this),me(FBe,{className:"h-6 w-6 text-white","aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:72,columnNumber:25},this)]},void 0,!0,{fileName:hr,lineNumber:66,columnNumber:23},this)},void 0,!1,{fileName:hr,lineNumber:65,columnNumber:21},this)},void 0,!1,{fileName:hr,lineNumber:56,columnNumber:19},this),me("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-indigo-600 px-6 pb-4",children:[me("div",{className:"flex h-16 shrink-0 items-center",children:[me("img",{className:"h-14 w-auto gap-4",src:k_e,alt:"OJ Lab"},void 0,!1,{fileName:hr,lineNumber:82,columnNumber:23},this),me("h1",{className:"text-xl font-bold text-white",children:"OJ Lab Admin"},void 0,!1,{fileName:hr,lineNumber:87,columnNumber:23},this)]},void 0,!0,{fileName:hr,lineNumber:81,columnNumber:21},this),me("nav",{className:"flex flex-1 flex-col",children:me("ul",{className:"flex flex-1 flex-col gap-y-7",children:me("li",{children:me("ul",{className:"-mx-2 cursor-pointer space-y-1",children:M_e.map(i=>me("li",{children:me("div",{className:N4(i.current?"bg-indigo-700 text-white":"text-indigo-200 hover:bg-indigo-700 hover:text-white","group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"),onClick:()=>{e(i.href)},children:[me(i.icon,{className:N4(i.current?"text-white":"text-indigo-200 group-hover:text-white","h-6 w-6 shrink-0"),"aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:108,columnNumber:35},this),t(i.name)]},void 0,!0,{fileName:hr,lineNumber:97,columnNumber:33},this)},i.name,!1,{fileName:hr,lineNumber:96,columnNumber:31},this))},void 0,!1,{fileName:hr,lineNumber:94,columnNumber:27},this)},void 0,!1,{fileName:hr,lineNumber:93,columnNumber:25},this)},void 0,!1,{fileName:hr,lineNumber:92,columnNumber:23},this)},void 0,!1,{fileName:hr,lineNumber:91,columnNumber:21},this)]},void 0,!0,{fileName:hr,lineNumber:80,columnNumber:19},this)]},void 0,!0,{fileName:hr,lineNumber:55,columnNumber:17},this)},void 0,!1,{fileName:hr,lineNumber:46,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:45,columnNumber:13},this)]},void 0,!0,{fileName:hr,lineNumber:28,columnNumber:11},this)},void 0,!1,{fileName:hr,lineNumber:27,columnNumber:9},this),me("div",{className:"hidden max-w-xs lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-80 lg:flex-col",children:me("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-indigo-600 px-6 pb-4",children:[me("div",{className:"flex h-16 shrink-0 items-center gap-4",children:[me("img",{className:"h-14 w-auto",src:k_e,alt:"OJ Lab"},void 0,!1,{fileName:hr,lineNumber:137,columnNumber:15},this),me("h1",{className:"text-xl font-bold text-white",children:"OJ Lab Admin"},void 0,!1,{fileName:hr,lineNumber:138,columnNumber:15},this)]},void 0,!0,{fileName:hr,lineNumber:136,columnNumber:13},this),me("nav",{className:"flex flex-1 flex-col",children:me("ul",{className:"flex flex-1 flex-col gap-y-7",children:me("li",{children:me("ul",{className:"-mx-2 space-y-1",children:M_e.map(i=>me("li",{children:me("div",{className:N4(i.current?"bg-indigo-700 text-white":"text-indigo-200 hover:bg-indigo-700 hover:text-white","group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"),onClick:()=>{e(i.href)},children:[me(i.icon,{className:N4(i.current?"text-white":"text-indigo-200 group-hover:text-white","h-6 w-6 shrink-0"),"aria-hidden":"true"},void 0,!1,{fileName:hr,lineNumber:157,columnNumber:27},this),t(i.name)]},void 0,!0,{fileName:hr,lineNumber:146,columnNumber:25},this)},i.name,!1,{fileName:hr,lineNumber:145,columnNumber:23},this))},void 0,!1,{fileName:hr,lineNumber:143,columnNumber:19},this)},void 0,!1,{fileName:hr,lineNumber:142,columnNumber:17},this)},void 0,!1,{fileName:hr,lineNumber:141,columnNumber:15},this)},void 0,!1,{fileName:hr,lineNumber:140,columnNumber:13},this)]},void 0,!0,{fileName:hr,lineNumber:135,columnNumber:11},this)},void 0,!1,{fileName:hr,lineNumber:133,columnNumber:9},this)]},void 0,!0,{fileName:hr,lineNumber:26,columnNumber:7},this)},void 0,!1)}var w5="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/Header.tsx";const A_e={name:"Tom Cook",email:"tom@example.com",imageUrl:"/avatars/male-avatar-1.svg"},Nnn=[{name:"Main page",href:"/problem"},{name:"Sign out",href:"#"}],Onn=n=>me($c,{children:me("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b border-gray-200 bg-white px-4 shadow-sm sm:gap-x-6",children:[me("button",{type:"button",className:"-m-2.5 p-2.5 text-gray-700 lg:hidden",onClick:n.onClickSidebarButton,children:[me("span",{className:"sr-only",children:"Open sidebar"},void 0,!1,{fileName:w5,lineNumber:29,columnNumber:11},void 0),me(PBe,{className:"h-6 w-6","aria-hidden":"true"},void 0,!1,{fileName:w5,lineNumber:30,columnNumber:11},void 0)]},void 0,!0,{fileName:w5,lineNumber:24,columnNumber:9},void 0),me("div",{className:"flex flex-1 justify-end gap-x-4 self-stretch lg:gap-x-6",children:me("div",{className:"flex flex-row items-center justify-center gap-2",children:[me(UBe,{},void 0,!1,{fileName:w5,lineNumber:35,columnNumber:13},void 0),me(jBe,{userName:A_e.name,avatarUrl:A_e.imageUrl,navigation:Nnn},void 0,!1,{fileName:w5,lineNumber:37,columnNumber:13},void 0)]},void 0,!0,{fileName:w5,lineNumber:34,columnNumber:11},void 0)},void 0,!1,{fileName:w5,lineNumber:33,columnNumber:9},void 0)]},void 0,!0,{fileName:w5,lineNumber:23,columnNumber:7},void 0)},void 0,!1);var sT="/home/runner/work/oj-lab-front/oj-lab-front/src/layouts/adminLayout/AdminLayout.tsx";const Inn=()=>{const[n,e]=$.exports.useState(!1);return me($c,{children:[me(Ann,{open:n,onClose:()=>{e(!1)}},void 0,!1,{fileName:sT,lineNumber:11,columnNumber:7},void 0),me("div",{children:me("div",{className:"lg:pl-80",children:[me(Onn,{onClickSidebarButton:()=>{e(!0)}},void 0,!1,{fileName:sT,lineNumber:19,columnNumber:11},void 0),me("main",{className:"p-6",children:me(ott,{},void 0,!1,{fileName:sT,lineNumber:25,columnNumber:13},void 0)},void 0,!1,{fileName:sT,lineNumber:24,columnNumber:11},void 0)]},void 0,!0,{fileName:sT,lineNumber:18,columnNumber:9},void 0)},void 0,!1,{fileName:sT,lineNumber:17,columnNumber:7},void 0)]},void 0,!0)};var X3="/home/runner/work/oj-lab-front/oj-lab-front/src/components/NewsCard.tsx";function Rnn(){return me(wee,{className:"py-4",children:[me(wlt,{className:"flex-col items-start px-4 pb-0 pt-2",children:[me("p",{className:"text-tiny font-bold uppercase",children:"Release Note"},void 0,!1,{fileName:X3,lineNumber:7,columnNumber:9},this),me("small",{className:"text-default-500",children:"v0.0.1"},void 0,!1,{fileName:X3,lineNumber:8,columnNumber:9},this),me("h4",{className:"text-large font-bold",children:"Hello OJ Lab front \u{1F495}"},void 0,!1,{fileName:X3,lineNumber:9,columnNumber:9},this)]},void 0,!0,{fileName:X3,lineNumber:6,columnNumber:7},this),me(Cee,{className:"overflow-visible py-2",children:[me("p",{children:"OJ Lab front is now in alpha stage. We are working hard to bring you the best experience."},void 0,!1,{fileName:X3,lineNumber:12,columnNumber:9},this),me("br",{},void 0,!1,{fileName:X3,lineNumber:16,columnNumber:9},this),me("p",{children:"Stay tuned!"},void 0,!1,{fileName:X3,lineNumber:17,columnNumber:9},this)]},void 0,!0,{fileName:X3,lineNumber:11,columnNumber:7},this)]},void 0,!0,{fileName:X3,lineNumber:5,columnNumber:5},this)}var aT="/home/runner/work/oj-lab-front/oj-lab-front/src/pages/ProblemList.tsx";const Hnn=()=>{const{getProblemInfoList:n}=pBe();return me(qBe,{children:me("div",{className:"flex gap-8",children:[me("div",{className:"w-2/3",children:me(GBe,{data:n(),showActions:!1,enableNavigation:!0},void 0,!1,{fileName:aT,lineNumber:13,columnNumber:11},void 0)},void 0,!1,{fileName:aT,lineNumber:12,columnNumber:9},void 0),me("div",{className:"w-1/3",children:me(Rnn,{},void 0,!1,{fileName:aT,lineNumber:20,columnNumber:11},void 0)},void 0,!1,{fileName:aT,lineNumber:19,columnNumber:9},void 0)]},void 0,!0,{fileName:aT,lineNumber:11,columnNumber:7},void 0)},void 0,!1,{fileName:aT,lineNumber:10,columnNumber:5},void 0)};var $l="/home/runner/work/oj-lab-front/oj-lab-front/src/routes/Router.tsx";const Pnn=()=>me(btt,{basename:"/oj-lab-front/",children:me($.exports.Suspense,{children:me(att,{children:[me(L5,{path:"/",element:me(rtt,{replace:!0,to:"/problem"},void 0,!1,{fileName:$l,lineNumber:14,columnNumber:36},void 0)},void 0,!1,{fileName:$l,lineNumber:14,columnNumber:11},void 0),me(L5,{path:"/problem",element:me(Hnn,{},void 0,!1,{fileName:$l,lineNumber:15,columnNumber:43},void 0)},void 0,!1,{fileName:$l,lineNumber:15,columnNumber:11},void 0),me(L5,{path:"/problem/*",element:me(Lnn,{},void 0,!1,{fileName:$l,lineNumber:16,columnNumber:45},void 0)},void 0,!1,{fileName:$l,lineNumber:16,columnNumber:11},void 0),me(L5,{path:"/admin",element:me(Inn,{},void 0,!1,{fileName:$l,lineNumber:17,columnNumber:41},void 0),children:[me(L5,{path:"problem",element:me(knn,{},void 0,!1,{fileName:$l,lineNumber:18,columnNumber:44},void 0)},void 0,!1,{fileName:$l,lineNumber:18,columnNumber:13},void 0),me(L5,{path:"new/problem",element:me(Mnn,{},void 0,!1,{fileName:$l,lineNumber:19,columnNumber:48},void 0)},void 0,!1,{fileName:$l,lineNumber:19,columnNumber:13},void 0),me(L5,{path:"user",element:me("div",{children:"user"},void 0,!1,{fileName:$l,lineNumber:20,columnNumber:41},void 0)},void 0,!1,{fileName:$l,lineNumber:20,columnNumber:13},void 0)]},void 0,!0,{fileName:$l,lineNumber:17,columnNumber:11},void 0)]},void 0,!0,{fileName:$l,lineNumber:13,columnNumber:9},void 0)},void 0,!1,{fileName:$l,lineNumber:12,columnNumber:7},void 0)},void 0,!1,{fileName:$l,lineNumber:11,columnNumber:5},void 0);var N_e="/home/runner/work/oj-lab-front/oj-lab-front/src/App.tsx";function Vnn(){return me(jnt,{children:me(Pnn,{},void 0,!1,{fileName:N_e,lineNumber:8,columnNumber:7},this)},void 0,!1,{fileName:N_e,lineNumber:7,columnNumber:5},this)}var Cse={},lJ=tae.exports;{var QO=lJ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Cse.createRoot=function(n,e){QO.usingClientEntryPoint=!0;try{return lJ.createRoot(n,e)}finally{QO.usingClientEntryPoint=!1}},Cse.hydrateRoot=function(n,e,t){QO.usingClientEntryPoint=!0;try{return lJ.hydrateRoot(n,e,t)}finally{QO.usingClientEntryPoint=!1}}}const Fnn=n=>{n&&n instanceof Function&&Gt(()=>import("./web-vitals.67dce932.js"),[]).then(({getCLS:e,getFID:t,getFCP:i,getLCP:r,getTTFB:o})=>{e(n),t(n),i(n),r(n),o(n)})};var Nb={exports:{}},tv={decodeValues:!0,map:!1,silent:!1};function wse(n){return typeof n=="string"&&!!n.trim()}function xse(n,e){var t=n.split(";").filter(wse),i=t.shift(),r=Bnn(i),o=r.name,s=r.value;e=e?Object.assign({},tv,e):tv;try{s=e.decodeValues?decodeURIComponent(s):s}catch(l){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+s+"'. Set options.decodeValues to false to disable this feature.",l)}var a={name:o,value:s};return t.forEach(function(l){var u=l.split("="),c=u.shift().trimLeft().toLowerCase(),d=u.join("=");c==="expires"?a.expires=new Date(d):c==="max-age"?a.maxAge=parseInt(d,10):c==="secure"?a.secure=!0:c==="httponly"?a.httpOnly=!0:c==="samesite"?a.sameSite=d:a[c]=d}),a}function Bnn(n){var e="",t="",i=n.split("=");return i.length>1?(e=i.shift(),t=i.join("=")):t=n,{name:e,value:t}}function KBe(n,e){if(e=e?Object.assign({},tv,e):tv,!n)return e.map?{}:[];if(n.headers)if(typeof n.headers.getSetCookie=="function")n=n.headers.getSetCookie();else if(n.headers["set-cookie"])n=n.headers["set-cookie"];else{var t=n.headers[Object.keys(n.headers).find(function(r){return r.toLowerCase()==="set-cookie"})];!t&&n.headers.cookie&&!e.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),n=t}if(Array.isArray(n)||(n=[n]),e=e?Object.assign({},tv,e):tv,e.map){var i={};return n.filter(wse).reduce(function(r,o){var s=xse(o,e);return r[s.name]=s,r},i)}else return n.filter(wse).map(function(r){return xse(r,e)})}function $nn(n){if(Array.isArray(n))return n;if(typeof n!="string")return[];var e=[],t=0,i,r,o,s,a;function l(){for(;t=n.length)&&e.push(n.substring(i,n.length))}return e}Nb.exports=KBe;Nb.exports.parse=KBe;Nb.exports.parseString=xse;Nb.exports.splitCookiesString=$nn;var zde=Object.defineProperty,jnn=Object.getOwnPropertyDescriptor,Wnn=Object.getOwnPropertyNames,znn=Object.prototype.hasOwnProperty,Unn=(n,e)=>{for(var t in e)zde(n,t,{get:e[t],enumerable:!0})},qnn=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Wnn(e))!znn.call(n,r)&&r!==t&&zde(n,r,{get:()=>e[r],enumerable:!(i=jnn(e,r))||i.enumerable});return n},Gnn=n=>qnn(zde({},"__esModule",{value:!0}),n),ZBe={};Unn(ZBe,{Headers:()=>DE,flattenHeadersList:()=>rin,flattenHeadersObject:()=>oin,headersToList:()=>XBe,headersToObject:()=>ein,headersToString:()=>Ynn,listToHeaders:()=>nin,objectToHeaders:()=>iin,reduceHeadersObject:()=>Ude,stringToHeaders:()=>tin});var Zd=Gnn(ZBe),Knn=Nb.exports,Znn=/[^a-z0-9\-#$%&'*+.^_`|~]/i;function YC(n){if(typeof n!="string"&&(n=String(n)),Znn.test(n)||n.trim()==="")throw new TypeError("Invalid character in header field name");return n.toLowerCase()}function Xnn(n){return typeof n!="string"&&(n=String(n)),n}var dd=Symbol("normalizedHeaders"),bO=Symbol("rawHeaderNames"),O_e=", ",I_e,R_e,DE=class{constructor(n){this[I_e]={},this[R_e]=new Map,["Headers","HeadersPolyfill"].includes(n==null?void 0:n.constructor.name)||n instanceof DE?n.forEach((t,i)=>{this.append(i,t)},this):Array.isArray(n)?n.forEach(([e,t])=>{this.append(e,Array.isArray(t)?t.join(O_e):t)}):n&&Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e];this.append(e,Array.isArray(t)?t.join(O_e):t)})}[(I_e=dd,R_e=bO,Symbol.iterator)](){return this.entries()}*keys(){for(const n of Object.keys(this[dd]))yield n}*values(){for(const n of Object.values(this[dd]))yield n}*entries(){for(const n of Object.keys(this[dd]))yield[n,this.get(n)]}get(n){var e;return(e=this[dd][YC(n)])!=null?e:null}set(n,e){const t=YC(n);this[dd][t]=Xnn(e),this[bO].set(t,n)}append(n,e){const t=YC(n);let i=this.has(t)?`${this.get(t)}, ${e}`:e;this.set(n,i)}delete(n){if(!this.has(n))return;const e=YC(n);delete this[dd][e],this[bO].delete(e)}all(){return this[dd]}raw(){const n={};for(const[e,t]of this.entries())n[this[bO].get(e)]=t;return n}has(n){return this[dd].hasOwnProperty(YC(n))}forEach(n,e){for(const t in this[dd])this[dd].hasOwnProperty(t)&&n.call(e,this[dd][t],t,this)}getSetCookie(){const n=this.get("set-cookie");return n===null?[]:n===""?[""]:(0,Knn.splitCookiesString)(n)}};function XBe(n){const e=[];return n.forEach((t,i)=>{const r=t.includes(",")?t.split(",").map(o=>o.trim()):t;e.push([i,r])}),e}function Ynn(n){return XBe(n).map(([i,r])=>{const o=[].concat(r);return`${i}: ${o.join(", ")}`}).join(`\r `)}var Jnn=["user-agent"];function ein(n){const e={};return n.forEach((t,i)=>{const r=!Jnn.includes(i.toLowerCase())&&t.includes(",");e[i]=r?t.split(",").map(o=>o.trim()):t}),e}function tin(n){return n.trim().split(/[\r\n]+/).reduce((t,i)=>{if(i.trim()==="")return t;const r=i.split(": "),o=r.shift(),s=r.join(": ");return t.append(o,s),t},new DE)}function nin(n){const e=new DE;return n.forEach(([t,i])=>{[].concat(i).forEach(o=>{e.append(t,o)})}),e}function Ude(n,e,t){return Object.keys(n).reduce((i,r)=>e(i,r,n[r]),t)}function iin(n){return Ude(n,(e,t,i)=>([].concat(i).filter(Boolean).forEach(o=>{e.append(t,o)}),e),new DE)}function rin(n){return n.map(([e,t])=>[e,[].concat(t).join(", ")])}function oin(n){return Ude(n,(e,t,i)=>(e[t]=[].concat(i).join(", "),e),{})}var EE={};/*! * cookie * Copyright(c) 2012-2014 Roman Shtylman diff --git a/assets/javascript.e4912f74.js b/assets/javascript.085c3588.js similarity index 89% rename from assets/javascript.e4912f74.js rename to assets/javascript.085c3588.js index dd2d5bd8e..555d13d1d 100644 --- a/assets/javascript.e4912f74.js +++ b/assets/javascript.085c3588.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript.e69b2029.js";import"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript.dd711b51.js";import"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/jsonMode.a52e5d0a.js b/assets/jsonMode.dd799092.js similarity index 99% rename from assets/jsonMode.a52e5d0a.js rename to assets/jsonMode.dd799092.js index 87752abdd..bf2e9c807 100644 --- a/assets/jsonMode.a52e5d0a.js +++ b/assets/jsonMode.dd799092.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.11712c1d.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.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/liquid.a63a4f6f.js b/assets/liquid.48bc72f5.js similarity index 98% rename from assets/liquid.a63a4f6f.js rename to assets/liquid.48bc72f5.js index fa9bbdcaf..d1b3b8528 100644 --- a/assets/liquid.a63a4f6f.js +++ b/assets/liquid.48bc72f5.js @@ -1,4 +1,4 @@ -import{m as d}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/python.19481683.js b/assets/python.a3ce8923.js similarity index 98% rename from assets/python.19481683.js rename to assets/python.a3ce8923.js index 3f1ed934a..1aa1ee9d3 100644 --- a/assets/python.19481683.js +++ b/assets/python.a3ce8923.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/razor.3066de02.js b/assets/razor.11bc3a39.js similarity index 99% rename from assets/razor.3066de02.js rename to assets/razor.11bc3a39.js index 0ab855fb1..4f2892e80 100644 --- a/assets/razor.3066de02.js +++ b/assets/razor.11bc3a39.js @@ -1,4 +1,4 @@ -import{m as s}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/tsMode.77d96e96.js b/assets/tsMode.87c59f2a.js similarity index 99% rename from assets/tsMode.77d96e96.js rename to assets/tsMode.87c59f2a.js index a8eb8ab85..a87df4d3b 100644 --- a/assets/tsMode.77d96e96.js +++ b/assets/tsMode.87c59f2a.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.11712c1d.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.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/typescript.e69b2029.js b/assets/typescript.dd711b51.js similarity index 98% rename from assets/typescript.e69b2029.js rename to assets/typescript.dd711b51.js index f824b2519..bc83aef7c 100644 --- a/assets/typescript.e69b2029.js +++ b/assets/typescript.dd711b51.js @@ -1,4 +1,4 @@ -import{m as a}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/xml.6c1a18aa.js b/assets/xml.41997ea4.js similarity index 97% rename from assets/xml.6c1a18aa.js rename to assets/xml.41997ea4.js index c7d845ce0..adf774dd7 100644 --- a/assets/xml.6c1a18aa.js +++ b/assets/xml.41997ea4.js @@ -1,4 +1,4 @@ -import{m}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/assets/yaml.9fe1d6e2.js b/assets/yaml.2bcbf7fc.js similarity index 98% rename from assets/yaml.9fe1d6e2.js rename to assets/yaml.2bcbf7fc.js index 9625d3553..efcec8822 100644 --- a/assets/yaml.9fe1d6e2.js +++ b/assets/yaml.2bcbf7fc.js @@ -1,4 +1,4 @@ -import{m as i}from"./index.11712c1d.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index.f5fa5601.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.39.0(ff3621a3fa6389873be5412d17554294ea1b0941) * Released under the MIT license diff --git a/index.html b/index.html index e3da7502c..04b8cbdfe 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ --> React App - +