diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..bbb5048 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +playground.view-shadcn-ui.devlive.org diff --git a/assets/abap-cc08d55d.js b/assets/abap-cc08d55d.js new file mode 100644 index 0000000..b281b2a --- /dev/null +++ b/assets/abap-cc08d55d.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},t={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{e as conf,t as language}; diff --git a/assets/apex-1f57875b.js b/assets/apex-1f57875b.js new file mode 100644 index 0000000..5818b39 --- /dev/null +++ b/assets/apex-1f57875b.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},s=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1),t=[];s.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var i={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{n as conf,i as language}; diff --git a/assets/azcli-01f8ceb4.js b/assets/azcli-01f8ceb4.js new file mode 100644 index 0000000..4df3fd7 --- /dev/null +++ b/assets/azcli-01f8ceb4.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"#"}},t={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{e as conf,t as language}; diff --git a/assets/bat-927b90fa.js b/assets/bat-927b90fa.js new file mode 100644 index 0000000..514addf --- /dev/null +++ b/assets/bat-927b90fa.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>`\\b${e}\\b`,t="[_a-zA-Z]",o="[_a-zA-Z0-9]",r=n(`${t}${o}*`),i=["targetScope","resource","module","param","var","output","for","in","if","existing"],a=["true","false","null"],s="[ \\t\\r\\n]",c="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])' + `,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=>"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},o={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,o as language}; diff --git a/assets/clojure-e525a5e8.js b/assets/clojure-e525a5e8.js new file mode 100644 index 0000000..09dc3ac --- /dev/null +++ b/assets/clojure-e525a5e8.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},t={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/@qualifiedSymbols/,{cases:{"^:.+$":"constant","@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/[\s,]+/,"white"],[/;.*$/,"comment"],[/\(comment\b/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^()]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/"/,"string","@popall"],[/@escapes/,"string.escape"],[/./,"string"]]}};export{e as conf,t as language}; diff --git a/assets/codicon-0f1d5219.ttf b/assets/codicon-0f1d5219.ttf new file mode 100644 index 0000000..27ee4c6 Binary files /dev/null and b/assets/codicon-0f1d5219.ttf differ diff --git a/assets/coffee-42de5eb2.js b/assets/coffee-42de5eb2.js new file mode 100644 index 0000000..bf64b4a --- /dev/null +++ b/assets/coffee-42de5eb2.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},r={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m512","__m512d","__m512i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>="],symbols:/[=>\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/[^)]+/,"string.raw"],[/\)$S2\"/,{token:"string.raw.end",next:"@pop"}],[/\)/,"string.raw"]],annotation:[{include:"@whitespace"},[/using|alignas/,"keyword"],[/[a-zA-Z0-9_]+/,"annotation"],[/[,:]/,"delimiter"],[/[()]/,"@brackets"],[/\]\s*\]/,{token:"annotation",next:"@pop"}]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}};export{e as conf,n as language}; diff --git a/assets/csharp-a63eb606.js b/assets/csharp-a63eb606.js new file mode 100644 index 0000000..258a1ed --- /dev/null +++ b/assets/csharp-a63eb606.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},t={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,t as language}; diff --git a/assets/csp-165e95c8.js b/assets/csp-165e95c8.js new file mode 100644 index 0000000..7475a4a --- /dev/null +++ b/assets/csp-165e95c8.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var t={brackets:[],autoClosingPairs:[],surroundingPairs:[]},r={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=>",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},[`[^)\r +]+`,"string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|fr|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}};export{e as conf,t as language}; diff --git a/assets/cssMode-7d2e7cbc.js b/assets/cssMode-7d2e7cbc.js new file mode 100644 index 0000000..4853d83 --- /dev/null +++ b/assets/cssMode-7d2e7cbc.js @@ -0,0 +1,9 @@ +import{m as tt}from"./index-9dfb078d.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var rt=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,it=Object.getOwnPropertyNames,ot=Object.prototype.hasOwnProperty,Y=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of it(n))!ot.call(e,t)&&t!==i&&rt(e,t,{get:()=>n[t],enumerable:!(r=nt(n,t))||r.enumerable});return e},at=(e,n,i)=>(Y(e,n,"default"),i&&Y(i,n,"default")),d={};at(d,tt);var st=2*60*1e3,ut=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>st&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=d.editor.createWebWorker({moduleId:"vs/language/css/cssWorker",label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},Z;(function(e){function n(i){return typeof i=="string"}e.is=n})(Z||(Z={}));var O;(function(e){function n(i){return typeof i=="string"}e.is=n})(O||(O={}));var T;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(T||(T={}));var M;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(M||(M={}));var w;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=M.MAX_VALUE),t===Number.MAX_VALUE&&(t=M.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(w||(w={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:w.create(r,t),end:w.create(o,s)};if(w.is(r)&&w.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&w.is(t.start)&&w.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var K;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(K||(K={}));var S;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(S||(S={}));var ee;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&S.is(t.color)}e.is=i})(ee||(ee={}));var te;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||E.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,E.is))}e.is=i})(te||(te={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var re;(function(e){function n(r,t,o,s,u,f){const c={startLine:r,endLine:t};return a.defined(o)&&(c.startCharacter=o),a.defined(s)&&(c.endCharacter=s),a.defined(u)&&(c.kind=u),a.defined(f)&&(c.collapsedText=f),c}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(re||(re={}));var U;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(U||(U={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var ne;(function(e){e.Unnecessary=1,e.Deprecated=2})(ne||(ne={}));var ie;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ie||(ie={}));var y;(function(e){function n(r,t,o,s,u,f){let c={range:r,message:t};return a.defined(o)&&(c.severity=o),a.defined(s)&&(c.code=s),a.defined(u)&&(c.source=u),a.defined(f)&&(c.relatedInformation=f),c}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,U.is))}e.is=i})(y||(y={}));var I;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(I||(I={}));var E;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(E||(E={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var oe;(function(e){function n(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=n;function i(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return E.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(oe||(oe={}));var W;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(W||(W={}));var H;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(H||(H={}));var X;(function(e){function n(r,t,o,s){let u={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?H.is(t)||X.is(t)||$.is(t):W.is(t)))}e.is=n})(z||(z={}));var ae;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(ae||(ae={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(se||(se={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var ue;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(ue||(ue={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var ce;(function(e){e.Deprecated=1})(ce||(ce={}));var de;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(de||(de={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var fe;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(fe||(fe={}));var ge;(function(e){function n(i){return{label:i}}e.create=n})(ge||(ge={}));var he;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(he||(he={}));var F;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(F||(F={}));var ve;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||F.is(r.contents)||a.typedArray(r.contents,F.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(ve||(ve={}));var pe;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(pe||(pe={}));var me;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(me||(me={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var _e;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var be;(function(e){e.Deprecated=1})(be||(be={}));var we;(function(e){function n(i,r,t,o,s){let u={name:i,kind:r,location:{uri:o,range:t}};return s&&(u.containerName=s),u}e.create=n})(we||(we={}));var ke;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var xe;(function(e){function n(r,t,o,s,u,f){let c={name:r,detail:t,kind:o,range:s,selectionRange:u};return f!==void 0&&(c.children=f),c}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(xe||(xe={}));var Ie;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ie||(Ie={}));var j;(function(e){e.Invoked=1,e.Automatic=2})(j||(j={}));var Ee;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,y.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===j.Invoked||t.triggerKind===j.Automatic)}e.is=i})(Ee||(Ee={}));var Le;(function(e){function n(r,t,o){let s={title:r},u=!0;return typeof t=="string"?(u=!1,s.kind=t):I.is(t)?s.command=t:s.edit=t,u&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,y.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||I.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||I.is(t.command))}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Pe||(Pe={}));var De;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(De||(De={}));var Me;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Me||(Me={}));var Ce;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Ce||(Ce={}));var ye;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(ye||(ye={}));var Fe;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(Fe||(Fe={}));var je;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(Ne||(Ne={}));var Oe;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Oe||(Oe={}));var G;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(G||(G={}));var J;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||I.is(t.command))}e.is=i})(J||(J={}));var Se;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&w.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,J.is))&&(t.kind===void 0||G.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,E.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Se||(Se={}));var Ue;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Ue||(Ue={}));var Ve;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Ve||(Ve={}));var We;(function(e){function n(i){return{items:i}}e.create=n})(We||(We={}));var He;(function(e){e.Invoked=0,e.Automatic=1})(He||(He={}));var Xe;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})($e||($e={}));var ze;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&O.is(r.uri)&&a.string(r.name)}e.is=n})(ze||(ze={}));var Be;(function(e){function n(o,s,u,f){return new ct(o,s,u,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let u=o.getText(),f=t(s,(g,_)=>{let b=g.range.start.line-_.range.start.line;return b===0?g.range.start.character-_.range.start.character:b}),c=u.length;for(let g=f.length-1;g>=0;g--){let _=f[g],b=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=c)u=u.substring(0,b)+_.newText+u.substring(l,u.length);else throw new Error("Overlapping edit");c=b}return u}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const u=o.length/2|0,f=o.slice(0,u),c=o.slice(u);t(f,s),t(c,s);let g=0,_=0,b=0;for(;g0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return w.create(0,e);for(;ie?r=o:i=o+1}let t=i-1;return w.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function u(l,N,et){return n.call(l)==="[object Number]"&&N<=l&&l<=et}e.numberRange=u;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function c(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=c;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function b(l,N){return Array.isArray(l)&&l.every(N)}e.typedArray=b})(a||(a={}));var dt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let u;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{d.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),u=this._listener[s];u&&(u.dispose(),delete this._listener[s])};this._disposables.push(d.editor.onDidCreateModel(r)),this._disposables.push(d.editor.onWillDisposeModel(t)),this._disposables.push(d.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{d.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),d.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>ft(e,o));let t=d.editor.getModel(e);t&&t.getLanguageId()===n&&d.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function lt(e){switch(e){case x.Error:return d.MarkerSeverity.Error;case x.Warning:return d.MarkerSeverity.Warning;case x.Information:return d.MarkerSeverity.Info;case x.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function ft(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:lt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var gt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),u=new d.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(c=>{const g={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:pt(c.command),range:u,kind:vt(c.kind)};return c.textEdit&&(ht(c.textEdit)?g.range={insert:m(c.textEdit.insert),replace:m(c.textEdit.replace)}:g.range=m(c.textEdit.range),g.insertText=c.textEdit.newText),c.additionalTextEdits&&(g.additionalTextEdits=c.additionalTextEdits.map(D)),c.insertTextFormat===Q.Snippet&&(g.insertTextRules=d.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Ge(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new d.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function ht(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function vt(e){const n=d.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function D(e){if(e)return{range:m(e.range),text:e.newText}}function pt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var mt=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:bt(t.contents)}})}};function _t(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function qe(e){return typeof e=="string"?{value:e}:_t(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` +`+e.value+"\n```\n"}}function bt(e){if(e)return Array.isArray(e)?e.map(qe):[qe(e)]}var wt=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:kt(o.kind)}))})}};function kt(e){switch(e){case R.Read:return d.languages.DocumentHighlightKind.Read;case R.Write:return d.languages.DocumentHighlightKind.Write;case R.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var xt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Je(t)]})}};function Je(e){return{uri:d.Uri.parse(e.uri),range:m(e.range)}}var It=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Je)})}},Et=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>Lt(o))}};function Lt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=d.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var At=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Rt(t)?Ye(t):{name:t.name,detail:"",containerName:t.containerName,kind:Ze(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Rt(e){return"children"in e}function Ye(e){return{name:e.name,detail:e.detail??"",kind:Ze(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>Ye(n))}}function Ze(e){let n=d.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var Nt=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},Pt=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Te(n)).then(o=>{if(!(!o||o.length===0))return o.map(D)}))}},Dt=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Ge(n),Te(i)).then(s=>{if(!(!s||s.length===0))return s.map(D)}))}};function Te(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var Mt=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Ge(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=D(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(D)),s})})}},Ct=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=yt(o.kind)),s})})}};function yt(e){switch(e){case A.Comment:return d.languages.FoldingRangeKind.Comment;case A.Imports:return d.languages.FoldingRangeKind.Imports;case A.Region:return d.languages.FoldingRangeKind.Region}}var Ft=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}};function Ot(e){const n=[],i=[],r=new ut(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:u}=e;Ke(i),u.completionItems&&i.push(d.languages.registerCompletionItemProvider(s,new gt(t,["/","-",":"]))),u.hovers&&i.push(d.languages.registerHoverProvider(s,new mt(t))),u.documentHighlights&&i.push(d.languages.registerDocumentHighlightProvider(s,new wt(t))),u.definitions&&i.push(d.languages.registerDefinitionProvider(s,new xt(t))),u.references&&i.push(d.languages.registerReferenceProvider(s,new It(t))),u.documentSymbols&&i.push(d.languages.registerDocumentSymbolProvider(s,new At(t))),u.rename&&i.push(d.languages.registerRenameProvider(s,new Et(t))),u.colors&&i.push(d.languages.registerColorProvider(s,new Mt(t))),u.foldingRanges&&i.push(d.languages.registerFoldingRangeProvider(s,new Ct(t))),u.diagnostics&&i.push(new dt(s,t,e.onDidChange)),u.selectionRanges&&i.push(d.languages.registerSelectionRangeProvider(s,new Ft(t))),u.documentFormattingEdits&&i.push(d.languages.registerDocumentFormattingEditProvider(s,new Pt(t))),u.documentRangeFormattingEdits&&i.push(d.languages.registerDocumentRangeFormattingEditProvider(s,new Dt(t)))}return o(),n.push(Qe(i)),Qe(n)}function Qe(e){return{dispose:()=>Ke(e)}}function Ke(e){for(;e.length;)e.pop().dispose()}export{gt as CompletionAdapter,xt as DefinitionAdapter,dt as DiagnosticsAdapter,Mt as DocumentColorAdapter,Pt as DocumentFormattingEditProvider,wt as DocumentHighlightAdapter,Nt as DocumentLinkAdapter,Dt as DocumentRangeFormattingEditProvider,At as DocumentSymbolAdapter,Ct as FoldingRangeAdapter,mt as HoverAdapter,It as ReferenceAdapter,Et as RenameAdapter,Ft as SelectionRangeAdapter,ut as WorkerManager,k as fromPosition,Ge as fromRange,Ot as setupMode,m as toRange,D as toTextEdit}; diff --git a/assets/cypher-2044d661.js b/assets/cypher-2044d661.js new file mode 100644 index 0000000..cc9d336 --- /dev/null +++ b/assets/cypher-2044d661.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}]},i={defaultToken:"",tokenPostfix:".cypher",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ALL","AND","AS","ASC","ASCENDING","BY","CALL","CASE","CONTAINS","CREATE","DELETE","DESC","DESCENDING","DETACH","DISTINCT","ELSE","END","ENDS","EXISTS","IN","IS","LIMIT","MANDATORY","MATCH","MERGE","NOT","ON","ON","OPTIONAL","OR","ORDER","REMOVE","RETURN","SET","SKIP","STARTS","THEN","UNION","UNWIND","WHEN","WHERE","WITH","XOR","YIELD"],builtinLiterals:["true","TRUE","false","FALSE","null","NULL"],builtinFunctions:["abs","acos","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endNode","exists","exp","floor","head","id","keys","labels","last","left","length","log","log10","lTrim","max","min","nodes","percentileCont","percentileDisc","pi","properties","radians","rand","range","relationships","replace","reverse","right","round","rTrim","sign","sin","size","split","sqrt","startNode","stDev","stDevP","substring","sum","tail","tan","timestamp","toBoolean","toFloat","toInteger","toLower","toString","toUpper","trim","type"],operators:["+","-","*","/","%","^","=","<>","<",">","<=",">=","->","<-","-->","<--"],escapes:/\\(?:[tbnrf\\"'`]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+/,octaldigits:/[0-7]+/,hexdigits:/[0-9a-fA-F]+/,tokenizer:{root:[[/[{}[\]()]/,"@brackets"],{include:"common"}],common:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/:[a-zA-Z_][\w]*/,"type.identifier"],[/[a-zA-Z_][\w]*(?=\()/,{cases:{"@builtinFunctions":"predefined.function"}}],[/[a-zA-Z_$][\w$]*/,{cases:{"@keywords":"keyword","@builtinLiterals":"predefined.literal","@default":"identifier"}}],[/`/,"identifier.escape","@identifierBacktick"],[/[;,.:|]/,"delimiter"],[/[<>=%+\-*/^]+/,{cases:{"@operators":"delimiter","@default":""}}]],numbers:[[/-?(@digits)[eE](-?(@digits))?/,"number.float"],[/-?(@digits)?\.(@digits)([eE]-?(@digits))?/,"number.float"],[/-?0x(@hexdigits)/,"number.hex"],[/-?0(@octaldigits)/,"number.octal"],[/-?(@digits)/,"number"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@stringDouble"],[/'/,"string","@stringSingle"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/\/\/.*/,"comment"],[/[^/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[/*]/,"comment"]],stringDouble:[[/[^\\"]+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/"/,"string","@pop"]],stringSingle:[[/[^\\']+/,"string"],[/@escapes/,"string"],[/\\./,"string.invalid"],[/'/,"string","@pop"]],identifierBacktick:[[/[^\\`]+/,"identifier.escape"],[/@escapes/,"identifier.escape"],[/\\./,"identifier.escape.invalid"],[/`/,"identifier.escape","@pop"]]}};export{e as conf,i as language}; diff --git a/assets/dart-95d35cad.js b/assets/dart-95d35cad.js new file mode 100644 index 0000000..c1b8b7a --- /dev/null +++ b/assets/dart-95d35cad.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:"(",close:")"},{open:'"',close:'"'},{open:"`",close:"`"}],folding:{markers:{start:/^\s*\s*#?region\b/,end:/^\s*\s*#?endregion\b/}}},n={defaultToken:"invalid",tokenPostfix:".dart",keywords:["abstract","dynamic","implements","show","as","else","import","static","assert","enum","in","super","async","export","interface","switch","await","extends","is","sync","break","external","library","this","case","factory","mixin","throw","catch","false","new","true","class","final","null","try","const","finally","on","typedef","continue","for","operator","var","covariant","Function","part","void","default","get","rethrow","while","deferred","hide","return","with","do","if","set","yield"],typeKeywords:["int","double","String","bool"],operators:["+","-","*","/","~/","%","++","--","==","!=",">","<",">=","<=","=","-=","/=","%=",">>=","^=","+=","*=","~/=","<<=","&=","!=","||","&&","&","|","^","~","<<",">>","!",">>>","??","?",":","|="],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/\/.*$/,"comment.doc"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"\$]+/,"string"],[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"],[/\$\w+/,"identifier"]],string_single:[[/[^\\'\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"],[/\$\w+/,"identifier"]]}};export{e as conf,n as language}; diff --git a/assets/dockerfile-4446a57c.js b/assets/dockerfile-4446a57c.js new file mode 100644 index 0000000..5add7f8 --- /dev/null +++ b/assets/dockerfile-4446a57c.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}};export{e as conf,o as language}; diff --git a/assets/ecl-12a2dbee.js b/assets/ecl-12a2dbee.js new file mode 100644 index 0000000..917258a --- /dev/null +++ b/assets/ecl-12a2dbee.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},o={defaultToken:"",tokenPostfix:".ecl",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],pounds:["append","break","declare","demangle","end","for","getdatatype","if","inmodule","loop","mangle","onwarning","option","set","stored","uniquename"].join("|"),keywords:["__compressed__","after","all","and","any","as","atmost","before","beginc","best","between","case","cluster","compressed","compression","const","counter","csv","default","descend","embed","encoding","encrypt","end","endc","endembed","endmacro","enum","escape","except","exclusive","expire","export","extend","fail","few","fileposition","first","flat","forward","from","full","function","functionmacro","group","grouped","heading","hole","ifblock","import","in","inner","interface","internal","joined","keep","keyed","last","left","limit","linkcounted","literal","little_endian","load","local","locale","lookup","lzw","macro","many","maxcount","maxlength","min skew","module","mofn","multiple","named","namespace","nocase","noroot","noscan","nosort","not","noxpath","of","onfail","only","opt","or","outer","overwrite","packed","partition","penalty","physicallength","pipe","prefetch","quote","record","repeat","retry","return","right","right1","right2","rows","rowset","scan","scope","self","separator","service","shared","skew","skip","smart","soapaction","sql","stable","store","terminator","thor","threshold","timelimit","timeout","token","transform","trim","type","unicodeorder","unordered","unsorted","unstable","update","use","validate","virtual","whole","width","wild","within","wnotrim","xml","xpath"],functions:["abs","acos","aggregate","allnodes","apply","ascii","asin","assert","asstring","atan","atan2","ave","build","buildindex","case","catch","choose","choosen","choosesets","clustersize","combine","correlation","cos","cosh","count","covariance","cron","dataset","dedup","define","denormalize","dictionary","distribute","distributed","distribution","ebcdic","enth","error","evaluate","event","eventextra","eventname","exists","exp","fail","failcode","failmessage","fetch","fromunicode","fromxml","getenv","getisvalid","global","graph","group","hash","hash32","hash64","hashcrc","hashmd5","having","httpcall","httpheader","if","iff","index","intformat","isvalid","iterate","join","keydiff","keypatch","keyunicode","length","library","limit","ln","loadxml","local","log","loop","map","matched","matchlength","matchposition","matchtext","matchunicode","max","merge","mergejoin","min","nofold","nolocal","nonempty","normalize","nothor","notify","output","parallel","parse","pipe","power","preload","process","project","pull","random","range","rank","ranked","realformat","recordof","regexfind","regexreplace","regroup","rejected","rollup","round","roundup","row","rowdiff","sample","sequential","set","sin","sinh","sizeof","soapcall","sort","sorted","sqrt","stepped","stored","sum","table","tan","tanh","thisnode","topn","tounicode","toxml","transfer","transform","trim","truncate","typeof","ungroup","unicodeorder","variance","wait","which","workunit","xmldecode","xmlencode","xmltext","xmlunicode"],typesint:["integer","unsigned"].join("|"),typesnum:["data","qstring","string","unicode","utf8","varstring","varunicode"],typesone:["ascii","big_endian","boolean","data","decimal","ebcdic","grouped","integer","linkcounted","pattern","qstring","real","record","rule","set of","streamed","string","token","udecimal","unicode","unsigned","utf8","varstring","varunicode"].join("|"),operators:["+","-","/",":=","<","<>","=",">","\\","and","in","not","or"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]]}};export{e as conf,o as language}; diff --git a/assets/elixir-02aec513.js b/assets/elixir-02aec513.js new file mode 100644 index 0000000..a893894 --- /dev/null +++ b/assets/elixir-02aec513.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],autoClosingPairs:[{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["comment"]},{open:'"""',close:'"""'},{open:"`",close:"`",notIn:["string","comment"]},{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"<<",close:">>"}],indentationRules:{increaseIndentPattern:/^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,decreaseIndentPattern:/^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/}},t={defaultToken:"source",tokenPostfix:".elixir",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"<<",close:">>",token:"delimiter.angle.special"}],declarationKeywords:["def","defp","defn","defnp","defguard","defguardp","defmacro","defmacrop","defdelegate","defcallback","defmacrocallback","defmodule","defprotocol","defexception","defimpl","defstruct"],operatorKeywords:["and","in","not","or","when"],namespaceKeywords:["alias","import","require","use"],otherKeywords:["after","case","catch","cond","do","else","end","fn","for","if","quote","raise","receive","rescue","super","throw","try","unless","unquote_splicing","unquote","with"],constants:["true","false","nil"],nameBuiltin:["__MODULE__","__DIR__","__ENV__","__CALLER__","__STACKTRACE__"],operator:/-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,variableName:/[a-z_][a-zA-Z0-9_]*[?!]?/,atomName:/[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,specialAtomName:/\.\.\.|<<>>|%\{\}|%|\{\}/,aliasPart:/[A-Z][a-zA-Z0-9_]*/,moduleName:/@aliasPart(?:\.@aliasPart)*/,sigilSymmetricDelimiter:/"""|'''|"|'|\/|\|/,sigilStartDelimiter:/@sigilSymmetricDelimiter|<|\{|\[|\(/,sigilEndDelimiter:/@sigilSymmetricDelimiter|>|\}|\]|\)/,sigilModifiers:/[a-zA-Z0-9]*/,decimal:/\d(?:_?\d)*/,hex:/[0-9a-fA-F](_?[0-9a-fA-F])*/,octal:/[0-7](_?[0-7])*/,binary:/[01](_?[01])*/,escape:/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,tokenizer:{root:[{include:"@whitespace"},{include:"@comments"},{include:"@keywordsShorthand"},{include:"@numbers"},{include:"@identifiers"},{include:"@strings"},{include:"@atoms"},{include:"@sigils"},{include:"@attributes"},{include:"@symbols"}],whitespace:[[/\s+/,"white"]],comments:[[/(#)(.*)/,["comment.punctuation","comment"]]],keywordsShorthand:[[/(@atomName)(:)(\s+)/,["constant","constant.punctuation","white"]],[/"(?=([^"]|#\{.*?\}|\\")*":)/,{token:"constant.delimiter",next:"@doubleQuotedStringKeyword"}],[/'(?=([^']|#\{.*?\}|\\')*':)/,{token:"constant.delimiter",next:"@singleQuotedStringKeyword"}]],doubleQuotedStringKeyword:[[/":/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringKeyword:[[/':/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],numbers:[[/0b@binary/,"number.binary"],[/0o@octal/,"number.octal"],[/0x@hex/,"number.hex"],[/@decimal\.@decimal([eE]-?@decimal)?/,"number.float"],[/@decimal/,"number"]],identifiers:[[/\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,["keyword.declaration","white",{cases:{unquote:"keyword","@default":"function"}}]],[/(@variableName)(?=\s*\.?\s*\()/,{cases:{"@declarationKeywords":"keyword.declaration","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@default":"function.call"}}],[/(@moduleName)(\s*)(\.)(\s*)(@variableName)/,["type.identifier","white","operator","white","function.call"]],[/(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,["constant.punctuation","constant","white","operator","white","function.call"]],[/(\|>)(\s*)(@variableName)/,["operator","white",{cases:{"@otherKeywords":"keyword","@default":"function.call"}}]],[/(&)(\s*)(@variableName)/,["operator","white","function.call"]],[/@variableName/,{cases:{"@declarationKeywords":"keyword.declaration","@operatorKeywords":"keyword.operator","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@constants":"constant.language","@nameBuiltin":"variable.language","_.*":"comment.unused","@default":"identifier"}}],[/@moduleName/,"type.identifier"]],strings:[[/"""/,{token:"string.delimiter",next:"@doubleQuotedHeredoc"}],[/'''/,{token:"string.delimiter",next:"@singleQuotedHeredoc"}],[/"/,{token:"string.delimiter",next:"@doubleQuotedString"}],[/'/,{token:"string.delimiter",next:"@singleQuotedString"}]],doubleQuotedHeredoc:[[/"""/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedHeredoc:[[/'''/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],doubleQuotedString:[[/"/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedString:[[/'/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],atoms:[[/(:)(@atomName)/,["constant.punctuation","constant"]],[/:"/,{token:"constant.delimiter",next:"@doubleQuotedStringAtom"}],[/:'/,{token:"constant.delimiter",next:"@singleQuotedStringAtom"}]],doubleQuotedStringAtom:[[/"/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringAtom:[[/'/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],sigils:[[/~[a-z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.interpol"}],[/~([A-Z]+)@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.noInterpol"}]],sigil:[[/~([a-z]|[A-Z]+)\{/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.{.}"}],[/~([a-z]|[A-Z]+)\[/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.[.]"}],[/~([a-z]|[A-Z]+)\(/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.(.)"}],[/~([a-z]|[A-Z]+)\"}],[/~([a-z]|[A-Z]+)(@sigilSymmetricDelimiter)/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.$2.$2"}]],"sigilStart.interpol.s":[[/~s@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.s":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContentInterpol"}],"sigilStart.noInterpol.S":[[/~S@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.S":[[/(^|[^\\])\\@sigilEndDelimiter/,"string"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContent"}],"sigilStart.interpol.r":[[/~r@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.r":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContentInterpol"}],"sigilStart.noInterpol.R":[[/~R@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.R":[[/(^|[^\\])\\@sigilEndDelimiter/,"regexp"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContent"}],"sigilStart.interpol":[[/~([a-z]|[A-Z]+)@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContentInterpol"}],"sigilStart.noInterpol":[[/~([a-z]|[A-Z]+)@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol":[[/(^|[^\\])\\@sigilEndDelimiter/,"sigil"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContent"}],attributes:[[/\@(module|type)?doc (~[sS])?"""/,{token:"comment.block.documentation",next:"@doubleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?'''/,{token:"comment.block.documentation",next:"@singleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?"/,{token:"comment.block.documentation",next:"@doubleQuotedStringDocstring"}],[/\@(module|type)?doc (~[sS])?'/,{token:"comment.block.documentation",next:"@singleQuotedStringDocstring"}],[/\@(module|type)?doc false/,"comment.block.documentation"],[/\@(@variableName)/,"variable"]],doubleQuotedHeredocDocstring:[[/"""/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],singleQuotedHeredocDocstring:[[/'''/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],doubleQuotedStringDocstring:[[/"/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],singleQuotedStringDocstring:[[/'/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],symbols:[[/\?(\\.|[^\\\s])/,"number.constant"],[/&\d+/,"operator"],[/<<<|>>>/,"operator"],[/[()\[\]\{\}]|<<|>>/,"@brackets"],[/\.\.\./,"identifier"],[/=>/,"punctuation"],[/@operator/,"operator"],[/[:;,.%]/,"punctuation"]],stringContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringContent"}],stringContent:[[/./,"string"]],stringConstantContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringConstantContent"}],stringConstantContent:[[/./,"constant"]],regexpContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@regexpContent"}],regexpContent:[[/(\s)(#)(\s.*)$/,["white","comment.punctuation","comment"]],[/./,"regexp"]],sigilContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@sigilContent"}],sigilContent:[[/./,"sigil"]],docstringContent:[[/./,"comment.block.documentation"]],escapeChar:[[/@escape/,"constant.character.escape"]],interpolation:[[/#{/,{token:"delimiter.bracket.embed",next:"@interpolationContinue"}]],interpolationContinue:[[/}/,{token:"delimiter.bracket.embed",next:"@pop"}],{include:"@root"}]}};export{e as conf,t as language}; diff --git a/assets/flow9-a8f524dc.js b/assets/flow9-a8f524dc.js new file mode 100644 index 0000000..064961d --- /dev/null +++ b/assets/flow9-a8f524dc.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:"(",close:")",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}]},o={defaultToken:"",tokenPostfix:".flow",keywords:["import","require","export","forbid","native","if","else","cast","unsafe","switch","default"],types:["io","mutable","bool","int","double","string","flow","void","ref","true","false","with"],operators:["=",">","<","<=",">=","==","!","!=",":=","::=","&&","||","+","-","*","/","@","&","%",":","->","\\","$","??","^"],symbols:/[@$=>](?!@symbols)/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}};export{e as conf,o as language}; diff --git a/assets/freemarker2-15df4423.js b/assets/freemarker2-15df4423.js new file mode 100644 index 0000000..20314d8 --- /dev/null +++ b/assets/freemarker2-15df4423.js @@ -0,0 +1,8 @@ +import{m as F}from"./index-9dfb078d.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,v=Object.prototype.hasOwnProperty,g=(t,n,_,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of $(n))!v.call(t,o)&&o!==_&&b(t,o,{get:()=>n[o],enumerable:!(e=x(n,o))||e.enumerable});return t},E=(t,n,_)=>(g(t,n,"default"),_&&g(_,n,"default")),r={};E(r,F);var d=["assign","flush","ftl","return","global","import","include","break","continue","local","nested","nt","setting","stop","t","lt","rt","fallback"],s=["attempt","autoesc","autoEsc","compress","comment","escape","noescape","function","if","list","items","sep","macro","noparse","noParse","noautoesc","noAutoEsc","outputformat","switch","visit","recurse"],a={close:">",id:"angle",open:"<"},u={close:"\\]",id:"bracket",open:"\\["},D={close:"[>\\]]",id:"auto",open:"[<\\[]"},k={close:"\\}",id:"dollar",open1:"\\$",open2:"\\{"},p={close:"\\]",id:"bracket",open1:"\\[",open2:"="};function l(t){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],comments:{blockComment:[`${t.open}--`,`--${t.close}`]},autoCloseBefore:` +\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`${t.open}#(?:${s.join("|")})([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),end:new RegExp(`${t.open}/#(?:${s.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),afterText:new RegExp(`^${t.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${t.close}$`),action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`${t.open}#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/${t.close}]*(?!/)${t.close})[^${t.open}]*$`),action:{indentAction:r.languages.IndentAction.Indent}}]}}function A(){return{brackets:[["<",">"],["[","]"],["(",")"],["{","}"]],autoCloseBefore:` +\r }]),.:;=`,autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],folding:{markers:{start:new RegExp(`[<\\[]#(?:${s.join("|")})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:new RegExp(`[<\\[]/#(?:${s.join("|")})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:new RegExp(`[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:new RegExp("^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$"),action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`[<\\[]#(?!(?:${d.join("|")}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:r.languages.IndentAction.Indent}}]}}function i(t,n){const _=`_${t.id}_${n.id}`,e=c=>c.replace(/__id__/g,_),o=c=>{const f=c.source.replace(/__id__/g,_);return new RegExp(f,c.flags)};return{unicode:!0,includeLF:!1,start:e("default__id__"),ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],[e("open__id__")]:new RegExp(t.open),[e("close__id__")]:new RegExp(t.close),[e("iOpen1__id__")]:new RegExp(n.open1),[e("iOpen2__id__")]:new RegExp(n.open2),[e("iClose__id__")]:new RegExp(n.close),[e("startTag__id__")]:o(/(@open__id__)(#)/),[e("endTag__id__")]:o(/(@open__id__)(\/#)/),[e("startOrEndTag__id__")]:o(/(@open__id__)(\/?#)/),[e("closeTag1__id__")]:o(/((?:@blank)*)(@close__id__)/),[e("closeTag2__id__")]:o(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:["false","true","in","as","using"],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:["->","->"],delimiters:[";",":",",","."],stringOperators:["lte","lt","gte","gt"],noParseTags:["noparse","noParse","comment"],tokenizer:{[e("default__id__")]:[{include:e("@directive_token__id__")},{include:e("@interpolation_and_text_token__id__")}],[e("fmExpression__id__.directive")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("fmExpression__id__.interpolation")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("inParen__id__.plain")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("inParen__id__.gt")]:[{include:e("@blank_and_expression_comment_token__id__")},{include:e("@expression_token__id__")},{include:e("@greater_operators_token__id__")}],[e("noSpaceExpression__id__")]:[{include:e("@no_space_expression_end_token__id__")},{include:e("@directive_end_token__id__")},{include:e("@expression_token__id__")}],[e("unifiedCall__id__")]:[{include:e("@unified_call_token__id__")}],[e("singleString__id__")]:[{include:e("@string_single_token__id__")}],[e("doubleString__id__")]:[{include:e("@string_double_token__id__")}],[e("rawSingleString__id__")]:[{include:e("@string_single_raw_token__id__")}],[e("rawDoubleString__id__")]:[{include:e("@string_double_raw_token__id__")}],[e("expressionComment__id__")]:[{include:e("@expression_comment_token__id__")}],[e("noParse__id__")]:[{include:e("@no_parse_token__id__")}],[e("terseComment__id__")]:[{include:e("@terse_comment_token__id__")}],[e("directive_token__id__")]:[[o(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{cases:{"@noParseTags":{token:"tag",next:e("@noParse__id__.$3")},"@default":{token:"tag"}}},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)(@)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive",next:e("@unifiedCall__id__")}]],[o(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive"}]],[o(/(@open__id__)#--/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:{token:"comment",next:e("@terseComment__id__")}],[o(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),t.id==="auto"?{cases:{"$1==<":{token:"@rematch",switchTo:`@default_angle_${n.id}`},"$1==[":{token:"@rematch",switchTo:`@default_bracket_${n.id}`}}}:[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag.invalid",next:e("@fmExpression__id__.directive")}]]],[e("interpolation_and_text_token__id__")]:[[o(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:n.id==="bracket"?"@brackets.interpolation":"delimiter.interpolation"},{token:n.id==="bracket"?"delimiter.interpolation":"@brackets.interpolation",next:e("@fmExpression__id__.interpolation")}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:"source"}]],[e("string_single_token__id__")]:[[/[^'\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/'/,{token:"string",next:"@pop"}]],[e("string_double_token__id__")]:[[/[^"\\]/,{token:"string"}],[/@escapedChar/,{token:"string.escape"}],[/"/,{token:"string",next:"@pop"}]],[e("string_single_raw_token__id__")]:[[/[^']+/,{token:"string.raw"}],[/'/,{token:"string.raw",next:"@pop"}]],[e("string_double_raw_token__id__")]:[[/[^"]+/,{token:"string.raw"}],[/"/,{token:"string.raw",next:"@pop"}]],[e("expression_token__id__")]:[[/(r?)(['"])/,{cases:{"r'":[{token:"keyword"},{token:"string.raw",next:e("@rawSingleString__id__")}],'r"':[{token:"keyword"},{token:"string.raw",next:e("@rawDoubleString__id__")}],"'":[{token:"source"},{token:"string",next:e("@singleString__id__")}],'"':[{token:"source"},{token:"string",next:e("@doubleString__id__")}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:"number"},"@default":{token:"number.float"}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:"delimiter"},{token:""},{token:"identifier"}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:"meta.arrow"},"@delimiters":{token:"delimiter"},"@default":{token:"operators"}}}],[/@id/,{cases:{"@keywords":{token:"keyword.$0"},"@stringOperators":{token:"operators"},"@default":{token:"identifier"}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\]":{cases:{...n.id==="bracket"?{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}}:{},...t.id==="bracket"?{"$S2==directive":{token:"@brackets.directive",next:"@popall"}}:{},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\(":{token:"@brackets",next:e("@inParen__id__.gt")},"\\)":{cases:{[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}},"\\{":{cases:{"$S2==gt":{token:"@brackets",next:e("@inParen__id__.gt")},"@default":{token:"@brackets",next:e("@inParen__id__.plain")}}},"\\}":{cases:{...n.id==="bracket"?{}:{"$S2==interpolation":{token:"@brackets.interpolation",next:"@popall"}},[e("$S1==inParen__id__")]:{token:"@brackets",next:"@pop"},"@default":{token:"@brackets"}}}}}],[/\$\{/,{token:"delimiter.invalid"}]],[e("blank_and_expression_comment_token__id__")]:[[/(?:@blank)+/,{token:""}],[/[<\[][#!]--/,{token:"comment",next:e("@expressionComment__id__")}]],[e("directive_end_token__id__")]:[[/>/,t.id==="bracket"?{token:"operators"}:{token:"@brackets.directive",next:"@popall"}],[o(/(\/)(@close__id__)/),[{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]]],[e("greater_operators_token__id__")]:[[/>/,{token:"operators"}],[/>=/,{token:"operators"}]],[e("no_space_expression_end_token__id__")]:[[/(?:@blank)+/,{token:"",switchTo:e("@fmExpression__id__.directive")}]],[e("unified_call_token__id__")]:[[/(@id)((?:@blank)+)/,[{token:"tag"},{token:"",next:e("@fmExpression__id__.directive")}]],[o(/(@id)(\/?)(@close__id__)/),[{token:"tag"},{token:"delimiter.directive"},{token:"@brackets.directive",next:"@popall"}]],[/./,{token:"@rematch",next:e("@noSpaceExpression__id__")}]],[e("no_parse_token__id__")]:[[o(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:"@brackets.directive"},{token:"delimiter.directive"},{token:"tag"},{token:""},{token:"@brackets.directive",next:"@popall"}],"$S2==comment":[{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"},{token:"comment"}],"@default":[{token:"source"},{token:"source"},{token:"source"},{token:"source"},{token:"source"}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:"comment"},"@default":{token:"source"}}}]],[e("expression_comment_token__id__")]:[[/--[>\]]/,{token:"comment",next:"@pop"}],[/[^\->\]]+|[>\]\-]/,{token:"comment"}]],[e("terse_comment_token__id__")]:[[o(/--(?:@close__id__)/),{token:"comment",next:"@popall"}],[/[^<\[\-]+|[<\[\-]/,{token:"comment"}]]}}}function m(t){const n=i(a,t),_=i(u,t),e=i(D,t);return{...n,..._,...e,unicode:!0,includeLF:!1,start:`default_auto_${t.id}`,ignoreCase:!1,defaultToken:"invalid",tokenPostfix:".freemarker2",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{...n.tokenizer,..._.tokenizer,...e.tokenizer}}}var C={conf:l(a),language:i(a,k)},w={conf:l(u),language:i(u,k)},T={conf:l(a),language:i(a,p)},h={conf:l(u),language:i(u,p)},S={conf:A(),language:m(k)},P={conf:A(),language:m(p)};export{T as TagAngleInterpolationBracket,C as TagAngleInterpolationDollar,P as TagAutoInterpolationBracket,S as TagAutoInterpolationDollar,h as TagBracketInterpolationBracket,w as TagBracketInterpolationDollar}; diff --git a/assets/fsharp-7e8e6a66.js b/assets/fsharp-7e8e6a66.js new file mode 100644 index 0000000..ce57a89 --- /dev/null +++ b/assets/fsharp-7e8e6a66.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),end:new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")}}},n={defaultToken:"",tokenPostfix:".fs",keywords:["abstract","and","atomic","as","assert","asr","base","begin","break","checked","component","const","constraint","constructor","continue","class","default","delegate","do","done","downcast","downto","elif","else","end","exception","eager","event","external","extern","false","finally","for","fun","function","fixed","functor","global","if","in","include","inherit","inline","interface","internal","land","lor","lsl","lsr","lxor","lazy","let","match","member","mod","module","mutable","namespace","method","mixin","new","not","null","of","open","or","object","override","private","parallel","process","protected","pure","public","rec","return","static","sealed","struct","sig","then","to","true","tailcall","trait","try","type","upcast","use","val","void","virtual","volatile","when","while","with","yield"],symbols:/[=>\]/,"annotation"],[/^#(if|else|endif)/,"keyword"],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0x[0-9a-fA-F]+LF/,"number.float"],[/0x[0-9a-fA-F]+(@integersuffix)/,"number.hex"],[/0b[0-1]+(@integersuffix)/,"number.bin"],[/\d+(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"""/,"string",'@string."""'],[/"/,"string",'@string."'],[/\@"/,{token:"string.quote",next:"@litstring"}],[/'[^\\']'B?/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\(\*(?!\))/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^*(]+/,"comment"],[/\*\)/,"comment","@pop"],[/\*/,"comment"],[/\(\*\)/,"comment"],[/\(/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/("""|"B?)/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]]}};export{e as conf,n as language}; diff --git a/assets/go-9d89e322.js b/assets/go-9d89e322.js new file mode 100644 index 0000000..4f410b2 --- /dev/null +++ b/assets/go-9d89e322.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},n={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}};export{e as conf,n as language}; diff --git a/assets/graphql-ed4730b7.js b/assets/graphql-ed4730b7.js new file mode 100644 index 0000000..a6a4e77 --- /dev/null +++ b/assets/graphql-ed4730b7.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""'},{open:'"',close:'"'}],folding:{offSide:!0}},n={defaultToken:"invalid",tokenPostfix:".gql",keywords:["null","true","false","query","mutation","subscription","extend","schema","directive","scalar","type","interface","union","enum","input","implements","fragment","on"],typeKeywords:["Int","Float","String","Boolean","ID"],directiveLocations:["SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","VARIABLE_DEFINITION"],operators:["=","!","?",":","&","|"],symbols:/[=!?:&|]+/,escapes:/\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,tokenizer:{root:[[/[a-z_][\w$]*/,{cases:{"@keywords":"keyword","@default":"key.identifier"}}],[/[$][\w$]*/,{cases:{"@keywords":"keyword","@default":"argument.identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@typeKeywords":"keyword","@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,{token:"annotation",log:"annotation token: $0"}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@mlstring",nextEmbedded:"markdown"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],mlstring:[[/[^"]+/,"string"],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/#.*$/,"comment"]]}};export{e as conf,n as language}; diff --git a/assets/handlebars-f8531685.js b/assets/handlebars-f8531685.js new file mode 100644 index 0000000..7d05764 --- /dev/null +++ b/assets/handlebars-f8531685.js @@ -0,0 +1,6 @@ +import{m as i}from"./index-9dfb078d.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var s=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,o=(t,e,a,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of c(e))!p.call(t,n)&&n!==a&&s(t,n,{get:()=>e[n],enumerable:!(m=d(e,n))||m.enumerable});return t},h=(t,e,a)=>(o(t,e,"default"),a&&o(a,e,"default")),r={};h(r,i);var l=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],u={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[[""],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${l.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:r.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${l.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:r.languages.IndentAction.Indent}}]},y={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{u as conf,y as language}; diff --git a/assets/hcl-fb184eb8.js b/assets/hcl-fb184eb8.js new file mode 100644 index 0000000..8f23e8f --- /dev/null +++ b/assets/hcl-fb184eb8.js @@ -0,0 +1,6 @@ +/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var e={comments:{lineComment:"#",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},t={defaultToken:"",tokenPostfix:".hcl",keywords:["var","local","path","for_each","any","string","number","bool","true","false","null","if ","else ","endif ","for ","in","endfor"],operators:["=",">=","<=","==","!=","+","-","*","/","%","&&","||","!","<",">","?","...",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"/,"string","@string"],[/'/,"invalid"]],heredoc:[[/<<[-]*\s*["]?([\w\-]+)["]?/,{token:"string.heredoc.delimiter",next:"@heredocBody.$1"}]],heredocBody:[[/([\w\-]+)$/,{cases:{"$1==$S2":[{token:"string.heredoc.delimiter",next:"@popall"}],"@default":"string.heredoc"}}],[/./,"string.heredoc"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"],[/#.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/\$\{/,{token:"delimiter",next:"@stringExpression"}],[/[^\\"\$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@popall"]],stringInsideExpression:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],stringExpression:[[/\}/,{token:"delimiter",next:"@pop"}],[/"/,"string","@stringInsideExpression"],{include:"@terraform"}]}};export{e as conf,t as language}; diff --git a/assets/html-e81aba02.js b/assets/html-e81aba02.js new file mode 100644 index 0000000..cddc0ab --- /dev/null +++ b/assets/html-e81aba02.js @@ -0,0 +1,6 @@ +import{m as d}from"./index-9dfb078d.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,a=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!c.call(t,r)&&r!==n&&p(t,r,{get:()=>e[r],enumerable:!(o=m(e,r))||o.enumerable});return t},u=(t,e,n)=>(a(t,e,"default"),n&&a(n,e,"default")),i={};u(i,d);var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],x={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[""]},brackets:[[""],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${s.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:i.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${s.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:i.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*"),end:new RegExp("^\\s*")}}},y={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"module"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/'module'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.text/javascript"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}};export{x as conf,y as language}; diff --git a/assets/htmlMode-beaa838d.js b/assets/htmlMode-beaa838d.js new file mode 100644 index 0000000..7590e55 --- /dev/null +++ b/assets/htmlMode-beaa838d.js @@ -0,0 +1,9 @@ +import{m as ft}from"./index-9dfb078d.js";/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var gt=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,vt=Object.getOwnPropertyNames,pt=Object.prototype.hasOwnProperty,T=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of vt(n))!pt.call(e,t)&&t!==i&>(e,t,{get:()=>n[t],enumerable:!(r=ht(n,t))||r.enumerable});return e},mt=(e,n,i)=>(T(e,n,"default"),i&&T(i,n,"default")),c={};mt(c,ft);var _t=2*60*1e3,Ge=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>_t&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c.editor.createWebWorker({moduleId:"vs/language/html/htmlWorker",createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},Y;(function(e){function n(i){return typeof i=="string"}e.is=n})(Y||(Y={}));var S;(function(e){function n(i){return typeof i=="string"}e.is=n})(S||(S={}));var Z;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(Z||(Z={}));var M;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function n(i){return typeof i=="number"&&e.MIN_VALUE<=i&&i<=e.MAX_VALUE}e.is=n})(M||(M={}));var b;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=M.MAX_VALUE),t===Number.MAX_VALUE&&(t=M.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&a.uinteger(t.line)&&a.uinteger(t.character)}e.is=i})(b||(b={}));var h;(function(e){function n(r,t,o,s){if(a.uinteger(r)&&a.uinteger(t)&&a.uinteger(o)&&a.uinteger(s))return{start:b.create(r,t),end:b.create(o,s)};if(b.is(r)&&b.is(t))return{start:r,end:t};throw new Error(`Range#create called with invalid arguments[${r}, ${t}, ${o}, ${s}]`)}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&b.is(t.start)&&b.is(t.end)}e.is=i})(h||(h={}));var C;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(a.string(t.uri)||a.undefined(t.uri))}e.is=i})(C||(C={}));var K;(function(e){function n(r,t,o,s){return{targetUri:r,targetRange:t,targetSelectionRange:o,originSelectionRange:s}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.targetRange)&&a.string(t.targetUri)&&h.is(t.targetSelectionRange)&&(h.is(t.originSelectionRange)||a.undefined(t.originSelectionRange))}e.is=i})(K||(K={}));var O;(function(e){function n(r,t,o,s){return{red:r,green:t,blue:o,alpha:s}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.numberRange(t.red,0,1)&&a.numberRange(t.green,0,1)&&a.numberRange(t.blue,0,1)&&a.numberRange(t.alpha,0,1)}e.is=i})(O||(O={}));var ee;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&h.is(t.range)&&O.is(t.color)}e.is=i})(ee||(ee={}));var te;(function(e){function n(r,t,o){return{label:r,textEdit:t,additionalTextEdits:o}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.undefined(t.textEdit)||E.is(t))&&(a.undefined(t.additionalTextEdits)||a.typedArray(t.additionalTextEdits,E.is))}e.is=i})(te||(te={}));var A;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(A||(A={}));var re;(function(e){function n(r,t,o,s,u,f){const d={startLine:r,endLine:t};return a.defined(o)&&(d.startCharacter=o),a.defined(s)&&(d.endCharacter=s),a.defined(u)&&(d.kind=u),a.defined(f)&&(d.collapsedText=f),d}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.uinteger(t.startLine)&&a.uinteger(t.startLine)&&(a.undefined(t.startCharacter)||a.uinteger(t.startCharacter))&&(a.undefined(t.endCharacter)||a.uinteger(t.endCharacter))&&(a.undefined(t.kind)||a.string(t.kind))}e.is=i})(re||(re={}));var U;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&C.is(t.location)&&a.string(t.message)}e.is=i})(U||(U={}));var x;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(x||(x={}));var ne;(function(e){e.Unnecessary=1,e.Deprecated=2})(ne||(ne={}));var ie;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&a.string(r.href)}e.is=n})(ie||(ie={}));var F;(function(e){function n(r,t,o,s,u,f){let d={range:r,message:t};return a.defined(o)&&(d.severity=o),a.defined(s)&&(d.code=s),a.defined(u)&&(d.source=u),a.defined(f)&&(d.relatedInformation=f),d}e.create=n;function i(r){var t;let o=r;return a.defined(o)&&h.is(o.range)&&a.string(o.message)&&(a.number(o.severity)||a.undefined(o.severity))&&(a.integer(o.code)||a.string(o.code)||a.undefined(o.code))&&(a.undefined(o.codeDescription)||a.string((t=o.codeDescription)===null||t===void 0?void 0:t.href))&&(a.string(o.source)||a.undefined(o.source))&&(a.undefined(o.relatedInformation)||a.typedArray(o.relatedInformation,U.is))}e.is=i})(F||(F={}));var I;(function(e){function n(r,t,...o){let s={title:r,command:t};return a.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.title)&&a.string(t.command)}e.is=i})(I||(I={}));var E;(function(e){function n(o,s){return{range:o,newText:s}}e.replace=n;function i(o,s){return{range:{start:o,end:o},newText:s}}e.insert=i;function r(o){return{range:o,newText:""}}e.del=r;function t(o){const s=o;return a.objectLiteral(s)&&a.string(s.newText)&&h.is(s.range)}e.is=t})(E||(E={}));var V;(function(e){function n(r,t,o){const s={label:r};return t!==void 0&&(s.needsConfirmation=t),o!==void 0&&(s.description=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&a.string(t.label)&&(a.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(a.string(t.description)||t.description===void 0)}e.is=i})(V||(V={}));var L;(function(e){function n(i){const r=i;return a.string(r)}e.is=n})(L||(L={}));var oe;(function(e){function n(o,s,u){return{range:o,newText:s,annotationId:u}}e.replace=n;function i(o,s,u){return{range:{start:o,end:o},newText:s,annotationId:u}}e.insert=i;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function t(o){const s=o;return E.is(s)&&(V.is(s.annotationId)||L.is(s.annotationId))}e.is=t})(oe||(oe={}));var W;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&B.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(W||(W={}));var H;(function(e){function n(r,t,o){let s={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="create"&&a.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(H||(H={}));var X;(function(e){function n(r,t,o,s){let u={kind:"rename",oldUri:r,newUri:t};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(u.options=o),s!==void 0&&(u.annotationId=s),u}e.create=n;function i(r){let t=r;return t&&t.kind==="rename"&&a.string(t.oldUri)&&a.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||a.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||a.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})(X||(X={}));var $;(function(e){function n(r,t,o){let s={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(s.options=t),o!==void 0&&(s.annotationId=o),s}e.create=n;function i(r){let t=r;return t&&t.kind==="delete"&&a.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||a.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||a.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||L.is(t.annotationId))}e.is=i})($||($={}));var z;(function(e){function n(i){let r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(t=>a.string(t.kind)?H.is(t)||X.is(t)||$.is(t):W.is(t)))}e.is=n})(z||(z={}));var ae;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)}e.is=i})(ae||(ae={}));var se;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.integer(t.version)}e.is=i})(se||(se={}));var B;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&(t.version===null||a.integer(t.version))}e.is=i})(B||(B={}));var ue;(function(e){function n(r,t,o,s){return{uri:r,languageId:t,version:o,text:s}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.string(t.uri)&&a.string(t.languageId)&&a.integer(t.version)&&a.string(t.text)}e.is=i})(ue||(ue={}));var q;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function n(i){const r=i;return r===e.PlainText||r===e.Markdown}e.is=n})(q||(q={}));var P;(function(e){function n(i){const r=i;return a.objectLiteral(i)&&q.is(r.kind)&&a.string(r.value)}e.is=n})(P||(P={}));var v;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(v||(v={}));var Q;(function(e){e.PlainText=1,e.Snippet=2})(Q||(Q={}));var ce;(function(e){e.Deprecated=1})(ce||(ce={}));var de;(function(e){function n(r,t,o){return{newText:r,insert:t,replace:o}}e.create=n;function i(r){const t=r;return t&&a.string(t.newText)&&h.is(t.insert)&&h.is(t.replace)}e.is=i})(de||(de={}));var le;(function(e){e.asIs=1,e.adjustIndentation=2})(le||(le={}));var fe;(function(e){function n(i){const r=i;return r&&(a.string(r.detail)||r.detail===void 0)&&(a.string(r.description)||r.description===void 0)}e.is=n})(fe||(fe={}));var ge;(function(e){function n(i){return{label:i}}e.create=n})(ge||(ge={}));var he;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(he||(he={}));var y;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){const t=r;return a.string(t)||a.objectLiteral(t)&&a.string(t.language)&&a.string(t.value)}e.is=i})(y||(y={}));var ve;(function(e){function n(i){let r=i;return!!r&&a.objectLiteral(r)&&(P.is(r.contents)||y.is(r.contents)||a.typedArray(r.contents,y.is))&&(i.range===void 0||h.is(i.range))}e.is=n})(ve||(ve={}));var pe;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(pe||(pe={}));var me;(function(e){function n(i,r,...t){let o={label:i};return a.defined(r)&&(o.documentation=r),a.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(me||(me={}));var R;(function(e){e.Text=1,e.Read=2,e.Write=3})(R||(R={}));var _e;(function(e){function n(i,r){let t={range:i};return a.number(r)&&(t.kind=r),t}e.create=n})(_e||(_e={}));var p;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(p||(p={}));var we;(function(e){e.Deprecated=1})(we||(we={}));var be;(function(e){function n(i,r,t,o,s){let u={name:i,kind:r,location:{uri:o,range:t}};return s&&(u.containerName=s),u}e.create=n})(be||(be={}));var ke;(function(e){function n(i,r,t,o){return o!==void 0?{name:i,kind:r,location:{uri:t,range:o}}:{name:i,kind:r,location:{uri:t}}}e.create=n})(ke||(ke={}));var xe;(function(e){function n(r,t,o,s,u,f){let d={name:r,detail:t,kind:o,range:s,selectionRange:u};return f!==void 0&&(d.children=f),d}e.create=n;function i(r){let t=r;return t&&a.string(t.name)&&a.number(t.kind)&&h.is(t.range)&&h.is(t.selectionRange)&&(t.detail===void 0||a.string(t.detail))&&(t.deprecated===void 0||a.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(xe||(xe={}));var Ie;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Ie||(Ie={}));var j;(function(e){e.Invoked=1,e.Automatic=2})(j||(j={}));var Ee;(function(e){function n(r,t,o){let s={diagnostics:r};return t!=null&&(s.only=t),o!=null&&(s.triggerKind=o),s}e.create=n;function i(r){let t=r;return a.defined(t)&&a.typedArray(t.diagnostics,F.is)&&(t.only===void 0||a.typedArray(t.only,a.string))&&(t.triggerKind===void 0||t.triggerKind===j.Invoked||t.triggerKind===j.Automatic)}e.is=i})(Ee||(Ee={}));var Le;(function(e){function n(r,t,o){let s={title:r},u=!0;return typeof t=="string"?(u=!1,s.kind=t):I.is(t)?s.command=t:s.edit=t,u&&o!==void 0&&(s.kind=o),s}e.create=n;function i(r){let t=r;return t&&a.string(t.title)&&(t.diagnostics===void 0||a.typedArray(t.diagnostics,F.is))&&(t.kind===void 0||a.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||I.is(t.command))&&(t.isPreferred===void 0||a.boolean(t.isPreferred))&&(t.edit===void 0||z.is(t.edit))}e.is=i})(Le||(Le={}));var Ae;(function(e){function n(r,t){let o={range:r};return a.defined(t)&&(o.data=t),o}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.command)||I.is(t.command))}e.is=i})(Ae||(Ae={}));var Re;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){let t=r;return a.defined(t)&&a.uinteger(t.tabSize)&&a.boolean(t.insertSpaces)}e.is=i})(Re||(Re={}));var Pe;(function(e){function n(r,t,o){return{range:r,target:t,data:o}}e.create=n;function i(r){let t=r;return a.defined(t)&&h.is(t.range)&&(a.undefined(t.target)||a.string(t.target))}e.is=i})(Pe||(Pe={}));var De;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){let t=r;return a.objectLiteral(t)&&h.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(De||(De={}));var Me;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(Me||(Me={}));var Ce;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(Ce||(Ce={}));var Fe;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=n})(Fe||(Fe={}));var ye;(function(e){function n(r,t){return{range:r,text:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.string(t.text)}e.is=i})(ye||(ye={}));var je;(function(e){function n(r,t,o){return{range:r,variableName:t,caseSensitiveLookup:o}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&a.boolean(t.caseSensitiveLookup)&&(a.string(t.variableName)||t.variableName===void 0)}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){return{range:r,expression:t}}e.create=n;function i(r){const t=r;return t!=null&&h.is(t.range)&&(a.string(t.expression)||t.expression===void 0)}e.is=i})(Ne||(Ne={}));var Se;(function(e){function n(r,t){return{frameId:r,stoppedLocation:t}}e.create=n;function i(r){const t=r;return a.defined(t)&&h.is(r.stoppedLocation)}e.is=i})(Se||(Se={}));var G;(function(e){e.Type=1,e.Parameter=2;function n(i){return i===1||i===2}e.is=n})(G||(G={}));var J;(function(e){function n(r){return{value:r}}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.location===void 0||C.is(t.location))&&(t.command===void 0||I.is(t.command))}e.is=i})(J||(J={}));var Oe;(function(e){function n(r,t,o){const s={position:r,label:t};return o!==void 0&&(s.kind=o),s}e.create=n;function i(r){const t=r;return a.objectLiteral(t)&&b.is(t.position)&&(a.string(t.label)||a.typedArray(t.label,J.is))&&(t.kind===void 0||G.is(t.kind))&&t.textEdits===void 0||a.typedArray(t.textEdits,E.is)&&(t.tooltip===void 0||a.string(t.tooltip)||P.is(t.tooltip))&&(t.paddingLeft===void 0||a.boolean(t.paddingLeft))&&(t.paddingRight===void 0||a.boolean(t.paddingRight))}e.is=i})(Oe||(Oe={}));var Ue;(function(e){function n(i){return{kind:"snippet",value:i}}e.createSnippet=n})(Ue||(Ue={}));var Ve;(function(e){function n(i,r,t,o){return{insertText:i,filterText:r,range:t,command:o}}e.create=n})(Ve||(Ve={}));var We;(function(e){function n(i){return{items:i}}e.create=n})(We||(We={}));var He;(function(e){e.Invoked=0,e.Automatic=1})(He||(He={}));var Xe;(function(e){function n(i,r){return{range:i,text:r}}e.create=n})(Xe||(Xe={}));var $e;(function(e){function n(i,r){return{triggerKind:i,selectedCompletionInfo:r}}e.create=n})($e||($e={}));var ze;(function(e){function n(i){const r=i;return a.objectLiteral(r)&&S.is(r.uri)&&a.string(r.name)}e.is=n})(ze||(ze={}));var Be;(function(e){function n(o,s,u,f){return new wt(o,s,u,f)}e.create=n;function i(o){let s=o;return!!(a.defined(s)&&a.string(s.uri)&&(a.undefined(s.languageId)||a.string(s.languageId))&&a.uinteger(s.lineCount)&&a.func(s.getText)&&a.func(s.positionAt)&&a.func(s.offsetAt))}e.is=i;function r(o,s){let u=o.getText(),f=t(s,(g,_)=>{let w=g.range.start.line-_.range.start.line;return w===0?g.range.start.character-_.range.start.character:w}),d=u.length;for(let g=f.length-1;g>=0;g--){let _=f[g],w=o.offsetAt(_.range.start),l=o.offsetAt(_.range.end);if(l<=d)u=u.substring(0,w)+_.newText+u.substring(l,u.length);else throw new Error("Overlapping edit");d=w}return u}e.applyEdits=r;function t(o,s){if(o.length<=1)return o;const u=o.length/2|0,f=o.slice(0,u),d=o.slice(u);t(f,s),t(d,s);let g=0,_=0,w=0;for(;g0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),i=0,r=n.length;if(r===0)return b.create(0,e);for(;ie?r=o:i=o+1}let t=i-1;return b.create(t,e-n[t])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let i=n[e.line],r=e.line+1"u"}e.undefined=r;function t(l){return l===!0||l===!1}e.boolean=t;function o(l){return n.call(l)==="[object String]"}e.string=o;function s(l){return n.call(l)==="[object Number]"}e.number=s;function u(l,N,lt){return n.call(l)==="[object Number]"&&N<=l&&l<=lt}e.numberRange=u;function f(l){return n.call(l)==="[object Number]"&&-2147483648<=l&&l<=2147483647}e.integer=f;function d(l){return n.call(l)==="[object Number]"&&0<=l&&l<=2147483647}e.uinteger=d;function g(l){return n.call(l)==="[object Function]"}e.func=g;function _(l){return l!==null&&typeof l=="object"}e.objectLiteral=_;function w(l,N){return Array.isArray(l)&&l.every(N)}e.typedArray=w})(a||(a={}));var yt=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=o=>{let s=o.getLanguageId();if(s!==this._languageId)return;let u;this._listener[o.uri.toString()]=o.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(o.uri,s),500)}),this._doValidate(o.uri,s)},t=o=>{c.editor.setModelMarkers(o,this._languageId,[]);let s=o.uri.toString(),u=this._listener[s];u&&(u.dispose(),delete this._listener[s])};this._disposables.push(c.editor.onDidCreateModel(r)),this._disposables.push(c.editor.onWillDisposeModel(t)),this._disposables.push(c.editor.onDidChangeModelLanguage(o=>{t(o.model),r(o.model)})),this._disposables.push(i(o=>{c.editor.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(t(s),r(s))})})),this._disposables.push({dispose:()=>{c.editor.getModels().forEach(t);for(let o in this._listener)this._listener[o].dispose()}}),c.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(o=>kt(e,o));let t=c.editor.getModel(e);t&&t.getLanguageId()===n&&c.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function bt(e){switch(e){case x.Error:return c.MarkerSeverity.Error;case x.Warning:return c.MarkerSeverity.Warning;case x.Information:return c.MarkerSeverity.Info;case x.Hint:return c.MarkerSeverity.Hint;default:return c.MarkerSeverity.Info}}function kt(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:bt(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var xt=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doComplete(t.toString(),k(n))).then(o=>{if(!o)return;const s=e.getWordUntilPosition(n),u=new c.Range(n.lineNumber,s.startColumn,n.lineNumber,s.endColumn),f=o.items.map(d=>{const g={label:d.label,insertText:d.insertText||d.label,sortText:d.sortText,filterText:d.filterText,documentation:d.documentation,detail:d.detail,command:Lt(d.command),range:u,kind:Et(d.kind)};return d.textEdit&&(It(d.textEdit)?g.range={insert:m(d.textEdit.insert),replace:m(d.textEdit.replace)}:g.range=m(d.textEdit.range),g.insertText=d.textEdit.newText),d.additionalTextEdits&&(g.additionalTextEdits=d.additionalTextEdits.map(D)),d.insertTextFormat===Q.Snippet&&(g.insertTextRules=c.languages.CompletionItemInsertTextRule.InsertAsSnippet),g});return{isIncomplete:o.isIncomplete,suggestions:f}})}};function k(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function Je(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function m(e){if(e)return new c.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function It(e){return typeof e.insert<"u"&&typeof e.replace<"u"}function Et(e){const n=c.languages.CompletionItemKind;switch(e){case v.Text:return n.Text;case v.Method:return n.Method;case v.Function:return n.Function;case v.Constructor:return n.Constructor;case v.Field:return n.Field;case v.Variable:return n.Variable;case v.Class:return n.Class;case v.Interface:return n.Interface;case v.Module:return n.Module;case v.Property:return n.Property;case v.Unit:return n.Unit;case v.Value:return n.Value;case v.Enum:return n.Enum;case v.Keyword:return n.Keyword;case v.Snippet:return n.Snippet;case v.Color:return n.Color;case v.File:return n.File;case v.Reference:return n.Reference}return n.Property}function D(e){if(e)return{range:m(e.range),text:e.newText}}function Lt(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var Te=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),k(n))).then(t=>{if(t)return{range:m(t.range),contents:Rt(t.contents)}})}};function At(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function qe(e){return typeof e=="string"?{value:e}:At(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+` +`+e.value+"\n```\n"}}function Rt(e){if(e)return Array.isArray(e)?e.map(qe):[qe(e)]}var Ye=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),k(n))).then(t=>{if(t)return t.map(o=>({range:m(o.range),kind:Pt(o.kind)}))})}};function Pt(e){switch(e){case R.Read:return c.languages.DocumentHighlightKind.Read;case R.Write:return c.languages.DocumentHighlightKind.Write;case R.Text:return c.languages.DocumentHighlightKind.Text}return c.languages.DocumentHighlightKind.Text}var jt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),k(n))).then(t=>{if(t)return[Ze(t)]})}};function Ze(e){return{uri:c.Uri.parse(e.uri),range:m(e.range)}}var Nt=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.findReferences(t.toString(),k(n))).then(o=>{if(o)return o.map(Ze)})}},Ke=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.doRename(t.toString(),k(n),i)).then(o=>Dt(o))}};function Dt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=c.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:m(t.range),text:t.newText}})}return{edits:n}}var et=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Mt(t)?tt(t):{name:t.name,detail:"",containerName:t.containerName,kind:rt(t.kind),range:m(t.location.range),selectionRange:m(t.location.range),tags:[]})})}};function Mt(e){return"children"in e}function tt(e){return{name:e.name,detail:e.detail??"",kind:rt(e.kind),range:m(e.range),selectionRange:m(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>tt(n))}}function rt(e){let n=c.languages.SymbolKind;switch(e){case p.File:return n.File;case p.Module:return n.Module;case p.Namespace:return n.Namespace;case p.Package:return n.Package;case p.Class:return n.Class;case p.Method:return n.Method;case p.Property:return n.Property;case p.Field:return n.Field;case p.Constructor:return n.Constructor;case p.Enum:return n.Enum;case p.Interface:return n.Interface;case p.Function:return n.Function;case p.Variable:return n.Variable;case p.Constant:return n.Constant;case p.String:return n.String;case p.Number:return n.Number;case p.Boolean:return n.Boolean;case p.Array:return n.Array}return n.Function}var nt=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:m(t.range),url:t.target}))}})}},it=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,at(n)).then(o=>{if(!(!o||o.length===0))return o.map(D)}))}},ot=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(o=>o.format(t.toString(),Je(n),at(i)).then(s=>{if(!(!s||s.length===0))return s.map(D)}))}};function at(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var St=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:m(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Je(n.range))).then(t=>{if(t)return t.map(o=>{let s={label:o.label};return o.textEdit&&(s.textEdit=D(o.textEdit)),o.additionalTextEdits&&(s.additionalTextEdits=o.additionalTextEdits.map(D)),s})})}},st=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(o=>{const s={start:o.startLine+1,end:o.endLine+1};return typeof o.kind<"u"&&(s.kind=Ct(o.kind)),s})})}};function Ct(e){switch(e){case A.Comment:return c.languages.FoldingRangeKind.Comment;case A.Imports:return c.languages.FoldingRangeKind.Imports;case A.Region:return c.languages.FoldingRangeKind.Region}}var ut=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(k))).then(t=>{if(t)return t.map(o=>{const s=[];for(;o;)s.push({range:m(o.range)}),o=o.parent;return s})})}},ct=class extends xt{constructor(e){super(e,[".",":","<",'"',"=","/"])}};function Ot(e){const n=new Ge(e),i=(...t)=>n.getLanguageServiceWorker(...t);let r=e.languageId;c.languages.registerCompletionItemProvider(r,new ct(i)),c.languages.registerHoverProvider(r,new Te(i)),c.languages.registerDocumentHighlightProvider(r,new Ye(i)),c.languages.registerLinkProvider(r,new nt(i)),c.languages.registerFoldingRangeProvider(r,new st(i)),c.languages.registerDocumentSymbolProvider(r,new et(i)),c.languages.registerSelectionRangeProvider(r,new ut(i)),c.languages.registerRenameProvider(r,new Ke(i)),r==="html"&&(c.languages.registerDocumentFormattingEditProvider(r,new it(i)),c.languages.registerDocumentRangeFormattingEditProvider(r,new ot(i)))}function Ut(e){const n=[],i=[],r=new Ge(e);n.push(r);const t=(...s)=>r.getLanguageServiceWorker(...s);function o(){const{languageId:s,modeConfiguration:u}=e;dt(i),u.completionItems&&i.push(c.languages.registerCompletionItemProvider(s,new ct(t))),u.hovers&&i.push(c.languages.registerHoverProvider(s,new Te(t))),u.documentHighlights&&i.push(c.languages.registerDocumentHighlightProvider(s,new Ye(t))),u.links&&i.push(c.languages.registerLinkProvider(s,new nt(t))),u.documentSymbols&&i.push(c.languages.registerDocumentSymbolProvider(s,new et(t))),u.rename&&i.push(c.languages.registerRenameProvider(s,new Ke(t))),u.foldingRanges&&i.push(c.languages.registerFoldingRangeProvider(s,new st(t))),u.selectionRanges&&i.push(c.languages.registerSelectionRangeProvider(s,new ut(t))),u.documentFormattingEdits&&i.push(c.languages.registerDocumentFormattingEditProvider(s,new it(t))),u.documentRangeFormattingEdits&&i.push(c.languages.registerDocumentRangeFormattingEditProvider(s,new ot(t)))}return o(),n.push(Qe(i)),Qe(n)}function Qe(e){return{dispose:()=>dt(e)}}function dt(e){for(;e.length;)e.pop().dispose()}export{xt as CompletionAdapter,jt as DefinitionAdapter,yt as DiagnosticsAdapter,St as DocumentColorAdapter,it as DocumentFormattingEditProvider,Ye as DocumentHighlightAdapter,nt as DocumentLinkAdapter,ot as DocumentRangeFormattingEditProvider,et as DocumentSymbolAdapter,st as FoldingRangeAdapter,Te as HoverAdapter,Nt as ReferenceAdapter,Ke as RenameAdapter,ut as SelectionRangeAdapter,Ge as WorkerManager,k as fromPosition,Je as fromRange,Ut as setupMode,Ot as setupMode1,m as toRange,D as toTextEdit}; diff --git a/assets/index-79748880.css b/assets/index-79748880.css new file mode 100644 index 0000000..62b3a53 --- /dev/null +++ b/assets/index-79748880.css @@ -0,0 +1 @@ +.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-editor,.monaco-diff-editor .synthetic-focus,.monaco-diff-editor [tabindex="0"]:focus,.monaco-diff-editor [tabindex="-1"]:focus,.monaco-diff-editor button:focus,.monaco-diff-editor input[type=button]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-diff-editor select:focus,.monaco-diff-editor textarea:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-workbench .workbench-hover{position:relative;font-size:13px;line-height:19px;z-index:40;overflow:hidden;max-width:700px;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow)}.monaco-workbench .workbench-hover hr{border-bottom:none}.monaco-workbench .workbench-hover:not(.skip-fade-in){animation:fadein .1s linear}.monaco-workbench .workbench-hover.compact{font-size:12px}.monaco-workbench .workbench-hover.compact .hover-contents{padding:2px 8px}.monaco-workbench .workbench-hover-container.locked .workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .workbench-hover-container.locked .workbench-hover:focus,.monaco-workbench .workbench-hover-lock:focus{outline:1px solid var(--vscode-focusBorder)}.monaco-workbench .workbench-hover-container.locked .workbench-hover-lock:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-workbench .workbench-hover-pointer{position:absolute;z-index:41;pointer-events:none}.monaco-workbench .workbench-hover-pointer:after{content:"";position:absolute;width:5px;height:5px;background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-workbench .locked .workbench-hover-pointer:after{width:4px;height:4px;border-right-width:2px;border-bottom-width:2px}.monaco-workbench .workbench-hover-pointer.left{left:-3px}.monaco-workbench .workbench-hover-pointer.right{right:3px}.monaco-workbench .workbench-hover-pointer.top{top:-3px}.monaco-workbench .workbench-hover-pointer.bottom{bottom:3px}.monaco-workbench .workbench-hover-pointer.left:after{transform:rotate(135deg)}.monaco-workbench .workbench-hover-pointer.right:after{transform:rotate(315deg)}.monaco-workbench .workbench-hover-pointer.top:after{transform:rotate(225deg)}.monaco-workbench .workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-workbench .workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-workbench .workbench-hover a:focus{outline:1px solid;outline-offset:-1px;text-decoration:underline;outline-color:var(--vscode-focusBorder)}.monaco-workbench .workbench-hover a:hover,.monaco-workbench .workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-workbench .workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-workbench .workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-workbench .workbench-hover.right-aligned{left:1px}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-workbench .workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-right:0;margin-left:16px}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:rgba(0,0,0,0);transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-hover{cursor:default;position:absolute;overflow:hidden;user-select:text;-webkit-user-select:text;box-sizing:border-box;animation:fadein .1s linear;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{margin-bottom:4px;display:inline-block}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.monaco-aria-container{position:absolute;left:-999em}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:5px}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:before,.monaco-action-bar .action-item.disabled .action-label:hover{color:var(--vscode-disabledForeground)}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:#bbb}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{color:var(--vscode-descriptionForeground);overflow:hidden;border-radius:2px}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-action-bar .checkbox-action-item{display:flex;align-items:center;border-radius:2px;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;margin-left:-300px;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{display:flex;align-items:center;border-top-right-radius:5px;border-top-left-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-inline-action-bar{margin:2px 0 0 5px}.quick-input-title{padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{display:flex;padding:8px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{font-weight:700;background-color:unset;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex;align-items:center}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:rgba(255,255,255,.44)}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:rgba(255,255,255,.44)}99%{background:transparent}}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:cyan}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-tl-indent>.indent-guide{transition:border-color .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-grab{display:flex!important;align-items:center;justify-content:center;cursor:grab;margin-right:2px}.monaco-tree-type-filter-grab.grabbing{cursor:grabbing}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{position:absolute;top:0;left:0;width:100%;height:0;z-index:13;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{position:absolute;width:100%;opacity:1!important;overflow:hidden;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{background-color:var(--vscode-list-hoverBackground)!important;cursor:pointer}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{position:absolute;bottom:-3px;left:0;height:0px;width:100%}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{outline:none}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-iconpath{width:16px;height:16px;padding-left:2px;margin-top:2px;display:flex}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background);overflow-wrap:initial}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .margin-view-overlays .line-numbers{bottom:0;font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-mouse-cursor-text{cursor:text}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box;height:100%}.mtkcontrol{color:#fff!important;background:rgb(150,0,0)!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{top:0;bottom:0;position:absolute}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:white}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow)}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:rgba(255,255,255,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:rgba(0,0,0,0)}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:rgba(171,171,171,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{position:relative;overflow:hidden;flex-shrink:0;flex-grow:0}.monaco-diff-editor .gutter>div{position:absolute}.monaco-diff-editor .gutter .gutterItem{opacity:0;transition:opacity .7s}.monaco-diff-editor .gutter .gutterItem.showAlways{opacity:1;transition:none}.monaco-diff-editor .gutter .gutterItem.noTransition{transition:none}.monaco-diff-editor .gutter:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.monaco-diff-editor .gutter .gutterItem .background{position:absolute;height:100%;left:50%;width:1px;border-left:2px var(--vscode-menu-border) solid}.monaco-diff-editor .gutter .gutterItem .buttons{position:absolute;width:100%;display:flex;justify-content:center;align-items:center}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar{height:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar{line-height:1}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container{width:fit-content;border-radius:4px;background:var(--vscode-editorGutter-commentRangeForeground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item .action-label{padding:1px 2px}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px}.monaco-diff-editor .diff-hidden-lines-compact .line-left,.monaco-diff-editor .diff-hidden-lines-compact .line-right{height:1px;border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;margin:auto;width:100%}.monaco-diff-editor .diff-hidden-lines-compact .line-left{width:20px}.monaco-diff-editor .diff-hidden-lines-compact .text{color:var(--vscode-editorCodeLens-foreground);text-wrap:nowrap;font-size:11px;line-height:11px;margin:0 4px}.monaco-component.diff-review{user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-component.diff-review .revertButton{cursor:pointer}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);position:relative;height:100%;width:100%;overflow-y:hidden}.monaco-component.multiDiffEditor>div{position:absolute;top:0;left:0;height:100%;width:100%}.monaco-component.multiDiffEditor>div.placeholder{visibility:hidden;display:grid;place-items:center;place-content:center}.monaco-component.multiDiffEditor>div.placeholder.visible{visibility:visible}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border: var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{display:flex;flex-direction:column;flex:1;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{margin:0 5px;cursor:pointer;a {display: block;}}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{margin:8px 0 0;padding:4px 5px;border-top:1px solid var(--vscode-multiDiffEditor-border);display:flex;align-items:center;color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{display:flex;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{flex:1;min-width:0;text-overflow:ellipsis}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{font-weight:600;opacity:.75;margin:0 10px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{flex:1;display:flex;flex-direction:column;border-bottom:1px solid var(--vscode-multiDiffEditor-border);overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{display:inline-block;width:1em;height:1em}.inline-progress-widget{display:flex!important;justify-content:center;align-items:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{font-size:90%!important;animation:none}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border, transparent);border-radius:4px;background-color:var(--vscode-editorWidget-background);overflow:hidden}.post-edit-widget .monaco-button{padding:2px;border:none;border-radius:0}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-secondaryHoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(/assets/codicon-0f1d5219.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{display:block;cursor:pointer}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.action-widget{font-size:13px;min-width:160px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-editorWidget-border)!important;border-radius:5px;background-color:var(--vscode-editorActionList-background);color:var(--vscode-editorActionList-foreground);padding:4px;box-shadow:0 2px 8px var(--vscode-widget-shadow)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 10px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%;border-radius:4px}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-editorActionList-focusBackground)!important;color:var(--vscode-editorActionList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600;font-size:12px}.action-widget .monaco-list-row.group-header:not(:first-of-type){margin-top:2px}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:8px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow)}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorActionList-background);border-top:1px solid var(--vscode-editorHoverWidget-border);margin-top:2px}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:3px 8px 0}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault)}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{user-select:none;-webkit-user-select:none;white-space:nowrap;vertical-align:sub}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon{vertical-align:middle;color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize)}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0;visibility:visible}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.colorpicker-widget{height:190px;user-select:none;-webkit-user-select:none}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{border:solid .1em #000;box-sizing:border-box;margin:.1em .2em 0;width:.8em;height:.8em;line-height:.8em;display:inline-block;cursor:pointer}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:solid .1em #eee}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-header .picked-color{width:240px;display:flex;align-items:center;justify-content:center;line-height:24px;cursor:pointer;color:#fff;flex:1;white-space:nowrap;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{width:100%;height:100%;text-align:center}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid rgb(255,255,255);border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:grab;background:linear-gradient(to bottom,#ff0000 0%,#ffff00 17%,#00ff00 33%,#00ffff 50%,#0000ff 67%,#ff00ff 83%,#ff0000 100%)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid rgba(255,255,255,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.colorpicker-body .standalone-strip .standalone-overlay{height:122px;pointer-events:none}.standalone-colorpicker-body{display:block;border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);overflow:hidden}.colorpicker-body .insert-button{position:absolute;height:20px;width:58px;padding:0;right:8px;bottom:8px;background:var(--vscode-button-background);color:var(--vscode-button-foreground);border-radius:2px;border:none;cursor:pointer}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover-content{padding-right:2px;padding-bottom:2px;box-sizing:border-box}.monaco-editor .monaco-hover{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row .hover-row-contents{min-width:0;display:flex;flex-direction:column}.monaco-editor .monaco-hover .hover-row .verbosity-actions{display:flex;flex-direction:column;padding-left:5px;padding-right:5px;justify-content:end;border-right:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{border-right:2px dotted black;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #AEAFAD;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:var(--vscode-editorWidget-background)}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);padding:1px;box-sizing:border-box}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{left:0!important;background-color:var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border))}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:var(--vscode-editor-foldPlaceholderForeground);margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{color:var(--vscode-editorGhostText-foreground)!important;background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .snippet-placeholder{min-width:2px;outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetTabstopHighlightBorder, transparent)}.monaco-editor .finish-snippet-placeholder{outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent)}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column;border-radius:3px}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{flex:0 1 auto;width:100%;border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background)}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid var(--vscode-editorSuggestWidget-border);overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{user-select:none;-webkit-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default;color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-details.focused{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 12px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:initial;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.preferences-editor .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info,.preferences-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .inline-edit-remove{background-color:var(--vscode-editorGhostText-background);font-style:italic}.monaco-editor .inline-edit-hidden{opacity:0;font-size:0}.monaco-editor .inline-edit-decoration,.monaco-editor .suggest-preview-text .inline-edit{font-style:italic}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .inline-edit-decoration,.monaco-editor .inline-edit-decoration-preview,.monaco-editor .suggest-preview-text .inline-edit{color:var(--vscode-editorGhostText-foreground)!important;background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .inlineEditHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineEditHints a,.monaco-editor .inlineEditHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineEditHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineEditHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineEditStatusBarItemLabel{margin-right:2px}.monaco-editor .inlineEditSideBySide{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);white-space:pre}.monaco-editor div.inline-edits-widget{--widget-color: var(--vscode-notifications-background);svg {.gradient-start {stop-color: var(--vscode-editor-background);} .gradient-stop {stop-color: var(--widget-color);}}}.monaco-editor div.inline-edits-widget .promptEditor .monaco-editor{--vscode-editor-placeholder-foreground: var(--vscode-editorGhostText-foreground)}.monaco-editor div.inline-edits-widget .toolbar,.monaco-editor div.inline-edits-widget .promptEditor{opacity:0;transition:opacity .2s ease-in-out}.monaco-editor div.inline-edits-widget:hover .toolbar,.monaco-editor div.inline-edits-widget:hover .promptEditor,.monaco-editor div.inline-edits-widget.focused .toolbar,.monaco-editor div.inline-edits-widget.focused .promptEditor{opacity:1}.monaco-editor div.inline-edits-widget .preview .monaco-editor{--vscode-editor-background: var(--widget-color)}.monaco-editor div.inline-edits-widget .preview .monaco-editor .mtk1{color:var(--vscode-editorGhostText-foreground)}.monaco-editor div.inline-edits-widget .preview .monaco-editor .view-overlays .current-line-exact,.monaco-editor div.inline-edits-widget .preview .monaco-editor .current-line-margin{border:none}.monaco-editor .parameter-hints-widget{z-index:39;display:flex;flex-direction:column;line-height:1.5em;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:"";display:block;height:100%;position:absolute;opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:"";display:block;position:absolute;left:0;width:100%;padding-top:4px;opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);border-radius:3px;padding:0 .4em;background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor{--vscode-editor-placeholder-foreground: var(--vscode-editorGhostText-foreground)}.monaco-editor .editorPlaceholder{top:0;position:absolute;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap;pointer-events:none;color:var(--vscode-editor-placeholder-foreground)}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{padding:3px;border-radius:2px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{display:flex;align-items:center;padding:3px;background-color:transparent;border:none;border-radius:5px;cursor:pointer}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .sticky-widget{overflow:hidden}.monaco-editor .sticky-widget-line-numbers{float:left;background-color:inherit}.monaco-editor .sticky-widget-lines-scrollable{display:inline-block;position:absolute;overflow:hidden;width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit}.monaco-editor .sticky-widget-lines{position:absolute;background-color:inherit}.monaco-editor .sticky-line-number,.monaco-editor .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;display:inline-block;position:absolute;background-color:inherit}.monaco-editor .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition)}.monaco-editor .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-line-number-inner{display:inline-block;text-align:right}.monaco-editor .sticky-widget{border-bottom:1px solid var(--vscode-editorStickyScroll-border)}.monaco-editor .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor .sticky-widget{width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;z-index:4;background-color:var(--vscode-editorStickyScroll-background);right:initial!important}.monaco-editor .sticky-widget.peek{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;width:100%;font-size:12px;display:flex;overflow:visible;height:26px;background:var(--vscode-banner-background)}.editor-banner .icon-container{display:flex;flex-shrink:0;align-items:center;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-repeat:no-repeat;background-position:center center;background-size:16px;width:16px;padding:0;margin:0 6px 0 10px}.editor-banner .message-container{display:flex;align-items:center;line-height:26px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.editor-banner .message-container p{margin-block-start:0;margin-block-end:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{padding:3px;margin-left:12px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #F6F6F6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;user-select:text;-webkit-user-select:text;padding:10px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{height:1px;border:0;background-color:var(--vscode-editorHoverWidget-border)}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)} diff --git a/assets/index-9dfb078d.js b/assets/index-9dfb078d.js new file mode 100644 index 0000000..9d3634a --- /dev/null +++ b/assets/index-9dfb078d.js @@ -0,0 +1,1269 @@ +var bA=Object.defineProperty;var vA=(n,e,t)=>e in n?bA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ii=(n,e,t)=>(vA(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function makeMap$1(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const EMPTY_OBJ$1={},EMPTY_ARR=[],NOOP$1=()=>{},NO$1=()=>!1,isOn$1=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),isModelListener=n=>n.startsWith("onUpdate:"),extend$1=Object.assign,remove=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},hasOwnProperty$7=Object.prototype.hasOwnProperty,hasOwn$1=(n,e)=>hasOwnProperty$7.call(n,e),isArray$4=Array.isArray,isMap$1=n=>toTypeString$1(n)==="[object Map]",isSet$1=n=>toTypeString$1(n)==="[object Set]",isDate$1=n=>toTypeString$1(n)==="[object Date]",isRegExp$1=n=>toTypeString$1(n)==="[object RegExp]",isFunction$3=n=>typeof n=="function",isString$4=n=>typeof n=="string",isSymbol=n=>typeof n=="symbol",isObject$3=n=>n!==null&&typeof n=="object",isPromise=n=>(isObject$3(n)||isFunction$3(n))&&isFunction$3(n.then)&&isFunction$3(n.catch),objectToString$2=Object.prototype.toString,toTypeString$1=n=>objectToString$2.call(n),toRawType=n=>toTypeString$1(n).slice(8,-1),isPlainObject$1=n=>toTypeString$1(n)==="[object Object]",isIntegerKey=n=>isString$4(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,isReservedProp$1=makeMap$1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),isBuiltInDirective$1=makeMap$1("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),cacheStringFunction$1=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},camelizeRE$1=/-(\w)/g,camelize$1=cacheStringFunction$1(n=>n.replace(camelizeRE$1,(e,t)=>t?t.toUpperCase():"")),hyphenateRE$1=/\B([A-Z])/g,hyphenate$1=cacheStringFunction$1(n=>n.replace(hyphenateRE$1,"-$1").toLowerCase()),capitalize$1=cacheStringFunction$1(n=>n.charAt(0).toUpperCase()+n.slice(1)),toHandlerKey$1=cacheStringFunction$1(n=>n?`on${capitalize$1(n)}`:""),hasChanged=(n,e)=>!Object.is(n,e),invokeArrayFns=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},looseToNumber=n=>{const e=parseFloat(n);return isNaN(e)?n:e},toNumber=n=>{const e=isString$4(n)?Number(n):NaN;return isNaN(e)?n:e};let _globalThis;const getGlobalThis=()=>_globalThis||(_globalThis=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function genCacheKey$1(n,e){return n+JSON.stringify(e,(t,i)=>typeof i=="function"?i.toString():i)}const GLOBALS_ALLOWED$1="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",isGloballyAllowed$1=makeMap$1(GLOBALS_ALLOWED$1);function normalizeStyle$1(n){if(isArray$4(n)){const e={};for(let t=0;t{if(t){const i=t.split(propertyDelimiterRE$1);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function normalizeClass$1(n){let e="";if(isString$4(n))e=n;else if(isArray$4(n))for(let t=0;tlooseEqual(t,e))}const isRef$2=n=>!!(n&&n.__v_isRef===!0),toDisplayString$1=n=>isString$4(n)?n:n==null?"":isArray$4(n)||isObject$3(n)&&(n.toString===objectToString$2||!isFunction$3(n.toString))?isRef$2(n)?toDisplayString$1(n.value):JSON.stringify(n,replacer$2,2):String(n),replacer$2=(n,e)=>isRef$2(e)?replacer$2(n,e.value):isMap$1(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[stringifySymbol$1(i,r)+" =>"]=s,t),{})}:isSet$1(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>stringifySymbol$1(t))}:isSymbol(e)?stringifySymbol$1(e):isObject$3(e)&&!isArray$4(e)&&!isPlainObject$1(e)?String(e):e,stringifySymbol$1=(n,e="")=>{var t;return isSymbol(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let activeEffectScope;class EffectScope{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=activeEffectScope,!e&&activeEffectScope&&(this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(batchedComputed){let e=batchedComputed;for(batchedComputed=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;batchedSub;){let e=batchedSub;for(batchedSub=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function prepareDeps(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cleanupDeps(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),removeSub(i),removeDep(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function isDirty(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(refreshComputed(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function refreshComputed(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===globalVersion))return;n.globalVersion=globalVersion;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!isDirty(n)){n.flags&=-3;return}const t=activeSub,i=shouldTrack;activeSub=n,shouldTrack=!0;try{prepareDeps(n);const s=n.fn(n._value);(e.version===0||hasChanged(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{activeSub=t,shouldTrack=i,cleanupDeps(n),n.flags&=-3}}function removeSub(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)removeSub(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function removeDep(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}function effect(n,e){n.effect instanceof ReactiveEffect&&(n=n.effect.fn);const t=new ReactiveEffect(n);e&&extend$1(t,e);try{t.run()}catch(s){throw t.stop(),s}const i=t.run.bind(t);return i.effect=t,i}function stop(n){n.effect.stop()}let shouldTrack=!0;const trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function resetTracking(){const n=trackStack.pop();shouldTrack=n===void 0?!0:n}function cleanupEffect(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=activeSub;activeSub=void 0;try{e()}finally{activeSub=t}}}let globalVersion=0,Link$2=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Dep{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!activeSub||!shouldTrack||activeSub===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==activeSub)t=this.activeLink=new Link$2(activeSub,this),activeSub.deps?(t.prevDep=activeSub.depsTail,activeSub.depsTail.nextDep=t,activeSub.depsTail=t):activeSub.deps=activeSub.depsTail=t,addSub(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=activeSub.depsTail,t.nextDep=void 0,activeSub.depsTail.nextDep=t,activeSub.depsTail=t,activeSub.deps===t&&(activeSub.deps=i)}return t}trigger(e){this.version++,globalVersion++,this.notify(e)}notify(e){startBatch();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{endBatch()}}}function addSub(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)addSub(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const targetMap=new WeakMap,ITERATE_KEY=Symbol(""),MAP_KEY_ITERATE_KEY=Symbol(""),ARRAY_ITERATE_KEY=Symbol("");function track(n,e,t){if(shouldTrack&&activeSub){let i=targetMap.get(n);i||targetMap.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new Dep),s.map=i,s.key=t),s.track()}}function trigger(n,e,t,i,s,r){const o=targetMap.get(n);if(!o){globalVersion++;return}const a=l=>{l&&l.trigger()};if(startBatch(),e==="clear")o.forEach(a);else{const l=isArray$4(n),c=l&&isIntegerKey(t);if(l&&t==="length"){const d=Number(i);o.forEach((u,f)=>{(f==="length"||f===ARRAY_ITERATE_KEY||!isSymbol(f)&&f>=d)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(ARRAY_ITERATE_KEY)),e){case"add":l?c&&a(o.get("length")):(a(o.get(ITERATE_KEY)),isMap$1(n)&&a(o.get(MAP_KEY_ITERATE_KEY)));break;case"delete":l||(a(o.get(ITERATE_KEY)),isMap$1(n)&&a(o.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap$1(n)&&a(o.get(ITERATE_KEY));break}}endBatch()}function getDepFromReactive(n,e){const t=targetMap.get(n);return t&&t.get(e)}function reactiveReadArray(n){const e=toRaw(n);return e===n?e:(track(e,"iterate",ARRAY_ITERATE_KEY),isShallow(n)?e:e.map(toReactive))}function shallowReadArray(n){return track(n=toRaw(n),"iterate",ARRAY_ITERATE_KEY),n}const arrayInstrumentations={__proto__:null,[Symbol.iterator](){return iterator(this,Symbol.iterator,toReactive)},concat(...n){return reactiveReadArray(this).concat(...n.map(e=>isArray$4(e)?reactiveReadArray(e):e))},entries(){return iterator(this,"entries",n=>(n[1]=toReactive(n[1]),n))},every(n,e){return apply$1(this,"every",n,e,void 0,arguments)},filter(n,e){return apply$1(this,"filter",n,e,t=>t.map(toReactive),arguments)},find(n,e){return apply$1(this,"find",n,e,toReactive,arguments)},findIndex(n,e){return apply$1(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return apply$1(this,"findLast",n,e,toReactive,arguments)},findLastIndex(n,e){return apply$1(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return apply$1(this,"forEach",n,e,void 0,arguments)},includes(...n){return searchProxy(this,"includes",n)},indexOf(...n){return searchProxy(this,"indexOf",n)},join(n){return reactiveReadArray(this).join(n)},lastIndexOf(...n){return searchProxy(this,"lastIndexOf",n)},map(n,e){return apply$1(this,"map",n,e,void 0,arguments)},pop(){return noTracking(this,"pop")},push(...n){return noTracking(this,"push",n)},reduce(n,...e){return reduce(this,"reduce",n,e)},reduceRight(n,...e){return reduce(this,"reduceRight",n,e)},shift(){return noTracking(this,"shift")},some(n,e){return apply$1(this,"some",n,e,void 0,arguments)},splice(...n){return noTracking(this,"splice",n)},toReversed(){return reactiveReadArray(this).toReversed()},toSorted(n){return reactiveReadArray(this).toSorted(n)},toSpliced(...n){return reactiveReadArray(this).toSpliced(...n)},unshift(...n){return noTracking(this,"unshift",n)},values(){return iterator(this,"values",toReactive)}};function iterator(n,e,t){const i=shallowReadArray(n),s=i[e]();return i!==n&&!isShallow(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const arrayProto=Array.prototype;function apply$1(n,e,t,i,s,r){const o=shallowReadArray(n),a=o!==n&&!isShallow(n),l=o[e];if(l!==arrayProto[e]){const u=l.apply(n,r);return a?toReactive(u):u}let c=t;o!==n&&(a?c=function(u,f){return t.call(this,toReactive(u),f,n)}:t.length>2&&(c=function(u,f){return t.call(this,u,f,n)}));const d=l.call(o,c,i);return a&&s?s(d):d}function reduce(n,e,t,i){const s=shallowReadArray(n);let r=t;return s!==n&&(isShallow(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,toReactive(a),l,n)}),s[e](r,...i)}function searchProxy(n,e,t){const i=toRaw(n);track(i,"iterate",ARRAY_ITERATE_KEY);const s=i[e](...t);return(s===-1||s===!1)&&isProxy(t[0])?(t[0]=toRaw(t[0]),i[e](...t)):s}function noTracking(n,e,t=[]){pauseTracking(),startBatch();const i=toRaw(n)[e].apply(n,t);return endBatch(),resetTracking(),i}const isNonTrackableKeys=makeMap$1("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(isSymbol));function hasOwnProperty$6(n){isSymbol(n)||(n=String(n));const e=toRaw(this);return track(e,"has",n),e.hasOwnProperty(n)}class BaseReactiveHandler{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?shallowReadonlyMap:readonlyMap:r?shallowReactiveMap:reactiveMap).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=isArray$4(e);if(!s){let l;if(o&&(l=arrayInstrumentations[t]))return l;if(t==="hasOwnProperty")return hasOwnProperty$6}const a=Reflect.get(e,t,isRef$1(e)?e:i);return(isSymbol(t)?builtInSymbols.has(t):isNonTrackableKeys(t))||(s||track(e,"get",t),r)?a:isRef$1(a)?o&&isIntegerKey(t)?a:a.value:isObject$3(a)?s?readonly(a):reactive(a):a}}class MutableReactiveHandler extends BaseReactiveHandler{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=isReadonly(r);if(!isShallow(i)&&!isReadonly(i)&&(r=toRaw(r),i=toRaw(i)),!isArray$4(e)&&isRef$1(r)&&!isRef$1(i))return l?!1:(r.value=i,!0)}const o=isArray$4(e)&&isIntegerKey(t)?Number(t)n,getProto=n=>Reflect.getPrototypeOf(n);function createIterableMethod(n,e,t){return function(...i){const s=this.__v_raw,r=toRaw(s),o=isMap$1(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),d=t?toShallow:e?toReadonly:toReactive;return!e&&track(r,"iterate",l?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:u,done:f}=c.next();return f?{value:u,done:f}:{value:a?[d(u[0]),d(u[1])]:d(u),done:f}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function createInstrumentations(n,e){const t={get(s){const r=this.__v_raw,o=toRaw(r),a=toRaw(s);n||(hasChanged(s,a)&&track(o,"get",s),track(o,"get",a));const{has:l}=getProto(o),c=e?toShallow:n?toReadonly:toReactive;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&track(toRaw(s),"iterate",ITERATE_KEY),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=toRaw(r),a=toRaw(s);return n||(hasChanged(s,a)&&track(o,"has",s),track(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=toRaw(a),c=e?toShallow:n?toReadonly:toReactive;return!n&&track(l,"iterate",ITERATE_KEY),a.forEach((d,u)=>s.call(r,c(d),c(u),o))}};return extend$1(t,n?{add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear")}:{add(s){!e&&!isShallow(s)&&!isReadonly(s)&&(s=toRaw(s));const r=toRaw(this);return getProto(r).has.call(r,s)||(r.add(s),trigger(r,"add",s,s)),this},set(s,r){!e&&!isShallow(r)&&!isReadonly(r)&&(r=toRaw(r));const o=toRaw(this),{has:a,get:l}=getProto(o);let c=a.call(o,s);c||(s=toRaw(s),c=a.call(o,s));const d=l.call(o,s);return o.set(s,r),c?hasChanged(r,d)&&trigger(o,"set",s,r):trigger(o,"add",s,r),this},delete(s){const r=toRaw(this),{has:o,get:a}=getProto(r);let l=o.call(r,s);l||(s=toRaw(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&trigger(r,"delete",s,void 0),c},clear(){const s=toRaw(this),r=s.size!==0,o=s.clear();return r&&trigger(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=createIterableMethod(s,n,e)}),t}function createInstrumentationGetter(n,e){const t=createInstrumentations(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(hasOwn$1(t,s)&&s in i?t:i,s,r)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},shallowReadonlyCollectionHandlers={get:createInstrumentationGetter(!0,!0)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(n){return n.__v_skip||!Object.isExtensible(n)?0:targetTypeMap(toRawType(n))}function reactive(n){return isReadonly(n)?n:createReactiveObject(n,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(n){return createReactiveObject(n,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(n){return createReactiveObject(n,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function shallowReadonly(n){return createReactiveObject(n,!0,shallowReadonlyHandlers,shallowReadonlyCollectionHandlers,shallowReadonlyMap)}function createReactiveObject(n,e,t,i,s){if(!isObject$3(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=getTargetType(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function isReactive(n){return isReadonly(n)?isReactive(n.__v_raw):!!(n&&n.__v_isReactive)}function isReadonly(n){return!!(n&&n.__v_isReadonly)}function isShallow(n){return!!(n&&n.__v_isShallow)}function isProxy(n){return n?!!n.__v_raw:!1}function toRaw(n){const e=n&&n.__v_raw;return e?toRaw(e):n}function markRaw(n){return!hasOwn$1(n,"__v_skip")&&Object.isExtensible(n)&&def(n,"__v_skip",!0),n}const toReactive=n=>isObject$3(n)?reactive(n):n,toReadonly=n=>isObject$3(n)?readonly(n):n;function isRef$1(n){return n?n.__v_isRef===!0:!1}function ref(n){return createRef(n,!1)}function shallowRef(n){return createRef(n,!0)}function createRef(n,e){return isRef$1(n)?n:new RefImpl(n,e)}class RefImpl{constructor(e,t){this.dep=new Dep,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:toRaw(e),this._value=t?e:toReactive(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||isShallow(e)||isReadonly(e);e=i?e:toRaw(e),hasChanged(e,t)&&(this._rawValue=e,this._value=i?e:toReactive(e),this.dep.trigger())}}function triggerRef(n){n.dep&&n.dep.trigger()}function unref(n){return isRef$1(n)?n.value:n}function toValue(n){return isFunction$3(n)?n():unref(n)}const shallowUnwrapHandlers={get:(n,e,t)=>e==="__v_raw"?n:unref(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return isRef$1(s)&&!isRef$1(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function proxyRefs(n){return isReactive(n)?n:new Proxy(n,shallowUnwrapHandlers)}class CustomRefImpl{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Dep,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function customRef(n){return new CustomRefImpl(n)}function toRefs(n){const e=isArray$4(n)?new Array(n.length):{};for(const t in n)e[t]=propertyToRef(n,t);return e}class ObjectRefImpl{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return getDepFromReactive(toRaw(this._object),this._key)}}class GetterRefImpl{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function toRef(n,e,t){return isRef$1(n)?n:isFunction$3(n)?new GetterRefImpl(n):isObject$3(n)&&arguments.length>1?propertyToRef(n,e,t):ref(n)}function propertyToRef(n,e,t){const i=n[e];return isRef$1(i)?i:new ObjectRefImpl(n,e,t)}class ComputedRefImpl{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Dep(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=globalVersion-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&activeSub!==this)return batch(this,!0),!0}get value(){const e=this.dep.track();return refreshComputed(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function computed$1(n,e,t=!1){let i,s;return isFunction$3(n)?i=n:(i=n.get,s=n.set),new ComputedRefImpl(i,s,t)}const TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},INITIAL_WATCHER_VALUE={},cleanupMap=new WeakMap;let activeWatcher;function getCurrentWatcher(){return activeWatcher}function onWatcherCleanup(n,e=!1,t=activeWatcher){if(t){let i=cleanupMap.get(t);i||cleanupMap.set(t,i=[]),i.push(n)}}function watch$1(n,e,t=EMPTY_OBJ$1){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=L=>s?L:isShallow(L)||s===!1||s===0?traverse(L,1):traverse(L);let d,u,f,g,m=!1,_=!1;if(isRef$1(n)?(u=()=>n.value,m=isShallow(n)):isReactive(n)?(u=()=>c(n),m=!0):isArray$4(n)?(_=!0,m=n.some(L=>isReactive(L)||isShallow(L)),u=()=>n.map(L=>{if(isRef$1(L))return L.value;if(isReactive(L))return c(L);if(isFunction$3(L))return l?l(L,2):L()})):isFunction$3(n)?e?u=l?()=>l(n,2):n:u=()=>{if(f){pauseTracking();try{f()}finally{resetTracking()}}const L=activeWatcher;activeWatcher=d;try{return l?l(n,3,[g]):n(g)}finally{activeWatcher=L}}:u=NOOP$1,e&&s){const L=u,I=s===!0?1/0:s;u=()=>traverse(L(),I)}const v=getCurrentScope(),C=()=>{d.stop(),v&&v.active&&remove(v.effects,d)};if(r&&e){const L=e;e=(...I)=>{L(...I),C()}}let S=_?new Array(n.length).fill(INITIAL_WATCHER_VALUE):INITIAL_WATCHER_VALUE;const w=L=>{if(!(!(d.flags&1)||!d.dirty&&!L))if(e){const I=d.run();if(s||m||(_?I.some((N,R)=>hasChanged(N,S[R])):hasChanged(I,S))){f&&f();const N=activeWatcher;activeWatcher=d;try{const R=[I,S===INITIAL_WATCHER_VALUE?void 0:_&&S[0]===INITIAL_WATCHER_VALUE?[]:S,g];l?l(e,3,R):e(...R),S=I}finally{activeWatcher=N}}}else d.run()};return a&&a(w),d=new ReactiveEffect(u),d.scheduler=o?()=>o(w,!1):w,g=L=>onWatcherCleanup(L,!1,d),f=d.onStop=()=>{const L=cleanupMap.get(d);if(L){if(l)l(L,4);else for(const I of L)I();cleanupMap.delete(d)}},e?i?w(!0):S=d.run():o?o(w.bind(null,!0),!0):d.run(),C.pause=d.pause.bind(d),C.resume=d.resume.bind(d),C.stop=C,C}function traverse(n,e=1/0,t){if(e<=0||!isObject$3(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,isRef$1(n))traverse(n.value,e,t);else if(isArray$4(n))for(let i=0;i{traverse(i,e,t)});else if(isPlainObject$1(n)){for(const i in n)traverse(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&traverse(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const stack$2=[];function pushWarningContext(n){stack$2.push(n)}function popWarningContext(){stack$2.pop()}let isWarning=!1;function warn$1(n,...e){if(isWarning)return;isWarning=!0,pauseTracking();const t=stack$2.length?stack$2[stack$2.length-1].component:null,i=t&&t.appContext.config.warnHandler,s=getComponentTrace();if(i)callWithErrorHandling(i,t,11,[n+e.map(r=>{var o,a;return(a=(o=r.toString)==null?void 0:o.call(r))!=null?a:JSON.stringify(r)}).join(""),t&&t.proxy,s.map(({vnode:r})=>`at <${formatComponentName(t,r.type)}>`).join(` +`),s]);else{const r=[`[Vue warn]: ${n}`,...e];s.length&&r.push(` +`,...formatTrace(s)),console.warn(...r)}resetTracking(),isWarning=!1}function getComponentTrace(){let n=stack$2[stack$2.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const i=n.component&&n.component.parent;n=i&&i.vnode}return e}function formatTrace(n){const e=[];return n.forEach((t,i)=>{e.push(...i===0?[]:[` +`],...formatTraceEntry(t))}),e}function formatTraceEntry({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",i=n.component?n.component.parent==null:!1,s=` at <${formatComponentName(n.component,n.type,i)}`,r=">"+t;return n.props?[s,...formatProps(n.props),r]:[s+r]}function formatProps(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(i=>{e.push(...formatProp(i,n[i]))}),t.length>3&&e.push(" ..."),e}function formatProp(n,e,t){return isString$4(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:isRef$1(e)?(e=formatProp(n,toRaw(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):isFunction$3(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=toRaw(e),t?e:[`${n}=`,e])}function assertNumber(n,e){}const ErrorCodes$1={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},ErrorTypeStrings$1={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function callWithErrorHandling(n,e,t,i){try{return i?n(...i):n()}catch(s){handleError(s,e,t)}}function callWithAsyncErrorHandling(n,e,t,i){if(isFunction$3(n)){const s=callWithErrorHandling(n,e,t,i);return s&&isPromise(s)&&s.catch(r=>{handleError(r,e,t)}),s}if(isArray$4(n)){const s=[];for(let r=0;r>>1,s=queue$1[i],r=getId(s);r=getId(t)?queue$1.push(n):queue$1.splice(findInsertionIndex(e),0,n),n.flags|=1,queueFlush()}}function queueFlush(){currentFlushPromise||(currentFlushPromise=resolvedPromise.then(flushJobs))}function queuePostFlushCb(n){isArray$4(n)?pendingPostFlushCbs.push(...n):activePostFlushCbs&&n.id===-1?activePostFlushCbs.splice(postFlushIndex+1,0,n):n.flags&1||(pendingPostFlushCbs.push(n),n.flags|=1),queueFlush()}function flushPreFlushCbs(n,e,t=flushIndex+1){for(;tgetId(t)-getId(i));if(pendingPostFlushCbs.length=0,activePostFlushCbs){activePostFlushCbs.push(...e);return}for(activePostFlushCbs=e,postFlushIndex=0;postFlushIndexn.id==null?n.flags&2?-1:1/0:n.id;function flushJobs(n){const e=NOOP$1;try{for(flushIndex=0;flushIndexdevtools$1.emit(s,...r)),buffer=[]):typeof window<"u"&&window.HTMLElement&&!((i=(t=window.navigator)==null?void 0:t.userAgent)!=null&&i.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{setDevtoolsHook$1(r,e)}),setTimeout(()=>{devtools$1||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,buffer=[])},3e3)):buffer=[]}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(n){const e=currentRenderingInstance;return currentRenderingInstance=n,currentScopeId=n&&n.type.__scopeId||null,e}function pushScopeId(n){currentScopeId=n}function popScopeId(){currentScopeId=null}const withScopeId=n=>withCtx;function withCtx(n,e=currentRenderingInstance,t){if(!e||n._n)return n;const i=(...s)=>{i._d&&setBlockTracking(-1);const r=setCurrentRenderingInstance(e);let o;try{o=n(...s)}finally{setCurrentRenderingInstance(r),i._d&&setBlockTracking(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function withDirectives(n,e){if(currentRenderingInstance===null)return n;const t=getComponentPublicInstance(currentRenderingInstance),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,isTeleportDisabled=n=>n&&(n.disabled||n.disabled===""),isTeleportDeferred=n=>n&&(n.defer||n.defer===""),isTargetSVG=n=>typeof SVGElement<"u"&&n instanceof SVGElement,isTargetMathML=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,resolveTarget=(n,e)=>{const t=n&&n.to;return isString$4(t)?e?e(t):null:t},TeleportImpl={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:d,pc:u,pbc:f,o:{insert:g,querySelector:m,createText:_,createComment:v}}=c,C=isTeleportDisabled(e.props);let{shapeFlag:S,children:w,dynamicChildren:L}=e;if(n==null){const I=e.el=_(""),N=e.anchor=_("");g(I,t,i),g(N,t,i);const R=(A,F)=>{S&16&&(s&&s.isCE&&(s.ce._teleportTarget=A),d(w,A,F,s,r,o,a,l))},T=()=>{const A=e.target=resolveTarget(e.props,m),F=prepareAnchor(A,e,_,g);A&&(o!=="svg"&&isTargetSVG(A)?o="svg":o!=="mathml"&&isTargetMathML(A)&&(o="mathml"),C||(R(A,F),updateCssVars(e,!1)))};C&&(R(t,N),updateCssVars(e,!0)),isTeleportDeferred(e.props)?queuePostRenderEffect(()=>{T(),e.el.__isMounted=!0},r):T()}else{if(isTeleportDeferred(e.props)&&!n.el.__isMounted){queuePostRenderEffect(()=>{TeleportImpl.process(n,e,t,i,s,r,o,a,l,c),delete n.el.__isMounted},r);return}e.el=n.el,e.targetStart=n.targetStart;const I=e.anchor=n.anchor,N=e.target=n.target,R=e.targetAnchor=n.targetAnchor,T=isTeleportDisabled(n.props),A=T?t:N,F=T?I:R;if(o==="svg"||isTargetSVG(N)?o="svg":(o==="mathml"||isTargetMathML(N))&&(o="mathml"),L?(f(n.dynamicChildren,L,A,s,r,o,a),traverseStaticChildren(n,e,!0)):l||u(n,e,A,F,s,r,o,a,!1),C)T?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):moveTeleport(e,t,I,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const B=e.target=resolveTarget(e.props,m);B&&moveTeleport(e,B,null,c,0)}else T&&moveTeleport(e,N,R,c,1);updateCssVars(e,C)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:d,target:u,props:f}=n;if(u&&(s(c),s(d)),r&&s(l),o&16){const g=r||!isTeleportDisabled(f);for(let m=0;m{n.isMounted=!0}),onBeforeUnmount(()=>{n.isUnmounting=!0}),n}const TransitionHookValidator=[Function,Array],BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},recursiveGetSubtree=n=>{const e=n.subTree;return e.component?recursiveGetSubtree(e.component):e},BaseTransitionImpl={name:"BaseTransition",props:BaseTransitionPropsValidators,setup(n,{slots:e}){const t=getCurrentInstance(),i=useTransitionState();return()=>{const s=e.default&&getTransitionRawChildren(e.default(),!0);if(!s||!s.length)return;const r=findNonCommentChild(s),o=toRaw(n),{mode:a}=o;if(i.isLeaving)return emptyPlaceholder(r);const l=getInnerChild$1(r);if(!l)return emptyPlaceholder(r);let c=resolveTransitionHooks(l,o,i,t,u=>c=u);l.type!==Comment&&setTransitionHooks(l,c);let d=t.subTree&&getInnerChild$1(t.subTree);if(d&&d.type!==Comment&&!isSameVNodeType(l,d)&&recursiveGetSubtree(t).type!==Comment){let u=resolveTransitionHooks(d,o,i,t);if(setTransitionHooks(d,u),a==="out-in"&&l.type!==Comment)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,d=void 0},emptyPlaceholder(r);a==="in-out"&&l.type!==Comment?u.delayLeave=(f,g,m)=>{const _=getLeavingNodesForType(i,d);_[String(d.key)]=d,f[leaveCbKey]=()=>{g(),f[leaveCbKey]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{m(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return r}}};function findNonCommentChild(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Comment){e=t;break}}return e}const BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function resolveTransitionHooks(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:f,onLeave:g,onAfterLeave:m,onLeaveCancelled:_,onBeforeAppear:v,onAppear:C,onAfterAppear:S,onAppearCancelled:w}=e,L=String(n.key),I=getLeavingNodesForType(t,n),N=(A,F)=>{A&&callWithAsyncErrorHandling(A,i,9,F)},R=(A,F)=>{const B=F[1];N(A,F),isArray$4(A)?A.every(W=>W.length<=1)&&B():A.length<=1&&B()},T={mode:o,persisted:a,beforeEnter(A){let F=l;if(!t.isMounted)if(r)F=v||l;else return;A[leaveCbKey]&&A[leaveCbKey](!0);const B=I[L];B&&isSameVNodeType(n,B)&&B.el[leaveCbKey]&&B.el[leaveCbKey](),N(F,[A])},enter(A){let F=c,B=d,W=u;if(!t.isMounted)if(r)F=C||c,B=S||d,W=w||u;else return;let G=!1;const j=A[enterCbKey$1]=K=>{G||(G=!0,K?N(W,[A]):N(B,[A]),T.delayedLeave&&T.delayedLeave(),A[enterCbKey$1]=void 0)};F?R(F,[A,j]):j()},leave(A,F){const B=String(n.key);if(A[enterCbKey$1]&&A[enterCbKey$1](!0),t.isUnmounting)return F();N(f,[A]);let W=!1;const G=A[leaveCbKey]=j=>{W||(W=!0,F(),j?N(_,[A]):N(m,[A]),A[leaveCbKey]=void 0,I[B]===n&&delete I[B])};I[B]=n,g?R(g,[A,G]):G()},clone(A){const F=resolveTransitionHooks(A,e,t,i,s);return s&&s(F),F}};return T}function emptyPlaceholder(n){if(isKeepAlive(n))return n=cloneVNode(n),n.children=null,n}function getInnerChild$1(n){if(!isKeepAlive(n))return isTeleport(n.type)&&n.children?findNonCommentChild(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&isFunction$3(t.default))return t.default()}}function setTransitionHooks(n,e){n.shapeFlag&6&&n.component?(n.transition=e,setTransitionHooks(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function getTransitionRawChildren(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rextend$1({name:n.name},e,{setup:n}))():n}function useId(){const n=getCurrentInstance();return n?(n.appContext.config.idPrefix||"v")+"-"+n.ids[0]+n.ids[1]++:""}function markAsyncBoundary(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function useTemplateRef(n){const e=getCurrentInstance(),t=shallowRef(null);if(e){const s=e.refs===EMPTY_OBJ$1?e.refs={}:e.refs;Object.defineProperty(s,n,{enumerable:!0,get:()=>t.value,set:r=>t.value=r})}return t}function setRef(n,e,t,i,s=!1){if(isArray$4(n)){n.forEach((m,_)=>setRef(m,e&&(isArray$4(e)?e[_]:e),t,i,s));return}if(isAsyncWrapper(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&setRef(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?getComponentPublicInstance(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,d=a.refs===EMPTY_OBJ$1?a.refs={}:a.refs,u=a.setupState,f=toRaw(u),g=u===EMPTY_OBJ$1?()=>!1:m=>hasOwn$1(f,m);if(c!=null&&c!==l&&(isString$4(c)?(d[c]=null,g(c)&&(u[c]=null)):isRef$1(c)&&(c.value=null)),isFunction$3(l))callWithErrorHandling(l,a,12,[o,d]);else{const m=isString$4(l),_=isRef$1(l);if(m||_){const v=()=>{if(n.f){const C=m?g(l)?u[l]:d[l]:l.value;s?isArray$4(C)&&remove(C,r):isArray$4(C)?C.includes(r)||C.push(r):m?(d[l]=[r],g(l)&&(u[l]=d[l])):(l.value=[r],n.k&&(d[n.k]=l.value))}else m?(d[l]=o,g(l)&&(u[l]=o)):_&&(l.value=o,n.k&&(d[n.k]=o))};o?(v.id=-1,queuePostRenderEffect(v,t)):v()}}}let hasLoggedMismatchError=!1;const logMismatchError=()=>{hasLoggedMismatchError||(console.error("Hydration completed but contains mismatches."),hasLoggedMismatchError=!0)},isSVGContainer=n=>n.namespaceURI.includes("svg")&&n.tagName!=="foreignObject",isMathMLContainer=n=>n.namespaceURI.includes("MathML"),getContainerType=n=>{if(n.nodeType===1){if(isSVGContainer(n))return"svg";if(isMathMLContainer(n))return"mathml"}},isComment=n=>n.nodeType===8;function createHydrationFunctions(n){const{mt:e,p:t,o:{patchProp:i,createText:s,nextSibling:r,parentNode:o,remove:a,insert:l,createComment:c}}=n,d=(w,L)=>{if(!L.hasChildNodes()){t(null,w,L),flushPostFlushCbs(),L._vnode=w;return}u(L.firstChild,w,null,null,null),flushPostFlushCbs(),L._vnode=w},u=(w,L,I,N,R,T=!1)=>{T=T||!!L.dynamicChildren;const A=isComment(w)&&w.data==="[",F=()=>_(w,L,I,N,R,A),{type:B,ref:W,shapeFlag:G,patchFlag:j}=L;let K=w.nodeType;L.el=w,j===-2&&(T=!1,L.dynamicChildren=null);let ee=null;switch(B){case Text$1:K!==3?L.children===""?(l(L.el=s(""),o(w),w),ee=w):ee=F():(w.data!==L.children&&(logMismatchError(),w.data=L.children),ee=r(w));break;case Comment:S(w)?(ee=r(w),C(L.el=w.content.firstChild,w,I)):K!==8||A?ee=F():ee=r(w);break;case Static:if(A&&(w=r(w),K=w.nodeType),K===1||K===3){ee=w;const U=!L.children.length;for(let q=0;q{T=T||!!L.dynamicChildren;const{type:A,props:F,patchFlag:B,shapeFlag:W,dirs:G,transition:j}=L,K=A==="input"||A==="option";if(K||B!==-1){G&&invokeDirectiveHook(L,null,I,"created");let ee=!1;if(S(w)){ee=needTransition(null,j)&&I&&I.vnode.props&&I.vnode.props.appear;const q=w.content.firstChild;ee&&j.beforeEnter(q),C(q,w,I),L.el=w=q}if(W&16&&!(F&&(F.innerHTML||F.textContent))){let q=g(w.firstChild,L,w,I,N,R,T);for(;q;){isMismatchAllowed(w,1)||logMismatchError();const Q=q;q=q.nextSibling,a(Q)}}else if(W&8){let q=L.children;q[0]===` +`&&(w.tagName==="PRE"||w.tagName==="TEXTAREA")&&(q=q.slice(1)),w.textContent!==q&&(isMismatchAllowed(w,0)||logMismatchError(),w.textContent=L.children)}if(F){if(K||!T||B&48){const q=w.tagName.includes("-");for(const Q in F)(K&&(Q.endsWith("value")||Q==="indeterminate")||isOn$1(Q)&&!isReservedProp$1(Q)||Q[0]==="."||q)&&i(w,Q,null,F[Q],void 0,I)}else if(F.onClick)i(w,"onClick",null,F.onClick,void 0,I);else if(B&4&&isReactive(F.style))for(const q in F.style)F.style[q]}let U;(U=F&&F.onVnodeBeforeMount)&&invokeVNodeHook(U,I,L),G&&invokeDirectiveHook(L,null,I,"beforeMount"),((U=F&&F.onVnodeMounted)||G||ee)&&queueEffectWithSuspense(()=>{U&&invokeVNodeHook(U,I,L),ee&&j.enter(w),G&&invokeDirectiveHook(L,null,I,"mounted")},N)}return w.nextSibling},g=(w,L,I,N,R,T,A)=>{A=A||!!L.dynamicChildren;const F=L.children,B=F.length;for(let W=0;W{const{slotScopeIds:A}=L;A&&(R=R?R.concat(A):A);const F=o(w),B=g(r(w),L,F,I,N,R,T);return B&&isComment(B)&&B.data==="]"?r(L.anchor=B):(logMismatchError(),l(L.anchor=c("]"),F,B),B)},_=(w,L,I,N,R,T)=>{if(isMismatchAllowed(w.parentElement,1)||logMismatchError(),L.el=null,T){const B=v(w);for(;;){const W=r(w);if(W&&W!==B)a(W);else break}}const A=r(w),F=o(w);return a(w),t(null,L,F,A,I,N,getContainerType(F),R),I&&(I.vnode.el=L.el,updateHOCHostEl(I,L.el)),A},v=(w,L="[",I="]")=>{let N=0;for(;w;)if(w=r(w),w&&isComment(w)&&(w.data===L&&N++,w.data===I)){if(N===0)return r(w);N--}return w},C=(w,L,I)=>{const N=L.parentNode;N&&N.replaceChild(w,L);let R=I;for(;R;)R.vnode.el===L&&(R.vnode.el=R.subTree.el=w),R=R.parent},S=w=>w.nodeType===1&&w.tagName==="TEMPLATE";return[d,u]}const allowMismatchAttr="data-allow-mismatch",MismatchTypeString={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function isMismatchAllowed(n,e){if(e===0||e===1)for(;n&&!n.hasAttribute(allowMismatchAttr);)n=n.parentElement;const t=n&&n.getAttribute(allowMismatchAttr);if(t==null)return!1;if(t==="")return!0;{const i=t.split(",");return e===0&&i.includes("children")?!0:t.split(",").includes(MismatchTypeString[e])}}const requestIdleCallback=getGlobalThis().requestIdleCallback||(n=>setTimeout(n,1)),cancelIdleCallback=getGlobalThis().cancelIdleCallback||(n=>clearTimeout(n)),hydrateOnIdle=(n=1e4)=>e=>{const t=requestIdleCallback(e,{timeout:n});return()=>cancelIdleCallback(t)};function elementIsVisibleInViewport(n){const{top:e,left:t,bottom:i,right:s}=n.getBoundingClientRect(),{innerHeight:r,innerWidth:o}=window;return(e>0&&e0&&i0&&t0&&s(e,t)=>{const i=new IntersectionObserver(s=>{for(const r of s)if(r.isIntersecting){i.disconnect(),e();break}},n);return t(s=>{if(s instanceof Element){if(elementIsVisibleInViewport(s))return e(),i.disconnect(),!1;i.observe(s)}}),()=>i.disconnect()},hydrateOnMediaQuery=n=>e=>{if(n){const t=matchMedia(n);if(t.matches)e();else return t.addEventListener("change",e,{once:!0}),()=>t.removeEventListener("change",e)}},hydrateOnInteraction=(n=[])=>(e,t)=>{isString$4(n)&&(n=[n]);let i=!1;const s=o=>{i||(i=!0,r(),e(),o.target.dispatchEvent(new o.constructor(o.type,o)))},r=()=>{t(o=>{for(const a of n)o.removeEventListener(a,s)})};return t(o=>{for(const a of n)o.addEventListener(a,s,{once:!0})}),r};function forEachElement(n,e){if(isComment(n)&&n.data==="["){let t=1,i=n.nextSibling;for(;i;){if(i.nodeType===1){if(e(i)===!1)break}else if(isComment(i))if(i.data==="]"){if(--t===0)break}else i.data==="["&&t++;i=i.nextSibling}}else e(n)}const isAsyncWrapper=n=>!!n.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function defineAsyncComponent(n){isFunction$3(n)&&(n={loader:n});const{loader:e,loadingComponent:t,errorComponent:i,delay:s=200,hydrate:r,timeout:o,suspensible:a=!0,onError:l}=n;let c=null,d,u=0;const f=()=>(u++,c=null,g()),g=()=>{let m;return c||(m=c=e().catch(_=>{if(_=_ instanceof Error?_:new Error(String(_)),l)return new Promise((v,C)=>{l(_,()=>v(f()),()=>C(_),u+1)});throw _}).then(_=>m!==c&&c?c:(_&&(_.__esModule||_[Symbol.toStringTag]==="Module")&&(_=_.default),d=_,_)))};return defineComponent({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(m,_,v){const C=r?()=>{const S=r(v,w=>forEachElement(m,w));S&&(_.bum||(_.bum=[])).push(S)}:v;d?C():g().then(()=>!_.isUnmounted&&C())},get __asyncResolved(){return d},setup(){const m=currentInstance;if(markAsyncBoundary(m),d)return()=>createInnerComp(d,m);const _=w=>{c=null,handleError(w,m,13,!i)};if(a&&m.suspense||isInSSRComponentSetup)return g().then(w=>()=>createInnerComp(w,m)).catch(w=>(_(w),()=>i?createVNode(i,{error:w}):null));const v=ref(!1),C=ref(),S=ref(!!s);return s&&setTimeout(()=>{S.value=!1},s),o!=null&&setTimeout(()=>{if(!v.value&&!C.value){const w=new Error(`Async component timed out after ${o}ms.`);_(w),C.value=w}},o),g().then(()=>{v.value=!0,m.parent&&isKeepAlive(m.parent.vnode)&&m.parent.update()}).catch(w=>{_(w),C.value=w}),()=>{if(v.value&&d)return createInnerComp(d,m);if(C.value&&i)return createVNode(i,{error:C.value});if(t&&!S.value)return createVNode(t)}}})}function createInnerComp(n,e){const{ref:t,props:i,children:s,ce:r}=e.vnode,o=createVNode(n,i,s);return o.ref=t,o.ce=r,delete e.vnode.ce,o}const isKeepAlive=n=>n.type.__isKeepAlive,KeepAliveImpl={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(n,{slots:e}){const t=getCurrentInstance(),i=t.ctx;if(!i.renderer)return()=>{const S=e.default&&e.default();return S&&S.length===1?S[0]:S};const s=new Map,r=new Set;let o=null;const a=t.suspense,{renderer:{p:l,m:c,um:d,o:{createElement:u}}}=i,f=u("div");i.activate=(S,w,L,I,N)=>{const R=S.component;c(S,w,L,0,a),l(R.vnode,S,w,L,R,a,I,S.slotScopeIds,N),queuePostRenderEffect(()=>{R.isDeactivated=!1,R.a&&invokeArrayFns(R.a);const T=S.props&&S.props.onVnodeMounted;T&&invokeVNodeHook(T,R.parent,S)},a)},i.deactivate=S=>{const w=S.component;invalidateMount(w.m),invalidateMount(w.a),c(S,f,null,1,a),queuePostRenderEffect(()=>{w.da&&invokeArrayFns(w.da);const L=S.props&&S.props.onVnodeUnmounted;L&&invokeVNodeHook(L,w.parent,S),w.isDeactivated=!0},a)};function g(S){resetShapeFlag(S),d(S,t,a,!0)}function m(S){s.forEach((w,L)=>{const I=getComponentName(w.type);I&&!S(I)&&_(L)})}function _(S){const w=s.get(S);w&&(!o||!isSameVNodeType(w,o))?g(w):o&&resetShapeFlag(o),s.delete(S),r.delete(S)}watch(()=>[n.include,n.exclude],([S,w])=>{S&&m(L=>matches(S,L)),w&&m(L=>!matches(w,L))},{flush:"post",deep:!0});let v=null;const C=()=>{v!=null&&(isSuspense(t.subTree.type)?queuePostRenderEffect(()=>{s.set(v,getInnerChild(t.subTree))},t.subTree.suspense):s.set(v,getInnerChild(t.subTree)))};return onMounted(C),onUpdated(C),onBeforeUnmount(()=>{s.forEach(S=>{const{subTree:w,suspense:L}=t,I=getInnerChild(w);if(S.type===I.type&&S.key===I.key){resetShapeFlag(I);const N=I.component.da;N&&queuePostRenderEffect(N,L);return}g(S)})}),()=>{if(v=null,!e.default)return o=null;const S=e.default(),w=S[0];if(S.length>1)return o=null,S;if(!isVNode(w)||!(w.shapeFlag&4)&&!(w.shapeFlag&128))return o=null,w;let L=getInnerChild(w);if(L.type===Comment)return o=null,L;const I=L.type,N=getComponentName(isAsyncWrapper(L)?L.type.__asyncResolved||{}:I),{include:R,exclude:T,max:A}=n;if(R&&(!N||!matches(R,N))||T&&N&&matches(T,N))return L.shapeFlag&=-257,o=L,w;const F=L.key==null?I:L.key,B=s.get(F);return L.el&&(L=cloneVNode(L),w.shapeFlag&128&&(w.ssContent=L)),v=F,B?(L.el=B.el,L.component=B.component,L.transition&&setTransitionHooks(L,L.transition),L.shapeFlag|=512,r.delete(F),r.add(F)):(r.add(F),A&&r.size>parseInt(A,10)&&_(r.values().next().value)),L.shapeFlag|=256,o=L,isSuspense(w.type)?w:L}}},KeepAlive=KeepAliveImpl;function matches(n,e){return isArray$4(n)?n.some(t=>matches(t,e)):isString$4(n)?n.split(",").includes(e):isRegExp$1(n)?(n.lastIndex=0,n.test(e)):!1}function onActivated(n,e){registerKeepAliveHook(n,"a",e)}function onDeactivated(n,e){registerKeepAliveHook(n,"da",e)}function registerKeepAliveHook(n,e,t=currentInstance){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(injectHook(e,i,t),t){let s=t.parent;for(;s&&s.parent;)isKeepAlive(s.parent.vnode)&&injectToKeepAliveRoot(i,e,t,s),s=s.parent}}function injectToKeepAliveRoot(n,e,t,i){const s=injectHook(e,n,i,!0);onUnmounted(()=>{remove(i[e],s)},t)}function resetShapeFlag(n){n.shapeFlag&=-257,n.shapeFlag&=-513}function getInnerChild(n){return n.shapeFlag&128?n.ssContent:n}function injectHook(n,e,t=currentInstance,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{pauseTracking();const a=setCurrentInstance(t),l=callWithAsyncErrorHandling(e,t,n,o);return a(),resetTracking(),l});return i?s.unshift(r):s.push(r),r}}const createHook=n=>(e,t=currentInstance)=>{(!isInSSRComponentSetup||n==="sp")&&injectHook(n,(...i)=>e(...i),t)},onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(n,e=currentInstance){injectHook("ec",n,e)}const COMPONENTS="components",DIRECTIVES="directives";function resolveComponent(n,e){return resolveAsset(COMPONENTS,n,!0,e)||n}const NULL_DYNAMIC_COMPONENT=Symbol.for("v-ndc");function resolveDynamicComponent(n){return isString$4(n)?resolveAsset(COMPONENTS,n,!1)||n:n||NULL_DYNAMIC_COMPONENT}function resolveDirective(n){return resolveAsset(DIRECTIVES,n)}function resolveAsset(n,e,t=!0,i=!1){const s=currentRenderingInstance||currentInstance;if(s){const r=s.type;if(n===COMPONENTS){const a=getComponentName(r,!1);if(a&&(a===e||a===camelize$1(e)||a===capitalize$1(camelize$1(e))))return r}const o=resolve$2(s[n]||r[n],e)||resolve$2(s.appContext[n],e);return!o&&i?r:o}}function resolve$2(n,e){return n&&(n[e]||n[camelize$1(e)]||n[capitalize$1(camelize$1(e))])}function renderList(n,e,t,i){let s;const r=t&&t[i],o=isArray$4(n);if(o||isString$4(n)){const a=o&&isReactive(n);let l=!1;a&&(l=!isShallow(n),n=shallowReadArray(n)),s=new Array(n.length);for(let c=0,d=n.length;ce(a,l,void 0,r&&r[l]));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;l{const r=i.fn(...s);return r&&(r.key=i.key),r}:i.fn)}return n}function renderSlot(n,e,t={},i,s){if(currentRenderingInstance.ce||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&¤tRenderingInstance.parent.ce)return e!=="default"&&(t.name=e),openBlock(),createBlock$1(Fragment,null,[createVNode("slot",t,i&&i())],64);let r=n[e];r&&r._c&&(r._d=!1),openBlock();const o=r&&ensureValidVNode(r(t)),a=t.key||o&&o.key,l=createBlock$1(Fragment,{key:(a&&!isSymbol(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&n._===1?64:-2);return!s&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function ensureValidVNode(n){return n.some(e=>isVNode(e)?!(e.type===Comment||e.type===Fragment&&!ensureValidVNode(e.children)):!0)?n:null}function toHandlers(n,e){const t={};for(const i in n)t[e&&/[A-Z]/.test(i)?`on:${i}`:toHandlerKey$1(i)]=n[i];return t}const getPublicInstance=n=>n?isStatefulComponent(n)?getComponentPublicInstance(n):getPublicInstance(n.parent):null,publicPropertiesMap=extend$1(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>getPublicInstance(n.parent),$root:n=>getPublicInstance(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>resolveMergedOptions(n),$forceUpdate:n=>n.f||(n.f=()=>{queueJob(n.update)}),$nextTick:n=>n.n||(n.n=nextTick$1.bind(n.proxy)),$watch:n=>instanceWatch.bind(n)}),hasSetupBinding=(n,e)=>n!==EMPTY_OBJ$1&&!n.__isScriptSetup&&hasOwn$1(n,e),PublicInstanceProxyHandlers={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const g=o[e];if(g!==void 0)switch(g){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(hasSetupBinding(i,e))return o[e]=1,i[e];if(s!==EMPTY_OBJ$1&&hasOwn$1(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&hasOwn$1(c,e))return o[e]=3,r[e];if(t!==EMPTY_OBJ$1&&hasOwn$1(t,e))return o[e]=4,t[e];shouldCacheAccess&&(o[e]=0)}}const d=publicPropertiesMap[e];let u,f;if(d)return e==="$attrs"&&track(n.attrs,"get",""),d(n);if((u=a.__cssModules)&&(u=u[e]))return u;if(t!==EMPTY_OBJ$1&&hasOwn$1(t,e))return o[e]=4,t[e];if(f=l.config.globalProperties,hasOwn$1(f,e))return f[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return hasSetupBinding(s,e)?(s[e]=t,!0):i!==EMPTY_OBJ$1&&hasOwn$1(i,e)?(i[e]=t,!0):hasOwn$1(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==EMPTY_OBJ$1&&hasOwn$1(n,o)||hasSetupBinding(e,o)||(a=r[0])&&hasOwn$1(a,o)||hasOwn$1(i,o)||hasOwn$1(publicPropertiesMap,o)||hasOwn$1(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:hasOwn$1(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}},RuntimeCompiledPublicInstanceProxyHandlers=extend$1({},PublicInstanceProxyHandlers,{get(n,e){if(e!==Symbol.unscopables)return PublicInstanceProxyHandlers.get(n,e,n)},has(n,e){return e[0]!=="_"&&!isGloballyAllowed$1(e)}});function defineProps(){return null}function defineEmits(){return null}function defineExpose(n){}function defineOptions(n){}function defineSlots(){return null}function defineModel(){}function withDefaults(n,e){return null}function useSlots(){return getContext().slots}function useAttrs(){return getContext().attrs}function getContext(){const n=getCurrentInstance();return n.setupContext||(n.setupContext=createSetupContext(n))}function normalizePropsOrEmits(n){return isArray$4(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function mergeDefaults(n,e){const t=normalizePropsOrEmits(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?isArray$4(s)||isFunction$3(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function mergeModels(n,e){return!n||!e?n||e:isArray$4(n)&&isArray$4(e)?n.concat(e):extend$1({},normalizePropsOrEmits(n),normalizePropsOrEmits(e))}function createPropsRestProxy(n,e){const t={};for(const i in n)e.includes(i)||Object.defineProperty(t,i,{enumerable:!0,get:()=>n[i]});return t}function withAsyncContext(n){const e=getCurrentInstance();let t=n();return unsetCurrentInstance(),isPromise(t)&&(t=t.catch(i=>{throw setCurrentInstance(e),i})),[t,()=>setCurrentInstance(e)]}let shouldCacheAccess=!0;function applyOptions(n){const e=resolveMergedOptions(n),t=n.proxy,i=n.ctx;shouldCacheAccess=!1,e.beforeCreate&&callHook$1(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:d,beforeMount:u,mounted:f,beforeUpdate:g,updated:m,activated:_,deactivated:v,beforeDestroy:C,beforeUnmount:S,destroyed:w,unmounted:L,render:I,renderTracked:N,renderTriggered:R,errorCaptured:T,serverPrefetch:A,expose:F,inheritAttrs:B,components:W,directives:G,filters:j}=e;if(c&&resolveInjections(c,i,null),o)for(const U in o){const q=o[U];isFunction$3(q)&&(i[U]=q.bind(t))}if(s){const U=s.call(t,t);isObject$3(U)&&(n.data=reactive(U))}if(shouldCacheAccess=!0,r)for(const U in r){const q=r[U],Q=isFunction$3(q)?q.bind(t,t):isFunction$3(q.get)?q.get.bind(t,t):NOOP$1,ce=!isFunction$3(q)&&isFunction$3(q.set)?q.set.bind(t):NOOP$1,ie=computed({get:Q,set:ce});Object.defineProperty(i,U,{enumerable:!0,configurable:!0,get:()=>ie.value,set:Ce=>ie.value=Ce})}if(a)for(const U in a)createWatcher(a[U],i,t,U);if(l){const U=isFunction$3(l)?l.call(t):l;Reflect.ownKeys(U).forEach(q=>{provide(q,U[q])})}d&&callHook$1(d,n,"c");function ee(U,q){isArray$4(q)?q.forEach(Q=>U(Q.bind(t))):q&&U(q.bind(t))}if(ee(onBeforeMount,u),ee(onMounted,f),ee(onBeforeUpdate,g),ee(onUpdated,m),ee(onActivated,_),ee(onDeactivated,v),ee(onErrorCaptured,T),ee(onRenderTracked,N),ee(onRenderTriggered,R),ee(onBeforeUnmount,S),ee(onUnmounted,L),ee(onServerPrefetch,A),isArray$4(F))if(F.length){const U=n.exposed||(n.exposed={});F.forEach(q=>{Object.defineProperty(U,q,{get:()=>t[q],set:Q=>t[q]=Q})})}else n.exposed||(n.exposed={});I&&n.render===NOOP$1&&(n.render=I),B!=null&&(n.inheritAttrs=B),W&&(n.components=W),G&&(n.directives=G),A&&markAsyncBoundary(n)}function resolveInjections(n,e,t=NOOP$1){isArray$4(n)&&(n=normalizeInject(n));for(const i in n){const s=n[i];let r;isObject$3(s)?"default"in s?r=inject(s.from||i,s.default,!0):r=inject(s.from||i):r=inject(s),isRef$1(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function callHook$1(n,e,t){callWithAsyncErrorHandling(isArray$4(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function createWatcher(n,e,t,i){let s=i.includes(".")?createPathGetter(t,i):()=>t[i];if(isString$4(n)){const r=e[n];isFunction$3(r)&&watch(s,r)}else if(isFunction$3(n))watch(s,n.bind(t));else if(isObject$3(n))if(isArray$4(n))n.forEach(r=>createWatcher(r,e,t,i));else{const r=isFunction$3(n.handler)?n.handler.bind(t):e[n.handler];isFunction$3(r)&&watch(s,r,n)}}function resolveMergedOptions(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>mergeOptions(l,c,o,!0)),mergeOptions(l,e,o)),isObject$3(e)&&r.set(e,l),l}function mergeOptions(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&mergeOptions(n,r,t,!0),s&&s.forEach(o=>mergeOptions(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=internalOptionMergeStrats[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray$2,created:mergeAsArray$2,beforeMount:mergeAsArray$2,mounted:mergeAsArray$2,beforeUpdate:mergeAsArray$2,updated:mergeAsArray$2,beforeDestroy:mergeAsArray$2,beforeUnmount:mergeAsArray$2,destroyed:mergeAsArray$2,unmounted:mergeAsArray$2,activated:mergeAsArray$2,deactivated:mergeAsArray$2,errorCaptured:mergeAsArray$2,serverPrefetch:mergeAsArray$2,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(n,e){return e?n?function(){return extend$1(isFunction$3(n)?n.call(this,this):n,isFunction$3(e)?e.call(this,this):e)}:e:n}function mergeInject(n,e){return mergeObjectOptions(normalizeInject(n),normalizeInject(e))}function normalizeInject(n){if(isArray$4(n)){const e={};for(let t=0;t1)return t&&isFunction$3(e)?e.call(i&&i.proxy):e}}function hasInjectionContext(){return!!(currentInstance||currentRenderingInstance||currentApp)}const internalObjectProto={},createInternalObject=()=>Object.create(internalObjectProto),isInternalObject=n=>Object.getPrototypeOf(n)===internalObjectProto;function initProps(n,e,t,i=!1){const s={},r=createInternalObject();n.propsDefaults=Object.create(null),setFullProps(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:shallowReactive(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function updateProps(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=toRaw(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const d=n.vnode.dynamicProps;for(let u=0;u{l=!0;const[f,g]=normalizePropsOptions(u,e,!0);extend$1(o,f),g&&a.push(...g)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!r&&!l)return isObject$3(n)&&i.set(n,EMPTY_ARR),EMPTY_ARR;if(isArray$4(r))for(let d=0;dn[0]==="_"||n==="$stable",normalizeSlotValue=n=>isArray$4(n)?n.map(normalizeVNode):[normalizeVNode(n)],normalizeSlot=(n,e,t)=>{if(e._n)return e;const i=withCtx((...s)=>normalizeSlotValue(e(...s)),t);return i._c=!1,i},normalizeObjectSlots=(n,e,t)=>{const i=n._ctx;for(const s in n){if(isInternalKey(s))continue;const r=n[s];if(isFunction$3(r))e[s]=normalizeSlot(s,r,i);else if(r!=null){const o=normalizeSlotValue(r);e[s]=()=>o}}},normalizeVNodeSlots=(n,e)=>{const t=normalizeSlotValue(e);n.slots.default=()=>t},assignSlots=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},initSlots=(n,e,t)=>{const i=n.slots=createInternalObject();if(n.vnode.shapeFlag&32){const s=e._;s?(assignSlots(i,e,t),t&&def(i,"_",s,!0)):normalizeObjectSlots(e,i)}else e&&normalizeVNodeSlots(n,e)},updateSlots=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=EMPTY_OBJ$1;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:assignSlots(s,e,t):(r=!e.$stable,normalizeObjectSlots(e,s)),o=e}else e&&(normalizeVNodeSlots(n,e),o={default:1});if(r)for(const a in s)!isInternalKey(a)&&o[a]==null&&delete s[a]},queuePostRenderEffect=queueEffectWithSuspense;function createRenderer$1(n){return baseCreateRenderer(n)}function createHydrationRenderer(n){return baseCreateRenderer(n,createHydrationFunctions)}function baseCreateRenderer(n,e){const t=getGlobalThis();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:d,parentNode:u,nextSibling:f,setScopeId:g=NOOP$1,insertStaticContent:m}=n,_=(le,pe,Ie,$e=null,ye=null,Re=null,Ue=void 0,He=null,Ve=!!pe.dynamicChildren)=>{if(le===pe)return;le&&!isSameVNodeType(le,pe)&&($e=xe(le),Ce(le,ye,Re,!0),le=null),pe.patchFlag===-2&&(Ve=!1,pe.dynamicChildren=null);const{type:Oe,ref:ot,shapeFlag:et}=pe;switch(Oe){case Text$1:v(le,pe,Ie,$e);break;case Comment:C(le,pe,Ie,$e);break;case Static:le==null&&S(pe,Ie,$e,Ue);break;case Fragment:W(le,pe,Ie,$e,ye,Re,Ue,He,Ve);break;default:et&1?I(le,pe,Ie,$e,ye,Re,Ue,He,Ve):et&6?G(le,pe,Ie,$e,ye,Re,Ue,He,Ve):(et&64||et&128)&&Oe.process(le,pe,Ie,$e,ye,Re,Ue,He,Ve,qe)}ot!=null&&ye&&setRef(ot,le&&le.ref,Re,pe||le,!pe)},v=(le,pe,Ie,$e)=>{if(le==null)i(pe.el=a(pe.children),Ie,$e);else{const ye=pe.el=le.el;pe.children!==le.children&&c(ye,pe.children)}},C=(le,pe,Ie,$e)=>{le==null?i(pe.el=l(pe.children||""),Ie,$e):pe.el=le.el},S=(le,pe,Ie,$e)=>{[le.el,le.anchor]=m(le.children,pe,Ie,$e,le.el,le.anchor)},w=({el:le,anchor:pe},Ie,$e)=>{let ye;for(;le&&le!==pe;)ye=f(le),i(le,Ie,$e),le=ye;i(pe,Ie,$e)},L=({el:le,anchor:pe})=>{let Ie;for(;le&&le!==pe;)Ie=f(le),s(le),le=Ie;s(pe)},I=(le,pe,Ie,$e,ye,Re,Ue,He,Ve)=>{pe.type==="svg"?Ue="svg":pe.type==="math"&&(Ue="mathml"),le==null?N(pe,Ie,$e,ye,Re,Ue,He,Ve):A(le,pe,ye,Re,Ue,He,Ve)},N=(le,pe,Ie,$e,ye,Re,Ue,He)=>{let Ve,Oe;const{props:ot,shapeFlag:et,transition:nt,dirs:lt}=le;if(Ve=le.el=o(le.type,Re,ot&&ot.is,ot),et&8?d(Ve,le.children):et&16&&T(le.children,Ve,null,$e,ye,resolveChildrenNamespace(le,Re),Ue,He),lt&&invokeDirectiveHook(le,null,$e,"created"),R(Ve,le,le.scopeId,Ue,$e),ot){for(const Nt in ot)Nt!=="value"&&!isReservedProp$1(Nt)&&r(Ve,Nt,null,ot[Nt],Re,$e);"value"in ot&&r(Ve,"value",null,ot.value,Re),(Oe=ot.onVnodeBeforeMount)&&invokeVNodeHook(Oe,$e,le)}lt&&invokeDirectiveHook(le,null,$e,"beforeMount");const Ct=needTransition(ye,nt);Ct&&nt.beforeEnter(Ve),i(Ve,pe,Ie),((Oe=ot&&ot.onVnodeMounted)||Ct||lt)&&queuePostRenderEffect(()=>{Oe&&invokeVNodeHook(Oe,$e,le),Ct&&nt.enter(Ve),lt&&invokeDirectiveHook(le,null,$e,"mounted")},ye)},R=(le,pe,Ie,$e,ye)=>{if(Ie&&g(le,Ie),$e)for(let Re=0;Re<$e.length;Re++)g(le,$e[Re]);if(ye){let Re=ye.subTree;if(pe===Re||isSuspense(Re.type)&&(Re.ssContent===pe||Re.ssFallback===pe)){const Ue=ye.vnode;R(le,Ue,Ue.scopeId,Ue.slotScopeIds,ye.parent)}}},T=(le,pe,Ie,$e,ye,Re,Ue,He,Ve=0)=>{for(let Oe=Ve;Oe{const He=pe.el=le.el;let{patchFlag:Ve,dynamicChildren:Oe,dirs:ot}=pe;Ve|=le.patchFlag&16;const et=le.props||EMPTY_OBJ$1,nt=pe.props||EMPTY_OBJ$1;let lt;if(Ie&&toggleRecurse(Ie,!1),(lt=nt.onVnodeBeforeUpdate)&&invokeVNodeHook(lt,Ie,pe,le),ot&&invokeDirectiveHook(pe,le,Ie,"beforeUpdate"),Ie&&toggleRecurse(Ie,!0),(et.innerHTML&&nt.innerHTML==null||et.textContent&&nt.textContent==null)&&d(He,""),Oe?F(le.dynamicChildren,Oe,He,Ie,$e,resolveChildrenNamespace(pe,ye),Re):Ue||q(le,pe,He,null,Ie,$e,resolveChildrenNamespace(pe,ye),Re,!1),Ve>0){if(Ve&16)B(He,et,nt,Ie,ye);else if(Ve&2&&et.class!==nt.class&&r(He,"class",null,nt.class,ye),Ve&4&&r(He,"style",et.style,nt.style,ye),Ve&8){const Ct=pe.dynamicProps;for(let Nt=0;Nt{lt&&invokeVNodeHook(lt,Ie,pe,le),ot&&invokeDirectiveHook(pe,le,Ie,"updated")},$e)},F=(le,pe,Ie,$e,ye,Re,Ue)=>{for(let He=0;He{if(pe!==Ie){if(pe!==EMPTY_OBJ$1)for(const Re in pe)!isReservedProp$1(Re)&&!(Re in Ie)&&r(le,Re,pe[Re],null,ye,$e);for(const Re in Ie){if(isReservedProp$1(Re))continue;const Ue=Ie[Re],He=pe[Re];Ue!==He&&Re!=="value"&&r(le,Re,He,Ue,ye,$e)}"value"in Ie&&r(le,"value",pe.value,Ie.value,ye)}},W=(le,pe,Ie,$e,ye,Re,Ue,He,Ve)=>{const Oe=pe.el=le?le.el:a(""),ot=pe.anchor=le?le.anchor:a("");let{patchFlag:et,dynamicChildren:nt,slotScopeIds:lt}=pe;lt&&(He=He?He.concat(lt):lt),le==null?(i(Oe,Ie,$e),i(ot,Ie,$e),T(pe.children||[],Ie,ot,ye,Re,Ue,He,Ve)):et>0&&et&64&&nt&&le.dynamicChildren?(F(le.dynamicChildren,nt,Ie,ye,Re,Ue,He),(pe.key!=null||ye&&pe===ye.subTree)&&traverseStaticChildren(le,pe,!0)):q(le,pe,Ie,ot,ye,Re,Ue,He,Ve)},G=(le,pe,Ie,$e,ye,Re,Ue,He,Ve)=>{pe.slotScopeIds=He,le==null?pe.shapeFlag&512?ye.ctx.activate(pe,Ie,$e,Ue,Ve):j(pe,Ie,$e,ye,Re,Ue,Ve):K(le,pe,Ve)},j=(le,pe,Ie,$e,ye,Re,Ue)=>{const He=le.component=createComponentInstance(le,$e,ye);if(isKeepAlive(le)&&(He.ctx.renderer=qe),setupComponent(He,!1,Ue),He.asyncDep){if(ye&&ye.registerDep(He,ee,Ue),!le.el){const Ve=He.subTree=createVNode(Comment);C(null,Ve,pe,Ie)}}else ee(He,le,pe,Ie,ye,Re,Ue)},K=(le,pe,Ie)=>{const $e=pe.component=le.component;if(shouldUpdateComponent(le,pe,Ie))if($e.asyncDep&&!$e.asyncResolved){U($e,pe,Ie);return}else $e.next=pe,$e.update();else pe.el=le.el,$e.vnode=pe},ee=(le,pe,Ie,$e,ye,Re,Ue)=>{const He=()=>{if(le.isMounted){let{next:et,bu:nt,u:lt,parent:Ct,vnode:Nt}=le;{const Xt=locateNonHydratedAsyncRoot(le);if(Xt){et&&(et.el=Nt.el,U(le,et,Ue)),Xt.asyncDep.then(()=>{le.isUnmounted||He()});return}}let kt=et,hi;toggleRecurse(le,!1),et?(et.el=Nt.el,U(le,et,Ue)):et=Nt,nt&&invokeArrayFns(nt),(hi=et.props&&et.props.onVnodeBeforeUpdate)&&invokeVNodeHook(hi,Ct,et,Nt),toggleRecurse(le,!0);const Vt=renderComponentRoot(le),_i=le.subTree;le.subTree=Vt,_(_i,Vt,u(_i.el),xe(_i),le,ye,Re),et.el=Vt.el,kt===null&&updateHOCHostEl(le,Vt.el),lt&&queuePostRenderEffect(lt,ye),(hi=et.props&&et.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(hi,Ct,et,Nt),ye)}else{let et;const{el:nt,props:lt}=pe,{bm:Ct,m:Nt,parent:kt,root:hi,type:Vt}=le,_i=isAsyncWrapper(pe);if(toggleRecurse(le,!1),Ct&&invokeArrayFns(Ct),!_i&&(et=lt&<.onVnodeBeforeMount)&&invokeVNodeHook(et,kt,pe),toggleRecurse(le,!0),nt&&je){const Xt=()=>{le.subTree=renderComponentRoot(le),je(nt,le.subTree,le,ye,null)};_i&&Vt.__asyncHydrate?Vt.__asyncHydrate(nt,le,Xt):Xt()}else{hi.ce&&hi.ce._injectChildStyle(Vt);const Xt=le.subTree=renderComponentRoot(le);_(null,Xt,Ie,$e,le,ye,Re),pe.el=Xt.el}if(Nt&&queuePostRenderEffect(Nt,ye),!_i&&(et=lt&<.onVnodeMounted)){const Xt=pe;queuePostRenderEffect(()=>invokeVNodeHook(et,kt,Xt),ye)}(pe.shapeFlag&256||kt&&isAsyncWrapper(kt.vnode)&&kt.vnode.shapeFlag&256)&&le.a&&queuePostRenderEffect(le.a,ye),le.isMounted=!0,pe=Ie=$e=null}};le.scope.on();const Ve=le.effect=new ReactiveEffect(He);le.scope.off();const Oe=le.update=Ve.run.bind(Ve),ot=le.job=Ve.runIfDirty.bind(Ve);ot.i=le,ot.id=le.uid,Ve.scheduler=()=>queueJob(ot),toggleRecurse(le,!0),Oe()},U=(le,pe,Ie)=>{pe.component=le;const $e=le.vnode.props;le.vnode=pe,le.next=null,updateProps(le,pe.props,$e,Ie),updateSlots(le,pe.children,Ie),pauseTracking(),flushPreFlushCbs(le),resetTracking()},q=(le,pe,Ie,$e,ye,Re,Ue,He,Ve=!1)=>{const Oe=le&&le.children,ot=le?le.shapeFlag:0,et=pe.children,{patchFlag:nt,shapeFlag:lt}=pe;if(nt>0){if(nt&128){ce(Oe,et,Ie,$e,ye,Re,Ue,He,Ve);return}else if(nt&256){Q(Oe,et,Ie,$e,ye,Re,Ue,He,Ve);return}}lt&8?(ot&16&&Te(Oe,ye,Re),et!==Oe&&d(Ie,et)):ot&16?lt&16?ce(Oe,et,Ie,$e,ye,Re,Ue,He,Ve):Te(Oe,ye,Re,!0):(ot&8&&d(Ie,""),lt&16&&T(et,Ie,$e,ye,Re,Ue,He,Ve))},Q=(le,pe,Ie,$e,ye,Re,Ue,He,Ve)=>{le=le||EMPTY_ARR,pe=pe||EMPTY_ARR;const Oe=le.length,ot=pe.length,et=Math.min(Oe,ot);let nt;for(nt=0;ntot?Te(le,ye,Re,!0,!1,et):T(pe,Ie,$e,ye,Re,Ue,He,Ve,et)},ce=(le,pe,Ie,$e,ye,Re,Ue,He,Ve)=>{let Oe=0;const ot=pe.length;let et=le.length-1,nt=ot-1;for(;Oe<=et&&Oe<=nt;){const lt=le[Oe],Ct=pe[Oe]=Ve?cloneIfMounted(pe[Oe]):normalizeVNode(pe[Oe]);if(isSameVNodeType(lt,Ct))_(lt,Ct,Ie,null,ye,Re,Ue,He,Ve);else break;Oe++}for(;Oe<=et&&Oe<=nt;){const lt=le[et],Ct=pe[nt]=Ve?cloneIfMounted(pe[nt]):normalizeVNode(pe[nt]);if(isSameVNodeType(lt,Ct))_(lt,Ct,Ie,null,ye,Re,Ue,He,Ve);else break;et--,nt--}if(Oe>et){if(Oe<=nt){const lt=nt+1,Ct=ltnt)for(;Oe<=et;)Ce(le[Oe],ye,Re,!0),Oe++;else{const lt=Oe,Ct=Oe,Nt=new Map;for(Oe=Ct;Oe<=nt;Oe++){const bi=pe[Oe]=Ve?cloneIfMounted(pe[Oe]):normalizeVNode(pe[Oe]);bi.key!=null&&Nt.set(bi.key,Oe)}let kt,hi=0;const Vt=nt-Ct+1;let _i=!1,Xt=0;const At=new Array(Vt);for(Oe=0;Oe=Vt){Ce(bi,ye,Re,!0);continue}let vi;if(bi.key!=null)vi=Nt.get(bi.key);else for(kt=Ct;kt<=nt;kt++)if(At[kt-Ct]===0&&isSameVNodeType(bi,pe[kt])){vi=kt;break}vi===void 0?Ce(bi,ye,Re,!0):(At[vi-Ct]=Oe+1,vi>=Xt?Xt=vi:_i=!0,_(bi,pe[vi],Ie,null,ye,Re,Ue,He,Ve),hi++)}const Si=_i?getSequence(At):EMPTY_ARR;for(kt=Si.length-1,Oe=Vt-1;Oe>=0;Oe--){const bi=Ct+Oe,vi=pe[bi],Ot=bi+1{const{el:Re,type:Ue,transition:He,children:Ve,shapeFlag:Oe}=le;if(Oe&6){ie(le.component.subTree,pe,Ie,$e);return}if(Oe&128){le.suspense.move(pe,Ie,$e);return}if(Oe&64){Ue.move(le,pe,Ie,qe);return}if(Ue===Fragment){i(Re,pe,Ie);for(let et=0;etHe.enter(Re),ye);else{const{leave:et,delayLeave:nt,afterLeave:lt}=He,Ct=()=>i(Re,pe,Ie),Nt=()=>{et(Re,()=>{Ct(),lt&<()})};nt?nt(Re,Ct,Nt):Nt()}else i(Re,pe,Ie)},Ce=(le,pe,Ie,$e=!1,ye=!1)=>{const{type:Re,props:Ue,ref:He,children:Ve,dynamicChildren:Oe,shapeFlag:ot,patchFlag:et,dirs:nt,cacheIndex:lt}=le;if(et===-2&&(ye=!1),He!=null&&setRef(He,null,Ie,le,!0),lt!=null&&(pe.renderCache[lt]=void 0),ot&256){pe.ctx.deactivate(le);return}const Ct=ot&1&&nt,Nt=!isAsyncWrapper(le);let kt;if(Nt&&(kt=Ue&&Ue.onVnodeBeforeUnmount)&&invokeVNodeHook(kt,pe,le),ot&6)De(le.component,Ie,$e);else{if(ot&128){le.suspense.unmount(Ie,$e);return}Ct&&invokeDirectiveHook(le,null,pe,"beforeUnmount"),ot&64?le.type.remove(le,pe,Ie,qe,$e):Oe&&!Oe.hasOnce&&(Re!==Fragment||et>0&&et&64)?Te(Oe,pe,Ie,!1,!0):(Re===Fragment&&et&384||!ye&&ot&16)&&Te(Ve,pe,Ie),$e&&ae(le)}(Nt&&(kt=Ue&&Ue.onVnodeUnmounted)||Ct)&&queuePostRenderEffect(()=>{kt&&invokeVNodeHook(kt,pe,le),Ct&&invokeDirectiveHook(le,null,pe,"unmounted")},Ie)},ae=le=>{const{type:pe,el:Ie,anchor:$e,transition:ye}=le;if(pe===Fragment){be(Ie,$e);return}if(pe===Static){L(le);return}const Re=()=>{s(Ie),ye&&!ye.persisted&&ye.afterLeave&&ye.afterLeave()};if(le.shapeFlag&1&&ye&&!ye.persisted){const{leave:Ue,delayLeave:He}=ye,Ve=()=>Ue(Ie,Re);He?He(le.el,Re,Ve):Ve()}else Re()},be=(le,pe)=>{let Ie;for(;le!==pe;)Ie=f(le),s(le),le=Ie;s(pe)},De=(le,pe,Ie)=>{const{bum:$e,scope:ye,job:Re,subTree:Ue,um:He,m:Ve,a:Oe}=le;invalidateMount(Ve),invalidateMount(Oe),$e&&invokeArrayFns($e),ye.stop(),Re&&(Re.flags|=8,Ce(Ue,le,pe,Ie)),He&&queuePostRenderEffect(He,pe),queuePostRenderEffect(()=>{le.isUnmounted=!0},pe),pe&&pe.pendingBranch&&!pe.isUnmounted&&le.asyncDep&&!le.asyncResolved&&le.suspenseId===pe.pendingId&&(pe.deps--,pe.deps===0&&pe.resolve())},Te=(le,pe,Ie,$e=!1,ye=!1,Re=0)=>{for(let Ue=Re;Ue{if(le.shapeFlag&6)return xe(le.component.subTree);if(le.shapeFlag&128)return le.suspense.next();const pe=f(le.anchor||le.el),Ie=pe&&pe[TeleportEndKey];return Ie?f(Ie):pe};let ze=!1;const Qe=(le,pe,Ie)=>{le==null?pe._vnode&&Ce(pe._vnode,null,null,!0):_(pe._vnode||null,le,pe,null,null,null,Ie),pe._vnode=le,ze||(ze=!0,flushPreFlushCbs(),flushPostFlushCbs(),ze=!1)},qe={p:_,um:Ce,m:ie,r:ae,mt:j,mc:T,pc:q,pbc:F,n:xe,o:n};let Le,je;return e&&([Le,je]=e(qe)),{render:Qe,hydrate:Le,createApp:createAppAPI(Qe,Le)}}function resolveChildrenNamespace({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function toggleRecurse({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function needTransition(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function traverseStaticChildren(n,e,t=!1){const i=n.children,s=e.children;if(isArray$4(i)&&isArray$4(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function locateNonHydratedAsyncRoot(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:locateNonHydratedAsyncRoot(e)}function invalidateMount(n){if(n)for(let e=0;einject(ssrContextKey);function watchEffect(n,e){return doWatch(n,null,e)}function watchPostEffect(n,e){return doWatch(n,null,{flush:"post"})}function watchSyncEffect(n,e){return doWatch(n,null,{flush:"sync"})}function watch(n,e,t){return doWatch(n,e,t)}function doWatch(n,e,t=EMPTY_OBJ$1){const{immediate:i,deep:s,flush:r,once:o}=t,a=extend$1({},t),l=e&&i||!e&&r!=="post";let c;if(isInSSRComponentSetup){if(r==="sync"){const g=useSSRContext();c=g.__watcherHandles||(g.__watcherHandles=[])}else if(!l){const g=()=>{};return g.stop=NOOP$1,g.resume=NOOP$1,g.pause=NOOP$1,g}}const d=currentInstance;a.call=(g,m,_)=>callWithAsyncErrorHandling(g,d,m,_);let u=!1;r==="post"?a.scheduler=g=>{queuePostRenderEffect(g,d&&d.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(g,m)=>{m?g():queueJob(g)}),a.augmentJob=g=>{e&&(g.flags|=4),u&&(g.flags|=2,d&&(g.id=d.uid,g.i=d))};const f=watch$1(n,e,a);return isInSSRComponentSetup&&(c?c.push(f):l&&f()),f}function instanceWatch(n,e,t){const i=this.proxy,s=isString$4(n)?n.includes(".")?createPathGetter(i,n):()=>i[n]:n.bind(i,i);let r;isFunction$3(e)?r=e:(r=e.handler,t=e);const o=setCurrentInstance(this),a=doWatch(s,r.bind(i),t);return o(),a}function createPathGetter(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let d,u=EMPTY_OBJ$1,f;return watchSyncEffect(()=>{const g=n[s];hasChanged(d,g)&&(d=g,c())}),{get(){return l(),t.get?t.get(d):d},set(g){const m=t.set?t.set(g):g;if(!hasChanged(m,d)&&!(u!==EMPTY_OBJ$1&&hasChanged(g,u)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(d=g,c()),i.emit(`update:${e}`,m),hasChanged(g,m)&&hasChanged(g,u)&&!hasChanged(m,f)&&c(),u=g,f=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||EMPTY_OBJ$1:a,done:!1}:{done:!0}}}},a}const getModelModifiers=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${camelize$1(e)}Modifiers`]||n[`${hyphenate$1(e)}Modifiers`];function emit$1(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||EMPTY_OBJ$1;let s=t;const r=e.startsWith("update:"),o=r&&getModelModifiers(i,e.slice(7));o&&(o.trim&&(s=t.map(d=>isString$4(d)?d.trim():d)),o.number&&(s=t.map(looseToNumber)));let a,l=i[a=toHandlerKey$1(e)]||i[a=toHandlerKey$1(camelize$1(e))];!l&&r&&(l=i[a=toHandlerKey$1(hyphenate$1(e))]),l&&callWithAsyncErrorHandling(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,callWithAsyncErrorHandling(c,n,6,s)}}function normalizeEmitsOptions(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!isFunction$3(n)){const l=c=>{const d=normalizeEmitsOptions(c,e,!0);d&&(a=!0,extend$1(o,d))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(isObject$3(n)&&i.set(n,null),null):(isArray$4(r)?r.forEach(l=>o[l]=null):extend$1(o,r),isObject$3(n)&&i.set(n,o),o)}function isEmitListener(n,e){return!n||!isOn$1(e)?!1:(e=e.slice(2).replace(/Once$/,""),hasOwn$1(n,e[0].toLowerCase()+e.slice(1))||hasOwn$1(n,hyphenate$1(e))||hasOwn$1(n,e))}function markAttrsAccessed(){}function renderComponentRoot(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:d,props:u,data:f,setupState:g,ctx:m,inheritAttrs:_}=n,v=setCurrentRenderingInstance(n);let C,S;try{if(t.shapeFlag&4){const L=s||i,I=L;C=normalizeVNode(c.call(I,L,d,u,g,f,m)),S=a}else{const L=e;C=normalizeVNode(L.length>1?L(u,{attrs:a,slots:o,emit:l}):L(u,null)),S=e.props?a:getFunctionalFallthrough(a)}}catch(L){blockStack.length=0,handleError(L,n,1),C=createVNode(Comment)}let w=C;if(S&&_!==!1){const L=Object.keys(S),{shapeFlag:I}=w;L.length&&I&7&&(r&&L.some(isModelListener)&&(S=filterModelListeners(S,r)),w=cloneVNode(w,S,!1,!0))}return t.dirs&&(w=cloneVNode(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(t.dirs):t.dirs),t.transition&&setTransitionHooks(w,t.transition),C=w,setCurrentRenderingInstance(v),C}function filterSingleRoot(n,e=!0){let t;for(let i=0;i{let e;for(const t in n)(t==="class"||t==="style"||isOn$1(t))&&((e||(e={}))[t]=n[t]);return e},filterModelListeners=(n,e)=>{const t={};for(const i in n)(!isModelListener(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function shouldUpdateComponent(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?hasPropsChanged(i,o,c):!!o;if(l&8){const d=e.dynamicProps;for(let u=0;un.__isSuspense;let suspenseId=0;const SuspenseImpl={name:"Suspense",__isSuspense:!0,process(n,e,t,i,s,r,o,a,l,c){if(n==null)mountSuspense(e,t,i,s,r,o,a,l,c);else{if(r&&r.deps>0&&!n.suspense.isInFallback){e.suspense=n.suspense,e.suspense.vnode=e,e.el=n.el;return}patchSuspense(n,e,t,i,s,o,a,l,c)}},hydrate:hydrateSuspense,normalize:normalizeSuspenseChildren},Suspense=SuspenseImpl;function triggerEvent(n,e){const t=n.props&&n.props[e];isFunction$3(t)&&t()}function mountSuspense(n,e,t,i,s,r,o,a,l){const{p:c,o:{createElement:d}}=l,u=d("div"),f=n.suspense=createSuspenseBoundary(n,s,i,e,u,t,r,o,a,l);c(null,f.pendingBranch=n.ssContent,u,null,i,f,r,o),f.deps>0?(triggerEvent(n,"onPending"),triggerEvent(n,"onFallback"),c(null,n.ssFallback,e,t,i,null,r,o),setActiveBranch(f,n.ssFallback)):f.resolve(!1,!0)}function patchSuspense(n,e,t,i,s,r,o,a,{p:l,um:c,o:{createElement:d}}){const u=e.suspense=n.suspense;u.vnode=e,e.el=n.el;const f=e.ssContent,g=e.ssFallback,{activeBranch:m,pendingBranch:_,isInFallback:v,isHydrating:C}=u;if(_)u.pendingBranch=f,isSameVNodeType(f,_)?(l(_,f,u.hiddenContainer,null,s,u,r,o,a),u.deps<=0?u.resolve():v&&(C||(l(m,g,t,i,s,null,r,o,a),setActiveBranch(u,g)))):(u.pendingId=suspenseId++,C?(u.isHydrating=!1,u.activeBranch=_):c(_,s,u),u.deps=0,u.effects.length=0,u.hiddenContainer=d("div"),v?(l(null,f,u.hiddenContainer,null,s,u,r,o,a),u.deps<=0?u.resolve():(l(m,g,t,i,s,null,r,o,a),setActiveBranch(u,g))):m&&isSameVNodeType(f,m)?(l(m,f,t,i,s,u,r,o,a),u.resolve(!0)):(l(null,f,u.hiddenContainer,null,s,u,r,o,a),u.deps<=0&&u.resolve()));else if(m&&isSameVNodeType(f,m))l(m,f,t,i,s,u,r,o,a),setActiveBranch(u,f);else if(triggerEvent(e,"onPending"),u.pendingBranch=f,f.shapeFlag&512?u.pendingId=f.component.suspenseId:u.pendingId=suspenseId++,l(null,f,u.hiddenContainer,null,s,u,r,o,a),u.deps<=0)u.resolve();else{const{timeout:S,pendingId:w}=u;S>0?setTimeout(()=>{u.pendingId===w&&u.fallback(g)},S):S===0&&u.fallback(g)}}function createSuspenseBoundary(n,e,t,i,s,r,o,a,l,c,d=!1){const{p:u,m:f,um:g,n:m,o:{parentNode:_,remove:v}}=c;let C;const S=isVNodeSuspensible(n);S&&e&&e.pendingBranch&&(C=e.pendingId,e.deps++);const w=n.props?toNumber(n.props.timeout):void 0,L=r,I={vnode:n,parent:e,parentComponent:t,namespace:o,container:i,hiddenContainer:s,deps:0,pendingId:suspenseId++,timeout:typeof w=="number"?w:-1,activeBranch:null,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(N=!1,R=!1){const{vnode:T,activeBranch:A,pendingBranch:F,pendingId:B,effects:W,parentComponent:G,container:j}=I;let K=!1;I.isHydrating?I.isHydrating=!1:N||(K=A&&F.transition&&F.transition.mode==="out-in",K&&(A.transition.afterLeave=()=>{B===I.pendingId&&(f(F,j,r===L?m(A):r,0),queuePostFlushCb(W))}),A&&(_(A.el)===j&&(r=m(A)),g(A,G,I,!0)),K||f(F,j,r,0)),setActiveBranch(I,F),I.pendingBranch=null,I.isInFallback=!1;let ee=I.parent,U=!1;for(;ee;){if(ee.pendingBranch){ee.effects.push(...W),U=!0;break}ee=ee.parent}!U&&!K&&queuePostFlushCb(W),I.effects=[],S&&e&&e.pendingBranch&&C===e.pendingId&&(e.deps--,e.deps===0&&!R&&e.resolve()),triggerEvent(T,"onResolve")},fallback(N){if(!I.pendingBranch)return;const{vnode:R,activeBranch:T,parentComponent:A,container:F,namespace:B}=I;triggerEvent(R,"onFallback");const W=m(T),G=()=>{I.isInFallback&&(u(null,N,F,W,A,null,B,a,l),setActiveBranch(I,N))},j=N.transition&&N.transition.mode==="out-in";j&&(T.transition.afterLeave=G),I.isInFallback=!0,g(T,A,null,!0),j||G()},move(N,R,T){I.activeBranch&&f(I.activeBranch,N,R,T),I.container=N},next(){return I.activeBranch&&m(I.activeBranch)},registerDep(N,R,T){const A=!!I.pendingBranch;A&&I.deps++;const F=N.vnode.el;N.asyncDep.catch(B=>{handleError(B,N,0)}).then(B=>{if(N.isUnmounted||I.isUnmounted||I.pendingId!==N.suspenseId)return;N.asyncResolved=!0;const{vnode:W}=N;handleSetupResult(N,B,!1),F&&(W.el=F);const G=!F&&N.subTree.el;R(N,W,_(F||N.subTree.el),F?null:m(N.subTree),I,o,T),G&&v(G),updateHOCHostEl(N,W.el),A&&--I.deps===0&&I.resolve()})},unmount(N,R){I.isUnmounted=!0,I.activeBranch&&g(I.activeBranch,t,N,R),I.pendingBranch&&g(I.pendingBranch,t,N,R)}};return I}function hydrateSuspense(n,e,t,i,s,r,o,a,l){const c=e.suspense=createSuspenseBoundary(e,i,t,n.parentNode,document.createElement("div"),null,s,r,o,a,!0),d=l(n,c.pendingBranch=e.ssContent,t,c,r,o);return c.deps===0&&c.resolve(!1,!0),d}function normalizeSuspenseChildren(n){const{shapeFlag:e,children:t}=n,i=e&32;n.ssContent=normalizeSuspenseSlot(i?t.default:t),n.ssFallback=i?normalizeSuspenseSlot(t.fallback):createVNode(Comment)}function normalizeSuspenseSlot(n){let e;if(isFunction$3(n)){const t=isBlockTreeEnabled&&n._c;t&&(n._d=!1,openBlock()),n=n(),t&&(n._d=!0,e=currentBlock,closeBlock())}return isArray$4(n)&&(n=filterSingleRoot(n)),n=normalizeVNode(n),e&&!n.dynamicChildren&&(n.dynamicChildren=e.filter(t=>t!==n)),n}function queueEffectWithSuspense(n,e){e&&e.pendingBranch?isArray$4(n)?e.effects.push(...n):e.effects.push(n):queuePostFlushCb(n)}function setActiveBranch(n,e){n.activeBranch=e;const{vnode:t,parentComponent:i}=n;let s=e.el;for(;!s&&e.component;)e=e.component.subTree,s=e.el;t.el=s,i&&i.subTree===t&&(i.vnode.el=s,updateHOCHostEl(i,s))}function isVNodeSuspensible(n){const e=n.props&&n.props.suspensible;return e!=null&&e!==!1}const Fragment=Symbol.for("v-fgt"),Text$1=Symbol.for("v-txt"),Comment=Symbol.for("v-cmt"),Static=Symbol.for("v-stc"),blockStack=[];let currentBlock=null;function openBlock(n=!1){blockStack.push(currentBlock=n?null:[])}function closeBlock(){blockStack.pop(),currentBlock=blockStack[blockStack.length-1]||null}let isBlockTreeEnabled=1;function setBlockTracking(n,e=!1){isBlockTreeEnabled+=n,n<0&¤tBlock&&e&&(currentBlock.hasOnce=!0)}function setupBlock(n){return n.dynamicChildren=isBlockTreeEnabled>0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(n),n}function createElementBlock(n,e,t,i,s,r){return setupBlock(createBaseVNode(n,e,t,i,s,r,!0))}function createBlock$1(n,e,t,i,s){return setupBlock(createVNode(n,e,t,i,s,!0))}function isVNode(n){return n?n.__v_isVNode===!0:!1}function isSameVNodeType(n,e){return n.type===e.type&&n.key===e.key}function transformVNodeArgs(n){}const normalizeKey=({key:n})=>n??null,normalizeRef=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?isString$4(n)||isRef$1(n)||isFunction$3(n)?{i:currentRenderingInstance,r:n,k:e,f:!!t}:n:null);function createBaseVNode(n,e=null,t=null,i=0,s=null,r=n===Fragment?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&normalizeKey(e),ref:e&&normalizeRef(e),scopeId:currentScopeId,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};return a?(normalizeChildren(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=isString$4(t)?8:16),isBlockTreeEnabled>0&&!o&¤tBlock&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&¤tBlock.push(l),l}const createVNode=_createVNode;function _createVNode(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===NULL_DYNAMIC_COMPONENT)&&(n=Comment),isVNode(n)){const a=cloneVNode(n,e,!0);return t&&normalizeChildren(a,t),isBlockTreeEnabled>0&&!r&¤tBlock&&(a.shapeFlag&6?currentBlock[currentBlock.indexOf(n)]=a:currentBlock.push(a)),a.patchFlag=-2,a}if(isClassComponent(n)&&(n=n.__vccOpts),e){e=guardReactiveProps(e);let{class:a,style:l}=e;a&&!isString$4(a)&&(e.class=normalizeClass$1(a)),isObject$3(l)&&(isProxy(l)&&!isArray$4(l)&&(l=extend$1({},l)),e.style=normalizeStyle$1(l))}const o=isString$4(n)?1:isSuspense(n)?128:isTeleport(n)?64:isObject$3(n)?4:isFunction$3(n)?2:0;return createBaseVNode(n,e,t,i,s,o,r,!0)}function guardReactiveProps(n){return n?isProxy(n)||isInternalObject(n)?extend$1({},n):n:null}function cloneVNode(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?mergeProps(s||{},e):s,d={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&normalizeKey(c),ref:e&&e.ref?t&&r?isArray$4(r)?r.concat(normalizeRef(e)):[r,normalizeRef(e)]:normalizeRef(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Fragment?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&cloneVNode(n.ssContent),ssFallback:n.ssFallback&&cloneVNode(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&setTransitionHooks(d,l.clone(d)),d}function createTextVNode(n=" ",e=0){return createVNode(Text$1,null,n,e)}function createStaticVNode(n,e){const t=createVNode(Static,null,n);return t.staticCount=e,t}function createCommentVNode(n="",e=!1){return e?(openBlock(),createBlock$1(Comment,null,n)):createVNode(Comment,null,n)}function normalizeVNode(n){return n==null||typeof n=="boolean"?createVNode(Comment):isArray$4(n)?createVNode(Fragment,null,n.slice()):isVNode(n)?cloneIfMounted(n):createVNode(Text$1,null,String(n))}function cloneIfMounted(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:cloneVNode(n)}function normalizeChildren(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(isArray$4(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),normalizeChildren(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!isInternalObject(e)?e._ctx=currentRenderingInstance:s===3&¤tRenderingInstance&&(currentRenderingInstance.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else isFunction$3(e)?(e={default:e,_ctx:currentRenderingInstance},t=32):(e=String(e),i&64?(t=16,e=[createTextVNode(e)]):t=8);n.children=e,n.shapeFlag|=t}function mergeProps(...n){const e={};for(let t=0;tcurrentInstance||currentRenderingInstance;let internalSetCurrentInstance,setInSSRSetupState;{const n=getGlobalThis(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};internalSetCurrentInstance=e("__VUE_INSTANCE_SETTERS__",t=>currentInstance=t),setInSSRSetupState=e("__VUE_SSR_SETTERS__",t=>isInSSRComponentSetup=t)}const setCurrentInstance=n=>{const e=currentInstance;return internalSetCurrentInstance(n),n.scope.on(),()=>{n.scope.off(),internalSetCurrentInstance(e)}},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),internalSetCurrentInstance(null)};function isStatefulComponent(n){return n.vnode.shapeFlag&4}let isInSSRComponentSetup=!1;function setupComponent(n,e=!1,t=!1){e&&setInSSRSetupState(e);const{props:i,children:s}=n.vnode,r=isStatefulComponent(n);initProps(n,i,r,e),initSlots(n,s,t);const o=r?setupStatefulComponent(n,e):void 0;return e&&setInSSRSetupState(!1),o}function setupStatefulComponent(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,PublicInstanceProxyHandlers);const{setup:i}=t;if(i){pauseTracking();const s=n.setupContext=i.length>1?createSetupContext(n):null,r=setCurrentInstance(n),o=callWithErrorHandling(i,n,0,[n.props,s]),a=isPromise(o);if(resetTracking(),r(),(a||n.sp)&&!isAsyncWrapper(n)&&markAsyncBoundary(n),a){if(o.then(unsetCurrentInstance,unsetCurrentInstance),e)return o.then(l=>{handleSetupResult(n,l,e)}).catch(l=>{handleError(l,n,0)});n.asyncDep=o}else handleSetupResult(n,o,e)}else finishComponentSetup(n,e)}function handleSetupResult(n,e,t){isFunction$3(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:isObject$3(e)&&(n.setupState=proxyRefs(e)),finishComponentSetup(n,t)}let compile$3,installWithProxy;function registerRuntimeCompiler(n){compile$3=n,installWithProxy=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,RuntimeCompiledPublicInstanceProxyHandlers))}}const isRuntimeOnly=()=>!compile$3;function finishComponentSetup(n,e,t){const i=n.type;if(!n.render){if(!e&&compile$3&&!i.render){const s=i.template||resolveMergedOptions(n).template;if(s){const{isCustomElement:r,compilerOptions:o}=n.appContext.config,{delimiters:a,compilerOptions:l}=i,c=extend$1(extend$1({isCustomElement:r,delimiters:a},o),l);i.render=compile$3(s,c)}}n.render=i.render||NOOP$1,installWithProxy&&installWithProxy(n)}{const s=setCurrentInstance(n);pauseTracking();try{applyOptions(n)}finally{resetTracking(),s()}}}const attrsProxyHandlers={get(n,e){return track(n,"get",""),n[e]}};function createSetupContext(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,attrsProxyHandlers),slots:n.slots,emit:n.emit,expose:e}}function getComponentPublicInstance(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(proxyRefs(markRaw(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in publicPropertiesMap)return publicPropertiesMap[t](n)},has(e,t){return t in e||t in publicPropertiesMap}})):n.proxy}const classifyRE=/(?:^|[-_])(\w)/g,classify=n=>n.replace(classifyRE,e=>e.toUpperCase()).replace(/[-_]/g,"");function getComponentName(n,e=!0){return isFunction$3(n)?n.displayName||n.name:n.name||e&&n.__name}function formatComponentName(n,e,t=!1){let i=getComponentName(e);if(!i&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&n&&n.parent){const s=r=>{for(const o in r)if(r[o]===e)return o};i=s(n.components||n.parent.type.components)||s(n.appContext.components)}return i?classify(i):t?"App":"Anonymous"}function isClassComponent(n){return isFunction$3(n)&&"__vccOpts"in n}const computed=(n,e)=>computed$1(n,e,isInSSRComponentSetup);function h$1(n,e,t){const i=arguments.length;return i===2?isObject$3(e)&&!isArray$4(e)?isVNode(e)?createVNode(n,null,[e]):createVNode(n,e):createVNode(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&isVNode(t)&&(t=[t]),createVNode(n,e,t))}function initCustomFormatter(){}function withMemo(n,e,t,i){const s=t[i];if(s&&isMemoSame(s,n))return s;const r=e();return r.memo=n.slice(),r.cacheIndex=i,t[i]=r}function isMemoSame(n,e){const t=n.memo;if(t.length!=e.length)return!1;for(let i=0;i0&¤tBlock&¤tBlock.push(n),!0}const version="3.5.13",warn=NOOP$1,ErrorTypeStrings=ErrorTypeStrings$1,devtools=devtools$1,setDevtoolsHook=setDevtoolsHook$1,_ssrUtils={createComponentInstance,setupComponent,renderComponentRoot,setCurrentRenderingInstance,isVNode,normalizeVNode,getComponentPublicInstance,ensureValidVNode,pushWarningContext,popWarningContext},ssrUtils=_ssrUtils,resolveFilter=null,compatUtils=null,DeprecationTypes=null;/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let policy;const tt=typeof window<"u"&&window.trustedTypes;if(tt)try{policy=tt.createPolicy("vue",{createHTML:n=>n})}catch{}const unsafeToTrustedHTML=policy?n=>policy.createHTML(n):n=>n,svgNS="http://www.w3.org/2000/svg",mathmlNS="http://www.w3.org/1998/Math/MathML",doc=typeof document<"u"?document:null,templateContainer=doc&&doc.createElement("template"),nodeOps={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?doc.createElementNS(svgNS,n):e==="mathml"?doc.createElementNS(mathmlNS,n):t?doc.createElement(n,{is:t}):doc.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>doc.createTextNode(n),createComment:n=>doc.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>doc.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{templateContainer.innerHTML=unsafeToTrustedHTML(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=templateContainer.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},TRANSITION$2="transition",ANIMATION="animation",vtcKey=Symbol("_vtc"),DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=extend$1({},BaseTransitionPropsValidators,DOMTransitionPropsValidators),decorate$1=n=>(n.displayName="Transition",n.props=TransitionPropsValidators,n),Transition=decorate$1((n,{slots:e})=>h$1(BaseTransition,resolveTransitionProps(n),e)),callHook=(n,e=[])=>{isArray$4(n)?n.forEach(t=>t(...e)):n&&n(...e)},hasExplicitCallback=n=>n?isArray$4(n)?n.some(e=>e.length>1):n.length>1:!1;function resolveTransitionProps(n){const e={};for(const W in n)W in DOMTransitionPropsValidators||(e[W]=n[W]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:d=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:f=`${t}-leave-active`,leaveToClass:g=`${t}-leave-to`}=n,m=normalizeDuration(s),_=m&&m[0],v=m&&m[1],{onBeforeEnter:C,onEnter:S,onEnterCancelled:w,onLeave:L,onLeaveCancelled:I,onBeforeAppear:N=C,onAppear:R=S,onAppearCancelled:T=w}=e,A=(W,G,j,K)=>{W._enterCancelled=K,removeTransitionClass(W,G?d:a),removeTransitionClass(W,G?c:o),j&&j()},F=(W,G)=>{W._isLeaving=!1,removeTransitionClass(W,u),removeTransitionClass(W,g),removeTransitionClass(W,f),G&&G()},B=W=>(G,j)=>{const K=W?R:S,ee=()=>A(G,W,j);callHook(K,[G,ee]),nextFrame(()=>{removeTransitionClass(G,W?l:r),addTransitionClass(G,W?d:a),hasExplicitCallback(K)||whenTransitionEnds(G,i,_,ee)})};return extend$1(e,{onBeforeEnter(W){callHook(C,[W]),addTransitionClass(W,r),addTransitionClass(W,o)},onBeforeAppear(W){callHook(N,[W]),addTransitionClass(W,l),addTransitionClass(W,c)},onEnter:B(!1),onAppear:B(!0),onLeave(W,G){W._isLeaving=!0;const j=()=>F(W,G);addTransitionClass(W,u),W._enterCancelled?(addTransitionClass(W,f),forceReflow()):(forceReflow(),addTransitionClass(W,f)),nextFrame(()=>{W._isLeaving&&(removeTransitionClass(W,u),addTransitionClass(W,g),hasExplicitCallback(L)||whenTransitionEnds(W,i,v,j))}),callHook(L,[W,j])},onEnterCancelled(W){A(W,!1,void 0,!0),callHook(w,[W])},onAppearCancelled(W){A(W,!0,void 0,!0),callHook(T,[W])},onLeaveCancelled(W){F(W),callHook(I,[W])}})}function normalizeDuration(n){if(n==null)return null;if(isObject$3(n))return[NumberOf(n.enter),NumberOf(n.leave)];{const e=NumberOf(n);return[e,e]}}function NumberOf(n){return toNumber(n)}function addTransitionClass(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[vtcKey]||(n[vtcKey]=new Set)).add(e)}function removeTransitionClass(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[vtcKey];t&&(t.delete(e),t.size||(n[vtcKey]=void 0))}function nextFrame(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let endId=0;function whenTransitionEnds(n,e,t,i){const s=n._endId=++endId,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=getTransitionInfo(n,e);if(!o)return i();const c=o+"end";let d=0;const u=()=>{n.removeEventListener(c,f),r()},f=g=>{g.target===n&&++d>=l&&u()};setTimeout(()=>{d(t[m]||"").split(", "),s=i(`${TRANSITION$2}Delay`),r=i(`${TRANSITION$2}Duration`),o=getTimeout(s,r),a=i(`${ANIMATION}Delay`),l=i(`${ANIMATION}Duration`),c=getTimeout(a,l);let d=null,u=0,f=0;e===TRANSITION$2?o>0&&(d=TRANSITION$2,u=o,f=r.length):e===ANIMATION?c>0&&(d=ANIMATION,u=c,f=l.length):(u=Math.max(o,c),d=u>0?o>c?TRANSITION$2:ANIMATION:null,f=d?d===TRANSITION$2?r.length:l.length:0);const g=d===TRANSITION$2&&/\b(transform|all)(,|$)/.test(i(`${TRANSITION$2}Property`).toString());return{type:d,timeout:u,propCount:f,hasTransform:g}}function getTimeout(n,e){for(;n.lengthtoMs(t)+toMs(n[i])))}function toMs(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function forceReflow(){return document.body.offsetHeight}function patchClass(n,e,t){const i=n[vtcKey];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const vShowOriginalDisplay=Symbol("_vod"),vShowHidden=Symbol("_vsh"),vShow={beforeMount(n,{value:e},{transition:t}){n[vShowOriginalDisplay]=n.style.display==="none"?"":n.style.display,t&&e?t.beforeEnter(n):setDisplay(n,e)},mounted(n,{value:e},{transition:t}){t&&e&&t.enter(n)},updated(n,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(n),setDisplay(n,!0),i.enter(n)):i.leave(n,()=>{setDisplay(n,!1)}):setDisplay(n,e))},beforeUnmount(n,{value:e}){setDisplay(n,e)}};function setDisplay(n,e){n.style.display=e?n[vShowOriginalDisplay]:"none",n[vShowHidden]=!e}function initVShowForSSR(){vShow.getSSRProps=({value:n})=>{if(!n)return{style:{display:"none"}}}}const CSS_VAR_TEXT=Symbol("");function useCssVars(n){const e=getCurrentInstance();if(!e)return;const t=e.ut=(s=n(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(r=>setVarsOnNode(r,s))},i=()=>{const s=n(e.proxy);e.ce?setVarsOnNode(e.ce,s):setVarsOnVNode(e.subTree,s),t(s)};onBeforeUpdate(()=>{queuePostFlushCb(i)}),onMounted(()=>{watch(i,NOOP$1,{flush:"post"});const s=new MutationObserver(i);s.observe(e.subTree.el.parentNode,{childList:!0}),onUnmounted(()=>s.disconnect())})}function setVarsOnVNode(n,e){if(n.shapeFlag&128){const t=n.suspense;n=t.activeBranch,t.pendingBranch&&!t.isHydrating&&t.effects.push(()=>{setVarsOnVNode(t.activeBranch,e)})}for(;n.component;)n=n.component.subTree;if(n.shapeFlag&1&&n.el)setVarsOnNode(n.el,e);else if(n.type===Fragment)n.children.forEach(t=>setVarsOnVNode(t,e));else if(n.type===Static){let{el:t,anchor:i}=n;for(;t&&(setVarsOnNode(t,e),t!==i);)t=t.nextSibling}}function setVarsOnNode(n,e){if(n.nodeType===1){const t=n.style;let i="";for(const s in e)t.setProperty(`--${s}`,e[s]),i+=`--${s}: ${e[s]};`;t[CSS_VAR_TEXT]=i}}const displayRE=/(^|;)\s*display\s*:/;function patchStyle(n,e,t){const i=n.style,s=isString$4(t);let r=!1;if(t&&!s){if(e)if(isString$4(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&setStyle(i,a,"")}else for(const o in e)t[o]==null&&setStyle(i,o,"");for(const o in t)o==="display"&&(r=!0),setStyle(i,o,t[o])}else if(s){if(e!==t){const o=i[CSS_VAR_TEXT];o&&(t+=";"+o),i.cssText=t,r=displayRE.test(t)}}else e&&n.removeAttribute("style");vShowOriginalDisplay in n&&(n[vShowOriginalDisplay]=r?i.display:"",n[vShowHidden]&&(i.display="none"))}const importantRE=/\s*!important$/;function setStyle(n,e,t){if(isArray$4(t))t.forEach(i=>setStyle(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=autoPrefix(n,e);importantRE.test(t)?n.setProperty(hyphenate$1(i),t.replace(importantRE,""),"important"):n[i]=t}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(n,e){const t=prefixCache[e];if(t)return t;let i=camelize$1(e);if(i!=="filter"&&i in n)return prefixCache[e]=i;i=capitalize$1(i);for(let s=0;scachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(i,t.value),e,5,[i])};return t.value=n,t.attached=getNow(),t}function patchStopImmediatePropagation(n,e){if(isArray$4(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const isNativeOn=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,patchProp=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?patchClass(n,i,o):e==="style"?patchStyle(n,t,i):isOn$1(e)?isModelListener(e)||patchEvent(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):shouldSetAsProp(n,e,i,o))?(patchDOMProp(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&patchAttr(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!isString$4(i))?patchDOMProp(n,camelize$1(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),patchAttr(n,e,i,o))};function shouldSetAsProp(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&isNativeOn(e)&&isFunction$3(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return isNativeOn(e)&&isString$4(t)?!1:e in n}const REMOVAL={};/*! #__NO_SIDE_EFFECTS__ */function defineCustomElement(n,e,t){const i=defineComponent(n,e);isPlainObject$1(i)&&extend$1(i,e);class s extends VueElement{constructor(o){super(i,o,t)}}return s.def=i,s}/*! #__NO_SIDE_EFFECTS__ */const defineSSRCustomElement=(n,e)=>defineCustomElement(n,e,createSSRApp),BaseClass$1=typeof HTMLElement<"u"?HTMLElement:class{};class VueElement extends BaseClass$1{constructor(e,t={},i=createApp){super(),this._def=e,this._props=t,this._createApp=i,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&i!==createApp?this._root=this.shadowRoot:e.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof VueElement){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,nextTick$1(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let i=0;i{for(const s of i)this._setAttr(s.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(i,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:r,styles:o}=i;let a;if(r&&!isArray$4(r))for(const l in r){const c=r[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=toNumber(this._props[l])),(a||(a=Object.create(null)))[camelize$1(l)]=!0)}this._numberProps=a,s&&this._resolveProps(i),this.shadowRoot&&this._applyStyles(o),this._mount(i)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(i=>e(this._def=i,!0)):e(this._def)}_mount(e){this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const t=this._instance&&this._instance.exposed;if(t)for(const i in t)hasOwn$1(this,i)||Object.defineProperty(this,i,{get:()=>unref(t[i])})}_resolveProps(e){const{props:t}=e,i=isArray$4(t)?t:Object.keys(t||{});for(const s of Object.keys(this))s[0]!=="_"&&i.includes(s)&&this._setProp(s,this[s]);for(const s of i.map(camelize$1))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(r){this._setProp(s,r,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const t=this.hasAttribute(e);let i=t?this.getAttribute(e):REMOVAL;const s=camelize$1(e);t&&this._numberProps&&this._numberProps[s]&&(i=toNumber(i)),this._setProp(s,i,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,i=!0,s=!1){if(t!==this._props[e]&&(t===REMOVAL?delete this._props[e]:(this._props[e]=t,e==="key"&&this._app&&(this._app._ceVNode.key=t)),s&&this._instance&&this._update(),i)){const r=this._ob;r&&r.disconnect(),t===!0?this.setAttribute(hyphenate$1(e),""):typeof t=="string"||typeof t=="number"?this.setAttribute(hyphenate$1(e),t+""):t||this.removeAttribute(hyphenate$1(e)),r&&r.observe(this,{attributes:!0})}}_update(){render(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const t=createVNode(this._def,extend$1(e,this._props));return this._instance||(t.ce=i=>{this._instance=i,i.ce=this,i.isCE=!0;const s=(r,o)=>{this.dispatchEvent(new CustomEvent(r,isPlainObject$1(o[0])?extend$1({detail:o},o[0]):{detail:o}))};i.emit=(r,...o)=>{s(r,o),hyphenate$1(r)!==r&&s(hyphenate$1(r),o)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}const i=this._nonce;for(let s=e.length-1;s>=0;s--){const r=document.createElement("style");i&&r.setAttribute("nonce",i),r.textContent=e[s],this.shadowRoot.prepend(r)}}_parseSlots(){const e=this._slots={};let t;for(;t=this.firstChild;){const i=t.nodeType===1&&t.getAttribute("slot")||"default";(e[i]||(e[i]=[])).push(t),this.removeChild(t)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let i=0;i(delete n.props.mode,n),TransitionGroupImpl=decorate({name:"TransitionGroup",props:extend$1({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(n,{slots:e}){const t=getCurrentInstance(),i=useTransitionState();let s,r;return onUpdated(()=>{if(!s.length)return;const o=n.moveClass||`${n.name||"v"}-move`;if(!hasCSSTransform(s[0].el,t.vnode.el,o))return;s.forEach(callPendingCbs),s.forEach(recordPosition);const a=s.filter(applyTranslation);forceReflow(),a.forEach(l=>{const c=l.el,d=c.style;addTransitionClass(c,o),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[moveCbKey]=f=>{f&&f.target!==c||(!f||/transform$/.test(f.propertyName))&&(c.removeEventListener("transitionend",u),c[moveCbKey]=null,removeTransitionClass(c,o))};c.addEventListener("transitionend",u)})}),()=>{const o=toRaw(n),a=resolveTransitionProps(o);let l=o.tag||Fragment;if(s=[],r)for(let c=0;c{a.split(/\s+/).forEach(l=>l&&i.classList.remove(l))}),t.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(i);const{hasTransform:o}=getTransitionInfo(i);return r.removeChild(i),o}const getModelAssigner=n=>{const e=n.props["onUpdate:modelValue"]||!1;return isArray$4(e)?t=>invokeArrayFns(e,t):e};function onCompositionStart(n){n.target.composing=!0}function onCompositionEnd(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const assignKey=Symbol("_assign"),vModelText={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[assignKey]=getModelAssigner(s);const r=i||s.props&&s.props.type==="number";addEventListener(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=looseToNumber(a)),n[assignKey](a)}),t&&addEventListener(n,"change",()=>{n.value=n.value.trim()}),e||(addEventListener(n,"compositionstart",onCompositionStart),addEventListener(n,"compositionend",onCompositionEnd),addEventListener(n,"change",onCompositionEnd))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[assignKey]=getModelAssigner(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?looseToNumber(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},vModelCheckbox={deep:!0,created(n,e,t){n[assignKey]=getModelAssigner(t),addEventListener(n,"change",()=>{const i=n._modelValue,s=getValue(n),r=n.checked,o=n[assignKey];if(isArray$4(i)){const a=looseIndexOf(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(isSet$1(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(getCheckboxValue(n,r))})},mounted:setChecked,beforeUpdate(n,e,t){n[assignKey]=getModelAssigner(t),setChecked(n,e,t)}};function setChecked(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(isArray$4(e))s=looseIndexOf(e,i.props.value)>-1;else if(isSet$1(e))s=e.has(i.props.value);else{if(e===t)return;s=looseEqual(e,getCheckboxValue(n,!0))}n.checked!==s&&(n.checked=s)}const vModelRadio={created(n,{value:e},t){n.checked=looseEqual(e,t.props.value),n[assignKey]=getModelAssigner(t),addEventListener(n,"change",()=>{n[assignKey](getValue(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[assignKey]=getModelAssigner(i),e!==t&&(n.checked=looseEqual(e,i.props.value))}},vModelSelect={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=isSet$1(e);addEventListener(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?looseToNumber(getValue(o)):getValue(o));n[assignKey](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,nextTick$1(()=>{n._assigning=!1})}),n[assignKey]=getModelAssigner(i)},mounted(n,{value:e}){setSelected(n,e)},beforeUpdate(n,e,t){n[assignKey]=getModelAssigner(t)},updated(n,{value:e}){n._assigning||setSelected(n,e)}};function setSelected(n,e){const t=n.multiple,i=isArray$4(e);if(!(t&&!i&&!isSet$1(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=looseIndexOf(e,a)>-1}else o.selected=e.has(a);else if(looseEqual(getValue(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function getValue(n){return"_value"in n?n._value:n.value}function getCheckboxValue(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const vModelDynamic={created(n,e,t){callModelHook(n,e,t,null,"created")},mounted(n,e,t){callModelHook(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){callModelHook(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){callModelHook(n,e,t,i,"updated")}};function resolveDynamicModel(n,e){switch(n){case"SELECT":return vModelSelect;case"TEXTAREA":return vModelText;default:switch(e){case"checkbox":return vModelCheckbox;case"radio":return vModelRadio;default:return vModelText}}}function callModelHook(n,e,t,i,s){const o=resolveDynamicModel(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}function initVModelForSSR(){vModelText.getSSRProps=({value:n})=>({value:n}),vModelRadio.getSSRProps=({value:n},e)=>{if(e.props&&looseEqual(e.props.value,n))return{checked:!0}},vModelCheckbox.getSSRProps=({value:n},e)=>{if(isArray$4(n)){if(e.props&&looseIndexOf(n,e.props.value)>-1)return{checked:!0}}else if(isSet$1(n)){if(e.props&&n.has(e.props.value))return{checked:!0}}else if(n)return{checked:!0}},vModelDynamic.getSSRProps=(n,e)=>{if(typeof e.type!="string")return;const t=resolveDynamicModel(e.type.toUpperCase(),e.props&&e.props.type);if(t.getSSRProps)return t.getSSRProps(n,e)}}const systemModifiers=["ctrl","shift","alt","meta"],modifierGuards={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>systemModifiers.some(t=>n[`${t}Key`]&&!e.includes(t))},withModifiers=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=hyphenate$1(s.key);if(e.some(o=>o===r||keyNames[o]===r))return n(s)})},rendererOptions=extend$1({patchProp},nodeOps);let renderer,enabledHydration=!1;function ensureRenderer(){return renderer||(renderer=createRenderer$1(rendererOptions))}function ensureHydrationRenderer(){return renderer=enabledHydration?renderer:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer}const render=(...n)=>{ensureRenderer().render(...n)},hydrate=(...n)=>{ensureHydrationRenderer().hydrate(...n)},createApp=(...n)=>{const e=ensureRenderer().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=normalizeContainer(i);if(!s)return;const r=e._component;!isFunction$3(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,resolveRootNamespace(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e},createSSRApp=(...n)=>{const e=ensureHydrationRenderer().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=normalizeContainer(i);if(s)return t(s,!0,resolveRootNamespace(s))},e};function resolveRootNamespace(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function normalizeContainer(n){return isString$4(n)?document.querySelector(n):n}let ssrDirectiveInitialized=!1;const initDirectivesForSSR=()=>{ssrDirectiveInitialized||(ssrDirectiveInitialized=!0,initVModelForSSR(),initVShowForSSR())},runtimeDom=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition,BaseTransitionPropsValidators,Comment,DeprecationTypes,EffectScope,ErrorCodes:ErrorCodes$1,ErrorTypeStrings,Fragment,KeepAlive,ReactiveEffect,Static,Suspense,Teleport,Text:Text$1,TrackOpTypes,Transition,TransitionGroup,TriggerOpTypes,VueElement,assertNumber,callWithAsyncErrorHandling,callWithErrorHandling,camelize:camelize$1,capitalize:capitalize$1,cloneVNode,compatUtils,computed,createApp,createBlock:createBlock$1,createCommentVNode,createElementBlock,createElementVNode:createBaseVNode,createHydrationRenderer,createPropsRestProxy,createRenderer:createRenderer$1,createSSRApp,createSlots,createStaticVNode,createTextVNode,createVNode,customRef,defineAsyncComponent,defineComponent,defineCustomElement,defineEmits,defineExpose,defineModel,defineOptions,defineProps,defineSSRCustomElement,defineSlots,devtools,effect,effectScope,getCurrentInstance,getCurrentScope,getCurrentWatcher,getTransitionRawChildren,guardReactiveProps,h:h$1,handleError,hasInjectionContext,hydrate,hydrateOnIdle,hydrateOnInteraction,hydrateOnMediaQuery,hydrateOnVisible,initCustomFormatter,initDirectivesForSSR,inject,isMemoSame,isProxy,isReactive,isReadonly,isRef:isRef$1,isRuntimeOnly,isShallow,isVNode,markRaw,mergeDefaults,mergeModels,mergeProps,nextTick:nextTick$1,normalizeClass:normalizeClass$1,normalizeProps,normalizeStyle:normalizeStyle$1,onActivated,onBeforeMount,onBeforeUnmount,onBeforeUpdate,onDeactivated,onErrorCaptured,onMounted,onRenderTracked,onRenderTriggered,onScopeDispose,onServerPrefetch,onUnmounted,onUpdated,onWatcherCleanup,openBlock,popScopeId,provide,proxyRefs,pushScopeId,queuePostFlushCb,reactive,readonly,ref,registerRuntimeCompiler,render,renderList,renderSlot,resolveComponent,resolveDirective,resolveDynamicComponent,resolveFilter,resolveTransitionHooks,setBlockTracking,setDevtoolsHook,setTransitionHooks,shallowReactive,shallowReadonly,shallowRef,ssrContextKey,ssrUtils,stop,toDisplayString:toDisplayString$1,toHandlerKey:toHandlerKey$1,toHandlers,toRaw,toRef,toRefs,toValue,transformVNodeArgs,triggerRef,unref,useAttrs,useCssModule,useCssVars,useHost,useId,useModel,useSSRContext,useShadowRoot,useSlots,useTemplateRef,useTransitionState,vModelCheckbox,vModelDynamic,vModelRadio,vModelSelect,vModelText,vShow,version,warn,watch,watchEffect,watchPostEffect,watchSyncEffect,withAsyncContext,withCtx,withDefaults,withDirectives,withKeys,withMemo,withModifiers,withScopeId},Symbol.toStringTag,{value:"Module"}));/** +* @vue/compiler-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const FRAGMENT$1=Symbol(""),TELEPORT$1=Symbol(""),SUSPENSE$1=Symbol(""),KEEP_ALIVE$1=Symbol(""),BASE_TRANSITION$1=Symbol(""),OPEN_BLOCK$1=Symbol(""),CREATE_BLOCK$1=Symbol(""),CREATE_ELEMENT_BLOCK$1=Symbol(""),CREATE_VNODE$1=Symbol(""),CREATE_ELEMENT_VNODE$1=Symbol(""),CREATE_COMMENT$1=Symbol(""),CREATE_TEXT$1=Symbol(""),CREATE_STATIC$1=Symbol(""),RESOLVE_COMPONENT$1=Symbol(""),RESOLVE_DYNAMIC_COMPONENT$1=Symbol(""),RESOLVE_DIRECTIVE$1=Symbol(""),RESOLVE_FILTER$1=Symbol(""),WITH_DIRECTIVES$1=Symbol(""),RENDER_LIST$1=Symbol(""),RENDER_SLOT$1=Symbol(""),CREATE_SLOTS$1=Symbol(""),TO_DISPLAY_STRING$1=Symbol(""),MERGE_PROPS$1=Symbol(""),NORMALIZE_CLASS$1=Symbol(""),NORMALIZE_STYLE$1=Symbol(""),NORMALIZE_PROPS$1=Symbol(""),GUARD_REACTIVE_PROPS$1=Symbol(""),TO_HANDLERS$1=Symbol(""),CAMELIZE$1=Symbol(""),CAPITALIZE$1=Symbol(""),TO_HANDLER_KEY$1=Symbol(""),SET_BLOCK_TRACKING$1=Symbol(""),PUSH_SCOPE_ID$1=Symbol(""),POP_SCOPE_ID$1=Symbol(""),WITH_CTX$1=Symbol(""),UNREF$1=Symbol(""),IS_REF$1=Symbol(""),WITH_MEMO$1=Symbol(""),IS_MEMO_SAME$1=Symbol(""),helperNameMap$1={[FRAGMENT$1]:"Fragment",[TELEPORT$1]:"Teleport",[SUSPENSE$1]:"Suspense",[KEEP_ALIVE$1]:"KeepAlive",[BASE_TRANSITION$1]:"BaseTransition",[OPEN_BLOCK$1]:"openBlock",[CREATE_BLOCK$1]:"createBlock",[CREATE_ELEMENT_BLOCK$1]:"createElementBlock",[CREATE_VNODE$1]:"createVNode",[CREATE_ELEMENT_VNODE$1]:"createElementVNode",[CREATE_COMMENT$1]:"createCommentVNode",[CREATE_TEXT$1]:"createTextVNode",[CREATE_STATIC$1]:"createStaticVNode",[RESOLVE_COMPONENT$1]:"resolveComponent",[RESOLVE_DYNAMIC_COMPONENT$1]:"resolveDynamicComponent",[RESOLVE_DIRECTIVE$1]:"resolveDirective",[RESOLVE_FILTER$1]:"resolveFilter",[WITH_DIRECTIVES$1]:"withDirectives",[RENDER_LIST$1]:"renderList",[RENDER_SLOT$1]:"renderSlot",[CREATE_SLOTS$1]:"createSlots",[TO_DISPLAY_STRING$1]:"toDisplayString",[MERGE_PROPS$1]:"mergeProps",[NORMALIZE_CLASS$1]:"normalizeClass",[NORMALIZE_STYLE$1]:"normalizeStyle",[NORMALIZE_PROPS$1]:"normalizeProps",[GUARD_REACTIVE_PROPS$1]:"guardReactiveProps",[TO_HANDLERS$1]:"toHandlers",[CAMELIZE$1]:"camelize",[CAPITALIZE$1]:"capitalize",[TO_HANDLER_KEY$1]:"toHandlerKey",[SET_BLOCK_TRACKING$1]:"setBlockTracking",[PUSH_SCOPE_ID$1]:"pushScopeId",[POP_SCOPE_ID$1]:"popScopeId",[WITH_CTX$1]:"withCtx",[UNREF$1]:"unref",[IS_REF$1]:"isRef",[WITH_MEMO$1]:"withMemo",[IS_MEMO_SAME$1]:"isMemoSame"};function registerRuntimeHelpers$1(n){Object.getOwnPropertySymbols(n).forEach(e=>{helperNameMap$1[e]=n[e]})}const locStub$1={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function createRoot$1(n,e=""){return{type:0,source:e,children:n,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:locStub$1}}function createVNodeCall$1(n,e,t,i,s,r,o,a=!1,l=!1,c=!1,d=locStub$1){return n&&(a?(n.helper(OPEN_BLOCK$1),n.helper(getVNodeBlockHelper$1(n.inSSR,c))):n.helper(getVNodeHelper$1(n.inSSR,c)),o&&n.helper(WITH_DIRECTIVES$1)),{type:13,tag:e,props:t,children:i,patchFlag:s,dynamicProps:r,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:d}}function createArrayExpression$1(n,e=locStub$1){return{type:17,loc:e,elements:n}}function createObjectExpression$1(n,e=locStub$1){return{type:15,loc:e,properties:n}}function createObjectProperty$1(n,e){return{type:16,loc:locStub$1,key:isString$4(n)?createSimpleExpression$1(n,!0):n,value:e}}function createSimpleExpression$1(n,e=!1,t=locStub$1,i=0){return{type:4,loc:t,content:n,isStatic:e,constType:e?3:i}}function createCompoundExpression$1(n,e=locStub$1){return{type:8,loc:e,children:n}}function createCallExpression$1(n,e=[],t=locStub$1){return{type:14,loc:t,callee:n,arguments:e}}function createFunctionExpression$1(n,e=void 0,t=!1,i=!1,s=locStub$1){return{type:18,params:n,returns:e,newline:t,isSlot:i,loc:s}}function createConditionalExpression$1(n,e,t,i=!0){return{type:19,test:n,consequent:e,alternate:t,newline:i,loc:locStub$1}}function createCacheExpression$1(n,e,t=!1,i=!1){return{type:20,index:n,value:e,needPauseTracking:t,inVOnce:i,needArraySpread:!1,loc:locStub$1}}function createBlockStatement$1(n){return{type:21,body:n,loc:locStub$1}}function getVNodeHelper$1(n,e){return n||e?CREATE_VNODE$1:CREATE_ELEMENT_VNODE$1}function getVNodeBlockHelper$1(n,e){return n||e?CREATE_BLOCK$1:CREATE_ELEMENT_BLOCK$1}function convertToBlock$1(n,{helper:e,removeHelper:t,inSSR:i}){n.isBlock||(n.isBlock=!0,t(getVNodeHelper$1(i,n.isComponent)),e(OPEN_BLOCK$1),e(getVNodeBlockHelper$1(i,n.isComponent)))}const defaultDelimitersOpen$1=new Uint8Array([123,123]),defaultDelimitersClose$1=new Uint8Array([125,125]);function isTagStartChar$1(n){return n>=97&&n<=122||n>=65&&n<=90}function isWhitespace$2(n){return n===32||n===10||n===9||n===12||n===13}function isEndOfTagSection$1(n){return n===47||n===62||isWhitespace$2(n)}function toCharCodes$1(n){const e=new Uint8Array(n.length);for(let t=0;t=0;s--){const r=this.newlines[s];if(e>r){t=s+2,i=e-r;break}}return{column:i,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const t=this.index+1-this.delimiterOpen.length;t>this.sectionStart&&this.cbs.ontext(this.sectionStart,t),this.state=3,this.sectionStart=t}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(!(t?isEndOfTagSection$1(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!t){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||isWhitespace$2(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===Sequences$1.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}};function getCompatValue$1(n,{compatConfig:e}){const t=e&&e[n];return n==="MODE"?t||3:t}function isCompatEnabled$1(n,e){const t=getCompatValue$1("MODE",e),i=getCompatValue$1(n,e);return t===3?i===!0:i!==!1}function checkCompatEnabled$1(n,e,t,...i){return isCompatEnabled$1(n,e)}function defaultOnError$1(n){throw n}function defaultOnWarn$1(n){}function createCompilerError$1(n,e,t,i){const s=`https://vuejs.org/error-reference/#compiler-${n}`,r=new SyntaxError(String(s));return r.code=n,r.loc=e,r}const isStaticExp$1=n=>n.type===4&&n.isStatic;function isCoreComponent$1(n){switch(n){case"Teleport":case"teleport":return TELEPORT$1;case"Suspense":case"suspense":return SUSPENSE$1;case"KeepAlive":case"keep-alive":return KEEP_ALIVE$1;case"BaseTransition":case"base-transition":return BASE_TRANSITION$1}}const nonIdentifierRE$1=/^\d|[^\$\w\xA0-\uFFFF]/,isSimpleIdentifier$1=n=>!nonIdentifierRE$1.test(n),validFirstIdentCharRE$1=/[A-Za-z_$\xA0-\uFFFF]/,validIdentCharRE$1=/[\.\?\w$\xA0-\uFFFF]/,whitespaceRE$1=/\s+[.[]\s*|\s*[.[]\s+/g,getExpSource$1=n=>n.type===4?n.content:n.loc.source,isMemberExpressionBrowser$1=n=>{const e=getExpSource$1(n).trim().replace(whitespaceRE$1,a=>a.trim());let t=0,i=[],s=0,r=0,o=null;for(let a=0;a|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,isFnExpressionBrowser$1=n=>fnExpRE$1.test(getExpSource$1(n)),isFnExpression$1=isFnExpressionBrowser$1;function findDir$1(n,e,t=!1){for(let i=0;ie.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function isText$1$1(n){return n.type===5||n.type===2}function isVSlot$1(n){return n.type===7&&n.name==="slot"}function isTemplateNode$1(n){return n.type===1&&n.tagType===3}function isSlotOutlet$1(n){return n.type===1&&n.tagType===2}const propsHelperSet$1=new Set([NORMALIZE_PROPS$1,GUARD_REACTIVE_PROPS$1]);function getUnnormalizedProps$1(n,e=[]){if(n&&!isString$4(n)&&n.type===14){const t=n.callee;if(!isString$4(t)&&propsHelperSet$1.has(t))return getUnnormalizedProps$1(n.arguments[0],e.concat(n))}return[n,e]}function injectProp$1(n,e,t){let i,s=n.type===13?n.props:n.arguments[2],r=[],o;if(s&&!isString$4(s)&&s.type===14){const a=getUnnormalizedProps$1(s);s=a[0],r=a[1],o=r[r.length-1]}if(s==null||isString$4(s))i=createObjectExpression$1([e]);else if(s.type===14){const a=s.arguments[0];!isString$4(a)&&a.type===15?hasProp$1(e,a)||a.properties.unshift(e):s.callee===TO_HANDLERS$1?i=createCallExpression$1(t.helper(MERGE_PROPS$1),[createObjectExpression$1([e]),s]):s.arguments.unshift(createObjectExpression$1([e])),!i&&(i=s)}else s.type===15?(hasProp$1(e,s)||s.properties.unshift(e),i=s):(i=createCallExpression$1(t.helper(MERGE_PROPS$1),[createObjectExpression$1([e]),s]),o&&o.callee===GUARD_REACTIVE_PROPS$1&&(o=r[r.length-2]));n.type===13?o?o.arguments[0]=i:n.props=i:o?o.arguments[0]=i:n.arguments[2]=i}function hasProp$1(n,e){let t=!1;if(n.key.type===4){const i=n.key.content;t=e.properties.some(s=>s.key.type===4&&s.key.content===i)}return t}function toValidAssetId$1(n,e){return`_${e}_${n.replace(/[^\w]/g,(t,i)=>t==="-"?"_":n.charCodeAt(i).toString())}`}function getMemoedVNodeCall$1(n){return n.type===14&&n.callee===WITH_MEMO$1?n.arguments[1].returns:n}const forAliasRE$1=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,defaultParserOptions$1={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:NO$1,isPreTag:NO$1,isIgnoreNewlineTag:NO$1,isCustomElement:NO$1,onError:defaultOnError$1,onWarn:defaultOnWarn$1,comments:!1,prefixIdentifiers:!1};let currentOptions$1=defaultParserOptions$1,currentRoot$1=null,currentInput$1="",currentOpenTag$1=null,currentProp$1=null,currentAttrValue$1="",currentAttrStartIndex$1=-1,currentAttrEndIndex$1=-1,inPre$1=0,inVPre$1=!1,currentVPreBoundary$1=null;const stack$1=[],tokenizer$1=new Tokenizer$1(stack$1,{onerr:emitError$1,ontext(n,e){onText$1(getSlice$1(n,e),n,e)},ontextentity(n,e,t){onText$1(n,e,t)},oninterpolation(n,e){if(inVPre$1)return onText$1(getSlice$1(n,e),n,e);let t=n+tokenizer$1.delimiterOpen.length,i=e-tokenizer$1.delimiterClose.length;for(;isWhitespace$2(currentInput$1.charCodeAt(t));)t++;for(;isWhitespace$2(currentInput$1.charCodeAt(i-1));)i--;let s=getSlice$1(t,i);s.includes("&")&&(s=currentOptions$1.decodeEntities(s,!1)),addNode$1({type:5,content:createExp$1(s,!1,getLoc$1(t,i)),loc:getLoc$1(n,e)})},onopentagname(n,e){const t=getSlice$1(n,e);currentOpenTag$1={type:1,tag:t,ns:currentOptions$1.getNamespace(t,stack$1[0],currentOptions$1.ns),tagType:0,props:[],children:[],loc:getLoc$1(n-1,e),codegenNode:void 0}},onopentagend(n){endOpenTag$1(n)},onclosetag(n,e){const t=getSlice$1(n,e);if(!currentOptions$1.isVoidTag(t)){let i=!1;for(let s=0;s0&&emitError$1(24,stack$1[0].loc.start.offset);for(let o=0;o<=s;o++){const a=stack$1.shift();onCloseTag$1(a,e,o(i.type===7?i.rawName:i.name)===t)&&emitError$1(2,e)},onattribend(n,e){if(currentOpenTag$1&¤tProp$1){if(setLocEnd$1(currentProp$1.loc,e),n!==0)if(currentAttrValue$1.includes("&")&&(currentAttrValue$1=currentOptions$1.decodeEntities(currentAttrValue$1,!0)),currentProp$1.type===6)currentProp$1.name==="class"&&(currentAttrValue$1=condense$1(currentAttrValue$1).trim()),n===1&&!currentAttrValue$1&&emitError$1(13,e),currentProp$1.value={type:2,content:currentAttrValue$1,loc:n===1?getLoc$1(currentAttrStartIndex$1,currentAttrEndIndex$1):getLoc$1(currentAttrStartIndex$1-1,currentAttrEndIndex$1+1)},tokenizer$1.inSFCRoot&¤tOpenTag$1.tag==="template"&¤tProp$1.name==="lang"&¤tAttrValue$1&¤tAttrValue$1!=="html"&&tokenizer$1.enterRCDATA(toCharCodes$1("s.content==="sync"))>-1&&checkCompatEnabled$1("COMPILER_V_BIND_SYNC",currentOptions$1,currentProp$1.loc,currentProp$1.rawName)&&(currentProp$1.name="model",currentProp$1.modifiers.splice(i,1))}(currentProp$1.type!==7||currentProp$1.name!=="pre")&¤tOpenTag$1.props.push(currentProp$1)}currentAttrValue$1="",currentAttrStartIndex$1=currentAttrEndIndex$1=-1},oncomment(n,e){currentOptions$1.comments&&addNode$1({type:3,content:getSlice$1(n,e),loc:getLoc$1(n-4,e+3)})},onend(){const n=currentInput$1.length;for(let e=0;e{const m=e.start.offset+f,_=m+u.length;return createExp$1(u,!1,getLoc$1(m,_),0,g?1:0)},a={source:o(r.trim(),t.indexOf(r,s.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let l=s.trim().replace(stripParensRE$1,"").trim();const c=s.indexOf(l),d=l.match(forIteratorRE$1);if(d){l=l.replace(forIteratorRE$1,"").trim();const u=d[1].trim();let f;if(u&&(f=t.indexOf(u,c+l.length),a.key=o(u,f,!0)),d[2]){const g=d[2].trim();g&&(a.index=o(g,t.indexOf(g,a.key?f+u.length:c+l.length),!0))}}return l&&(a.value=o(l,c,!0)),a}function getSlice$1(n,e){return currentInput$1.slice(n,e)}function endOpenTag$1(n){tokenizer$1.inSFCRoot&&(currentOpenTag$1.innerLoc=getLoc$1(n+1,n+1)),addNode$1(currentOpenTag$1);const{tag:e,ns:t}=currentOpenTag$1;t===0&¤tOptions$1.isPreTag(e)&&inPre$1++,currentOptions$1.isVoidTag(e)?onCloseTag$1(currentOpenTag$1,n):(stack$1.unshift(currentOpenTag$1),(t===1||t===2)&&(tokenizer$1.inXML=!0)),currentOpenTag$1=null}function onText$1(n,e,t){{const r=stack$1[0]&&stack$1[0].tag;r!=="script"&&r!=="style"&&n.includes("&")&&(n=currentOptions$1.decodeEntities(n,!1))}const i=stack$1[0]||currentRoot$1,s=i.children[i.children.length-1];s&&s.type===2?(s.content+=n,setLocEnd$1(s.loc,t)):i.children.push({type:2,content:n,loc:getLoc$1(e,t)})}function onCloseTag$1(n,e,t=!1){t?setLocEnd$1(n.loc,backTrack$1(e,60)):setLocEnd$1(n.loc,lookAhead$1(e,62)+1),tokenizer$1.inSFCRoot&&(n.children.length?n.innerLoc.end=extend$1({},n.children[n.children.length-1].loc.end):n.innerLoc.end=extend$1({},n.innerLoc.start),n.innerLoc.source=getSlice$1(n.innerLoc.start.offset,n.innerLoc.end.offset));const{tag:i,ns:s,children:r}=n;if(inVPre$1||(i==="slot"?n.tagType=2:isFragmentTemplate$1(n)?n.tagType=3:isComponent$1(n)&&(n.tagType=1)),tokenizer$1.inRCDATA||(n.children=condenseWhitespace$1(r)),s===0&¤tOptions$1.isIgnoreNewlineTag(i)){const o=r[0];o&&o.type===2&&(o.content=o.content.replace(/^\r?\n/,""))}s===0&¤tOptions$1.isPreTag(i)&&inPre$1--,currentVPreBoundary$1===n&&(inVPre$1=tokenizer$1.inVPre=!1,currentVPreBoundary$1=null),tokenizer$1.inXML&&(stack$1[0]?stack$1[0].ns:currentOptions$1.ns)===0&&(tokenizer$1.inXML=!1);{const o=n.props;if(!tokenizer$1.inSFCRoot&&isCompatEnabled$1("COMPILER_NATIVE_TEMPLATE",currentOptions$1)&&n.tag==="template"&&!isFragmentTemplate$1(n)){const l=stack$1[0]||currentRoot$1,c=l.children.indexOf(n);l.children.splice(c,1,...n.children)}const a=o.find(l=>l.type===6&&l.name==="inline-template");a&&checkCompatEnabled$1("COMPILER_INLINE_TEMPLATE",currentOptions$1,a.loc)&&n.children.length&&(a.value={type:2,content:getSlice$1(n.children[0].loc.start.offset,n.children[n.children.length-1].loc.end.offset),loc:a.loc})}}function lookAhead$1(n,e){let t=n;for(;currentInput$1.charCodeAt(t)!==e&&t=0;)t--;return t}const specialTemplateDir$1=new Set(["if","else","else-if","for","slot"]);function isFragmentTemplate$1({tag:n,props:e}){if(n==="template"){for(let t=0;t64&&n<91}const windowsNewlineRE$1=/\r\n/g;function condenseWhitespace$1(n,e){const t=currentOptions$1.whitespace!=="preserve";let i=!1;for(let s=0;s0){if(f>=2){u.codegenNode.patchFlag=-1,o.push(u);continue}}else{const g=u.codegenNode;if(g.type===13){const m=g.patchFlag;if((m===void 0||m===512||m===1)&&getGeneratedPropsConstantType$1(u,t)>=2){const _=getNodeProps$1(u);_&&(g.props=t.hoist(_))}g.dynamicProps&&(g.dynamicProps=t.hoist(g.dynamicProps))}}}else if(u.type===12&&(i?0:getConstantType$1(u,t))>=2){o.push(u);continue}if(u.type===1){const f=u.tagType===1;f&&t.scopes.vSlot++,walk$3(u,n,t,!1,s),f&&t.scopes.vSlot--}else if(u.type===11)walk$3(u,n,t,u.children.length===1,!0);else if(u.type===9)for(let f=0;fg.key===u||g.key.content===u);return f&&f.value}}o.length&&t.transformHoist&&t.transformHoist(r,t,n)}function getConstantType$1(n,e){const{constantCache:t}=e;switch(n.type){case 1:if(n.tagType!==0)return 0;const i=t.get(n);if(i!==void 0)return i;const s=n.codegenNode;if(s.type!==13||s.isBlock&&n.tag!=="svg"&&n.tag!=="foreignObject"&&n.tag!=="math")return 0;if(s.patchFlag===void 0){let o=3;const a=getGeneratedPropsConstantType$1(n,e);if(a===0)return t.set(n,0),0;a1)for(let l=0;lB&&(T.childIndex--,T.onNodeRemoved()),T.parent.children.splice(B,1)},onNodeRemoved:NOOP$1,addIdentifiers(A){},removeIdentifiers(A){},hoist(A){isString$4(A)&&(A=createSimpleExpression$1(A)),T.hoists.push(A);const F=createSimpleExpression$1(`_hoisted_${T.hoists.length}`,!1,A.loc,2);return F.hoisted=A,F},cache(A,F=!1,B=!1){const W=createCacheExpression$1(T.cached.length,A,F,B);return T.cached.push(W),W}};return T.filters=new Set,T}function transform$1(n,e){const t=createTransformContext$1(n,e);traverseNode$1(n,t),e.hoistStatic&&cacheStatic$1(n,t),e.ssr||createRootCodegen$1(n,t),n.helpers=new Set([...t.helpers.keys()]),n.components=[...t.components],n.directives=[...t.directives],n.imports=t.imports,n.hoists=t.hoists,n.temps=t.temps,n.cached=t.cached,n.transformed=!0,n.filters=[...t.filters]}function createRootCodegen$1(n,e){const{helper:t}=e,{children:i}=n;if(i.length===1){const s=i[0];if(isSingleElementRoot$1(n,s)&&s.codegenNode){const r=s.codegenNode;r.type===13&&convertToBlock$1(r,e),n.codegenNode=r}else n.codegenNode=s}else if(i.length>1){let s=64;n.codegenNode=createVNodeCall$1(e,t(FRAGMENT$1),void 0,n.children,s,void 0,void 0,!0,void 0,!1)}}function traverseChildren$1(n,e){let t=0;const i=()=>{t--};for(;ti===n:i=>n.test(i);return(i,s)=>{if(i.type===1){const{props:r}=i;if(i.tagType===3&&r.some(isVSlot$1))return;const o=[];for(let a=0;a`${helperNameMap$1[n]}: _${helperNameMap$1[n]}`;function createCodegenContext$1(n,{mode:e="function",prefixIdentifiers:t=e==="module",sourceMap:i=!1,filename:s="template.vue.html",scopeId:r=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:c="vue/server-renderer",ssr:d=!1,isTS:u=!1,inSSR:f=!1}){const g={mode:e,prefixIdentifiers:t,sourceMap:i,filename:s,scopeId:r,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:c,ssr:d,isTS:u,inSSR:f,source:n.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(_){return`_${helperNameMap$1[_]}`},push(_,v=-2,C){g.code+=_},indent(){m(++g.indentLevel)},deindent(_=!1){_?--g.indentLevel:m(--g.indentLevel)},newline(){m(g.indentLevel)}};function m(_){g.push(` +`+" ".repeat(_),0)}return g}function generate$1(n,e={}){const t=createCodegenContext$1(n,e);e.onContextCreated&&e.onContextCreated(t);const{mode:i,push:s,prefixIdentifiers:r,indent:o,deindent:a,newline:l,scopeId:c,ssr:d}=t,u=Array.from(n.helpers),f=u.length>0,g=!r&&i!=="module";genFunctionPreamble$1(n,t);const _=d?"ssrRender":"render",C=(d?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(s(`function ${_}(${C}) {`),o(),g&&(s("with (_ctx) {"),o(),f&&(s(`const { ${u.map(aliasHelper$1).join(", ")} } = _Vue +`,-1),l())),n.components.length&&(genAssets$1(n.components,"component",t),(n.directives.length||n.temps>0)&&l()),n.directives.length&&(genAssets$1(n.directives,"directive",t),n.temps>0&&l()),n.filters&&n.filters.length&&(l(),genAssets$1(n.filters,"filter",t),l()),n.temps>0){s("let ");for(let S=0;S0?", ":""}_temp${S}`)}return(n.components.length||n.directives.length||n.temps)&&(s(` +`,0),l()),d||s("return "),n.codegenNode?genNode$1(n.codegenNode,t):s("null"),g&&(a(),s("}")),a(),s("}"),{ast:n,code:t.code,preamble:"",map:t.map?t.map.toJSON():void 0}}function genFunctionPreamble$1(n,e){const{ssr:t,prefixIdentifiers:i,push:s,newline:r,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=e,c=a,d=Array.from(n.helpers);if(d.length>0&&(s(`const _Vue = ${c} +`,-1),n.hoists.length)){const u=[CREATE_VNODE$1,CREATE_ELEMENT_VNODE$1,CREATE_COMMENT$1,CREATE_TEXT$1,CREATE_STATIC$1].filter(f=>d.includes(f)).map(aliasHelper$1).join(", ");s(`const { ${u} } = _Vue +`,-1)}genHoists$1(n.hoists,e),r(),s("return ")}function genAssets$1(n,e,{helper:t,push:i,newline:s,isTS:r}){const o=t(e==="filter"?RESOLVE_FILTER$1:e==="component"?RESOLVE_COMPONENT$1:RESOLVE_DIRECTIVE$1);for(let a=0;a3||!1;e.push("["),t&&e.indent(),genNodeList$1(n,e,t),t&&e.deindent(),e.push("]")}function genNodeList$1(n,e,t=!1,i=!0){const{push:s,newline:r}=e;for(let o=0;ot||"null")}function genCallExpression$1(n,e){const{push:t,helper:i,pure:s}=e,r=isString$4(n.callee)?n.callee:i(n.callee);s&&t(PURE_ANNOTATION$1),t(r+"(",-2,n),genNodeList$1(n.arguments,e),t(")")}function genObjectExpression$1(n,e){const{push:t,indent:i,deindent:s,newline:r}=e,{properties:o}=n;if(!o.length){t("{}",-2,n);return}const a=o.length>1||!1;t(a?"{":"{ "),a&&i();for(let l=0;l "),(l||a)&&(t("{"),i()),o?(l&&t("return "),isArray$4(o)?genNodeListAsArray$1(o,e):genNode$1(o,e)):a&&genNode$1(a,e),(l||a)&&(s(),t("}")),c&&(n.isNonScopedSlot&&t(", undefined, true"),t(")"))}function genConditionalExpression$1(n,e){const{test:t,consequent:i,alternate:s,newline:r}=n,{push:o,indent:a,deindent:l,newline:c}=e;if(t.type===4){const u=!isSimpleIdentifier$1(t.content);u&&o("("),genExpression$1(t,e),u&&o(")")}else o("("),genNode$1(t,e),o(")");r&&a(),e.indentLevel++,r||o(" "),o("? "),genNode$1(i,e),e.indentLevel--,r&&c(),r||o(" "),o(": ");const d=s.type===19;d||e.indentLevel++,genNode$1(s,e),d||e.indentLevel--,r&&l(!0)}function genCacheExpression$1(n,e){const{push:t,helper:i,indent:s,deindent:r,newline:o}=e,{needPauseTracking:a,needArraySpread:l}=n;l&&t("[...("),t(`_cache[${n.index}] || (`),a&&(s(),t(`${i(SET_BLOCK_TRACKING$1)}(-1`),n.inVOnce&&t(", true"),t("),"),o(),t("(")),t(`_cache[${n.index}] = `),genNode$1(n.value,e),a&&(t(`).cacheIndex = ${n.index},`),o(),t(`${i(SET_BLOCK_TRACKING$1)}(1),`),o(),t(`_cache[${n.index}]`),r()),t(")"),l&&t(")]")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const transformIf$1=createStructuralDirectiveTransform$1(/^(if|else|else-if)$/,(n,e,t)=>processIf$1(n,e,t,(i,s,r)=>{const o=t.parent.children;let a=o.indexOf(i),l=0;for(;a-->=0;){const c=o[a];c&&c.type===9&&(l+=c.branches.length)}return()=>{if(r)i.codegenNode=createCodegenNodeForBranch$1(s,l,t);else{const c=getParentCondition$1(i.codegenNode);c.alternate=createCodegenNodeForBranch$1(s,l+i.branches.length-1,t)}}}));function processIf$1(n,e,t,i){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const s=e.exp?e.exp.loc:n.loc;t.onError(createCompilerError$1(28,e.loc)),e.exp=createSimpleExpression$1("true",!1,s)}if(e.name==="if"){const s=createIfBranch$1(n,e),r={type:9,loc:cloneLoc$1(n.loc),branches:[s]};if(t.replaceNode(r),i)return i(r,s,!0)}else{const s=t.parent.children;let r=s.indexOf(n);for(;r-->=-1;){const o=s[r];if(o&&o.type===3){t.removeNode(o);continue}if(o&&o.type===2&&!o.content.trim().length){t.removeNode(o);continue}if(o&&o.type===9){e.name==="else-if"&&o.branches[o.branches.length-1].condition===void 0&&t.onError(createCompilerError$1(30,n.loc)),t.removeNode();const a=createIfBranch$1(n,e);o.branches.push(a);const l=i&&i(o,a,!1);traverseNode$1(a,t),l&&l(),t.currentNode=null}else t.onError(createCompilerError$1(30,n.loc));break}}}function createIfBranch$1(n,e){const t=n.tagType===3;return{type:10,loc:n.loc,condition:e.name==="else"?void 0:e.exp,children:t&&!findDir$1(n,"for")?n.children:[n],userKey:findProp$1(n,"key"),isTemplateIf:t}}function createCodegenNodeForBranch$1(n,e,t){return n.condition?createConditionalExpression$1(n.condition,createChildrenCodegenNode$1(n,e,t),createCallExpression$1(t.helper(CREATE_COMMENT$1),['""',"true"])):createChildrenCodegenNode$1(n,e,t)}function createChildrenCodegenNode$1(n,e,t){const{helper:i}=t,s=createObjectProperty$1("key",createSimpleExpression$1(`${e}`,!1,locStub$1,2)),{children:r}=n,o=r[0];if(r.length!==1||o.type!==1)if(r.length===1&&o.type===11){const l=o.codegenNode;return injectProp$1(l,s,t),l}else{let l=64;return createVNodeCall$1(t,i(FRAGMENT$1),createObjectExpression$1([s]),r,l,void 0,void 0,!0,!1,!1,n.loc)}else{const l=o.codegenNode,c=getMemoedVNodeCall$1(l);return c.type===13&&convertToBlock$1(c,t),injectProp$1(c,s,t),l}}function getParentCondition$1(n){for(;;)if(n.type===19)if(n.alternate.type===19)n=n.alternate;else return n;else n.type===20&&(n=n.value)}const transformBind$1=(n,e,t)=>{const{modifiers:i,loc:s}=n,r=n.arg;let{exp:o}=n;if(o&&o.type===4&&!o.content.trim()&&(o=void 0),!o){if(r.type!==4||!r.isStatic)return t.onError(createCompilerError$1(52,r.loc)),{props:[createObjectProperty$1(r,createSimpleExpression$1("",!0,s))]};transformBindShorthand$1(n),o=n.exp}return r.type!==4?(r.children.unshift("("),r.children.push(') || ""')):r.isStatic||(r.content=`${r.content} || ""`),i.some(a=>a.content==="camel")&&(r.type===4?r.isStatic?r.content=camelize$1(r.content):r.content=`${t.helperString(CAMELIZE$1)}(${r.content})`:(r.children.unshift(`${t.helperString(CAMELIZE$1)}(`),r.children.push(")"))),t.inSSR||(i.some(a=>a.content==="prop")&&injectPrefix$1(r,"."),i.some(a=>a.content==="attr")&&injectPrefix$1(r,"^")),{props:[createObjectProperty$1(r,o)]}},transformBindShorthand$1=(n,e)=>{const t=n.arg,i=camelize$1(t.content);n.exp=createSimpleExpression$1(i,!1,t.loc)},injectPrefix$1=(n,e)=>{n.type===4?n.isStatic?n.content=e+n.content:n.content=`\`${e}\${${n.content}}\``:(n.children.unshift(`'${e}' + (`),n.children.push(")"))},transformFor$1=createStructuralDirectiveTransform$1("for",(n,e,t)=>{const{helper:i,removeHelper:s}=t;return processFor$1(n,e,t,r=>{const o=createCallExpression$1(i(RENDER_LIST$1),[r.source]),a=isTemplateNode$1(n),l=findDir$1(n,"memo"),c=findProp$1(n,"key",!1,!0);c&&c.type===7&&!c.exp&&transformBindShorthand$1(c);let u=c&&(c.type===6?c.value?createSimpleExpression$1(c.value.content,!0):void 0:c.exp);const f=c&&u?createObjectProperty$1("key",u):null,g=r.source.type===4&&r.source.constType>0,m=g?64:c?128:256;return r.codegenNode=createVNodeCall$1(t,i(FRAGMENT$1),void 0,o,m,void 0,void 0,!0,!g,!1,n.loc),()=>{let _;const{children:v}=r,C=v.length!==1||v[0].type!==1,S=isSlotOutlet$1(n)?n:a&&n.children.length===1&&isSlotOutlet$1(n.children[0])?n.children[0]:null;if(S?(_=S.codegenNode,a&&f&&injectProp$1(_,f,t)):C?_=createVNodeCall$1(t,i(FRAGMENT$1),f?createObjectExpression$1([f]):void 0,n.children,64,void 0,void 0,!0,void 0,!1):(_=v[0].codegenNode,a&&f&&injectProp$1(_,f,t),_.isBlock!==!g&&(_.isBlock?(s(OPEN_BLOCK$1),s(getVNodeBlockHelper$1(t.inSSR,_.isComponent))):s(getVNodeHelper$1(t.inSSR,_.isComponent))),_.isBlock=!g,_.isBlock?(i(OPEN_BLOCK$1),i(getVNodeBlockHelper$1(t.inSSR,_.isComponent))):i(getVNodeHelper$1(t.inSSR,_.isComponent))),l){const w=createFunctionExpression$1(createForLoopParams$1(r.parseResult,[createSimpleExpression$1("_cached")]));w.body=createBlockStatement$1([createCompoundExpression$1(["const _memo = (",l.exp,")"]),createCompoundExpression$1(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${t.helperString(IS_MEMO_SAME$1)}(_cached, _memo)) return _cached`]),createCompoundExpression$1(["const _item = ",_]),createSimpleExpression$1("_item.memo = _memo"),createSimpleExpression$1("return _item")]),o.arguments.push(w,createSimpleExpression$1("_cache"),createSimpleExpression$1(String(t.cached.length))),t.cached.push(null)}else o.arguments.push(createFunctionExpression$1(createForLoopParams$1(r.parseResult),_,!0))}})});function processFor$1(n,e,t,i){if(!e.exp){t.onError(createCompilerError$1(31,e.loc));return}const s=e.forParseResult;if(!s){t.onError(createCompilerError$1(32,e.loc));return}finalizeForParseResult$1(s);const{addIdentifiers:r,removeIdentifiers:o,scopes:a}=t,{source:l,value:c,key:d,index:u}=s,f={type:11,loc:e.loc,source:l,valueAlias:c,keyAlias:d,objectIndexAlias:u,parseResult:s,children:isTemplateNode$1(n)?n.children:[n]};t.replaceNode(f),a.vFor++;const g=i&&i(f);return()=>{a.vFor--,g&&g()}}function finalizeForParseResult$1(n,e){n.finalized||(n.finalized=!0)}function createForLoopParams$1({value:n,key:e,index:t},i=[]){return createParamsList$1([n,e,t,...i])}function createParamsList$1(n){let e=n.length;for(;e--&&!n[e];);return n.slice(0,e+1).map((t,i)=>t||createSimpleExpression$1("_".repeat(i+1),!1))}const defaultFallback$1=createSimpleExpression$1("undefined",!1),trackSlotScopes$1=(n,e)=>{if(n.type===1&&(n.tagType===1||n.tagType===3)){const t=findDir$1(n,"slot");if(t)return t.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},buildClientSlotFn$1=(n,e,t,i)=>createFunctionExpression$1(n,t,!1,!0,t.length?t[0].loc:i);function buildSlots$1(n,e,t=buildClientSlotFn$1){e.helper(WITH_CTX$1);const{children:i,loc:s}=n,r=[],o=[];let a=e.scopes.vSlot>0||e.scopes.vFor>0;const l=findDir$1(n,"slot",!0);if(l){const{arg:v,exp:C}=l;v&&!isStaticExp$1(v)&&(a=!0),r.push(createObjectProperty$1(v||createSimpleExpression$1("default",!0),t(C,void 0,i,s)))}let c=!1,d=!1;const u=[],f=new Set;let g=0;for(let v=0;v{const w=t(C,void 0,S,s);return e.compatConfig&&(w.isNonScopedSlot=!0),createObjectProperty$1("default",w)};c?u.length&&u.some(C=>isNonWhitespaceContent$1(C))&&(d?e.onError(createCompilerError$1(39,u[0].loc)):r.push(v(void 0,u))):r.push(v(void 0,i))}const m=a?2:hasForwardedSlots$1(n.children)?3:1;let _=createObjectExpression$1(r.concat(createObjectProperty$1("_",createSimpleExpression$1(m+"",!1))),s);return o.length&&(_=createCallExpression$1(e.helper(CREATE_SLOTS$1),[_,createArrayExpression$1(o)])),{slots:_,hasDynamicSlots:a}}function buildDynamicSlot$1(n,e,t){const i=[createObjectProperty$1("name",n),createObjectProperty$1("fn",e)];return t!=null&&i.push(createObjectProperty$1("key",createSimpleExpression$1(String(t),!0))),createObjectExpression$1(i)}function hasForwardedSlots$1(n){for(let e=0;efunction(){if(n=e.currentNode,!(n.type===1&&(n.tagType===0||n.tagType===1)))return;const{tag:i,props:s}=n,r=n.tagType===1;let o=r?resolveComponentType$1(n,e):`"${i}"`;const a=isObject$3(o)&&o.callee===RESOLVE_DYNAMIC_COMPONENT$1;let l,c,d=0,u,f,g,m=a||o===TELEPORT$1||o===SUSPENSE$1||!r&&(i==="svg"||i==="foreignObject"||i==="math");if(s.length>0){const _=buildProps$1(n,e,void 0,r,a);l=_.props,d=_.patchFlag,f=_.dynamicPropNames;const v=_.directives;g=v&&v.length?createArrayExpression$1(v.map(C=>buildDirectiveArgs$1(C,e))):void 0,_.shouldUseBlock&&(m=!0)}if(n.children.length>0)if(o===KEEP_ALIVE$1&&(m=!0,d|=1024),r&&o!==TELEPORT$1&&o!==KEEP_ALIVE$1){const{slots:v,hasDynamicSlots:C}=buildSlots$1(n,e);c=v,C&&(d|=1024)}else if(n.children.length===1&&o!==TELEPORT$1){const v=n.children[0],C=v.type,S=C===5||C===8;S&&getConstantType$1(v,e)===0&&(d|=1),S||C===2?c=v:c=n.children}else c=n.children;f&&f.length&&(u=stringifyDynamicPropNames$1(f)),n.codegenNode=createVNodeCall$1(e,o,l,c,d===0?void 0:d,u,g,!!m,!1,r,n.loc)};function resolveComponentType$1(n,e,t=!1){let{tag:i}=n;const s=isComponentTag$1(i),r=findProp$1(n,"is",!1,!0);if(r)if(s||isCompatEnabled$1("COMPILER_IS_ON_ELEMENT",e)){let a;if(r.type===6?a=r.value&&createSimpleExpression$1(r.value.content,!0):(a=r.exp,a||(a=createSimpleExpression$1("is",!1,r.arg.loc))),a)return createCallExpression$1(e.helper(RESOLVE_DYNAMIC_COMPONENT$1),[a])}else r.type===6&&r.value.content.startsWith("vue:")&&(i=r.value.content.slice(4));const o=isCoreComponent$1(i)||e.isBuiltInComponent(i);return o?(t||e.helper(o),o):(e.helper(RESOLVE_COMPONENT$1),e.components.add(i),toValidAssetId$1(i,"component"))}function buildProps$1(n,e,t=n.props,i,s,r=!1){const{tag:o,loc:a,children:l}=n;let c=[];const d=[],u=[],f=l.length>0;let g=!1,m=0,_=!1,v=!1,C=!1,S=!1,w=!1,L=!1;const I=[],N=F=>{c.length&&(d.push(createObjectExpression$1(dedupeProperties$1(c),a)),c=[]),F&&d.push(F)},R=()=>{e.scopes.vFor>0&&c.push(createObjectProperty$1(createSimpleExpression$1("ref_for",!0),createSimpleExpression$1("true")))},T=({key:F,value:B})=>{if(isStaticExp$1(F)){const W=F.content,G=isOn$1(W);if(G&&(!i||s)&&W.toLowerCase()!=="onclick"&&W!=="onUpdate:modelValue"&&!isReservedProp$1(W)&&(S=!0),G&&isReservedProp$1(W)&&(L=!0),G&&B.type===14&&(B=B.arguments[0]),B.type===20||(B.type===4||B.type===8)&&getConstantType$1(B,e)>0)return;W==="ref"?_=!0:W==="class"?v=!0:W==="style"?C=!0:W!=="key"&&!I.includes(W)&&I.push(W),i&&(W==="class"||W==="style")&&!I.includes(W)&&I.push(W)}else w=!0};for(let F=0;Fce.content==="prop")&&(m|=32);const Q=e.directiveTransforms[W];if(Q){const{props:ce,needRuntime:ie}=Q(B,n,e);!r&&ce.forEach(T),q&&G&&!isStaticExp$1(G)?N(createObjectExpression$1(ce,a)):c.push(...ce),ie&&(u.push(B),isSymbol(ie)&&directiveImportMap$1.set(B,ie))}else isBuiltInDirective$1(W)||(u.push(B),f&&(g=!0))}}let A;if(d.length?(N(),d.length>1?A=createCallExpression$1(e.helper(MERGE_PROPS$1),d,a):A=d[0]):c.length&&(A=createObjectExpression$1(dedupeProperties$1(c),a)),w?m|=16:(v&&!i&&(m|=2),C&&!i&&(m|=4),I.length&&(m|=8),S&&(m|=32)),!g&&(m===0||m===32)&&(_||L||u.length>0)&&(m|=512),!e.inSSR&&A)switch(A.type){case 15:let F=-1,B=-1,W=!1;for(let K=0;KcreateObjectProperty$1(o,r)),s))}return createArrayExpression$1(t,n.loc)}function stringifyDynamicPropNames$1(n){let e="[";for(let t=0,i=n.length;t{if(isSlotOutlet$1(n)){const{children:t,loc:i}=n,{slotName:s,slotProps:r}=processSlotOutlet$1(n,e),o=[e.prefixIdentifiers?"_ctx.$slots":"$slots",s,"{}","undefined","true"];let a=2;r&&(o[2]=r,a=3),t.length&&(o[3]=createFunctionExpression$1([],t,!1,!1,i),a=4),e.scopeId&&!e.slotted&&(a=5),o.splice(a),n.codegenNode=createCallExpression$1(e.helper(RENDER_SLOT$1),o,i)}};function processSlotOutlet$1(n,e){let t='"default"',i;const s=[];for(let r=0;r0){const{props:r,directives:o}=buildProps$1(n,e,s,!1,!1);i=r,o.length&&e.onError(createCompilerError$1(36,o[0].loc))}return{slotName:t,slotProps:i}}const transformOn$3=(n,e,t,i)=>{const{loc:s,modifiers:r,arg:o}=n;!n.exp&&!r.length&&t.onError(createCompilerError$1(35,s));let a;if(o.type===4)if(o.isStatic){let u=o.content;u.startsWith("vue:")&&(u=`vnode-${u.slice(4)}`);const f=e.tagType!==0||u.startsWith("vnode")||!/[A-Z]/.test(u)?toHandlerKey$1(camelize$1(u)):`on:${u}`;a=createSimpleExpression$1(f,!0,o.loc)}else a=createCompoundExpression$1([`${t.helperString(TO_HANDLER_KEY$1)}(`,o,")"]);else a=o,a.children.unshift(`${t.helperString(TO_HANDLER_KEY$1)}(`),a.children.push(")");let l=n.exp;l&&!l.content.trim()&&(l=void 0);let c=t.cacheHandlers&&!l&&!t.inVOnce;if(l){const u=isMemberExpression$1(l),f=!(u||isFnExpression$1(l)),g=l.content.includes(";");(f||c&&u)&&(l=createCompoundExpression$1([`${f?"$event":"(...args)"} => ${g?"{":"("}`,l,g?"}":")"]))}let d={props:[createObjectProperty$1(a,l||createSimpleExpression$1("() => {}",!1,s))]};return i&&(d=i(d)),c&&(d.props[0].value=t.cache(d.props[0].value)),d.props.forEach(u=>u.key.isHandlerKey=!0),d},transformText$1=(n,e)=>{if(n.type===0||n.type===1||n.type===11||n.type===10)return()=>{const t=n.children;let i,s=!1;for(let r=0;rr.type===7&&!e.directiveTransforms[r.name])&&n.tag!=="template")))for(let r=0;r{if(n.type===1&&findDir$1(n,"once",!0))return seen$1$1.has(n)||e.inVOnce||e.inSSR?void 0:(seen$1$1.add(n),e.inVOnce=!0,e.helper(SET_BLOCK_TRACKING$1),()=>{e.inVOnce=!1;const t=e.currentNode;t.codegenNode&&(t.codegenNode=e.cache(t.codegenNode,!0,!0))})},transformModel$3=(n,e,t)=>{const{exp:i,arg:s}=n;if(!i)return t.onError(createCompilerError$1(41,n.loc)),createTransformProps$1();const r=i.loc.source.trim(),o=i.type===4?i.content:r,a=t.bindingMetadata[r];if(a==="props"||a==="props-aliased")return t.onError(createCompilerError$1(44,i.loc)),createTransformProps$1();const l=!1;if(!o.trim()||!isMemberExpression$1(i)&&!l)return t.onError(createCompilerError$1(42,i.loc)),createTransformProps$1();const c=s||createSimpleExpression$1("modelValue",!0),d=s?isStaticExp$1(s)?`onUpdate:${camelize$1(s.content)}`:createCompoundExpression$1(['"onUpdate:" + ',s]):"onUpdate:modelValue";let u;const f=t.isTS?"($event: any)":"$event";u=createCompoundExpression$1([`${f} => ((`,i,") = $event)"]);const g=[createObjectProperty$1(c,n.exp),createObjectProperty$1(d,u)];if(n.modifiers.length&&e.tagType===1){const m=n.modifiers.map(v=>v.content).map(v=>(isSimpleIdentifier$1(v)?v:JSON.stringify(v))+": true").join(", "),_=s?isStaticExp$1(s)?`${s.content}Modifiers`:createCompoundExpression$1([s,' + "Modifiers"']):"modelModifiers";g.push(createObjectProperty$1(_,createSimpleExpression$1(`{ ${m} }`,!1,n.loc,2)))}return createTransformProps$1(g)};function createTransformProps$1(n=[]){return{props:n}}const validDivisionCharRE=/[\w).+\-_$\]]/,transformFilter=(n,e)=>{isCompatEnabled$1("COMPILER_FILTERS",e)&&(n.type===5?rewriteFilter(n.content,e):n.type===1&&n.props.forEach(t=>{t.type===7&&t.name!=="for"&&t.exp&&rewriteFilter(t.exp,e)}))};function rewriteFilter(n,e){if(n.type===4)parseFilter(n,e);else for(let t=0;t=0&&(S=t.charAt(C),S===" ");C--);(!S||!validDivisionCharRE.test(S))&&(o=!0)}}m===void 0?m=t.slice(0,g).trim():d!==0&&v();function v(){_.push(t.slice(d,g).trim()),d=g+1}if(_.length){for(g=0;g<_.length;g++)m=wrapFilter(m,_[g],e);n.content=m,n.ast=void 0}}function wrapFilter(n,e,t){t.helper(RESOLVE_FILTER$1);const i=e.indexOf("(");if(i<0)return t.filters.add(e),`${toValidAssetId$1(e,"filter")}(${n})`;{const s=e.slice(0,i),r=e.slice(i+1);return t.filters.add(s),`${toValidAssetId$1(s,"filter")}(${n}${r!==")"?","+r:r}`}}const seen$3=new WeakSet,transformMemo$1=(n,e)=>{if(n.type===1){const t=findDir$1(n,"memo");return!t||seen$3.has(n)?void 0:(seen$3.add(n),()=>{const i=n.codegenNode||e.currentNode.codegenNode;i&&i.type===13&&(n.tagType!==1&&convertToBlock$1(i,e),n.codegenNode=createCallExpression$1(e.helper(WITH_MEMO$1),[t.exp,createFunctionExpression$1(void 0,i),"_cache",String(e.cached.length)]),e.cached.push(null))})}};function getBaseTransformPreset$1(n){return[[transformOnce$1,transformIf$1,transformMemo$1,transformFor$1,transformFilter,transformSlotOutlet$1,transformElement$1,trackSlotScopes$1,transformText$1],{on:transformOn$3,bind:transformBind$1,model:transformModel$3}]}function baseCompile$1(n,e={}){const t=e.onError||defaultOnError$1,i=e.mode==="module";e.prefixIdentifiers===!0?t(createCompilerError$1(47)):i&&t(createCompilerError$1(48));const s=!1;e.cacheHandlers&&t(createCompilerError$1(49)),e.scopeId&&!i&&t(createCompilerError$1(50));const r=extend$1({},e,{prefixIdentifiers:s}),o=isString$4(n)?baseParse$1(n,r):n,[a,l]=getBaseTransformPreset$1();return transform$1(o,extend$1({},r,{nodeTransforms:[...a,...e.nodeTransforms||[]],directiveTransforms:extend$1({},l,e.directiveTransforms||{})})),generate$1(o,r)}const noopDirectiveTransform$1=()=>({props:[]});/** +* @vue/compiler-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const V_MODEL_RADIO$1=Symbol(""),V_MODEL_CHECKBOX$1=Symbol(""),V_MODEL_TEXT$1=Symbol(""),V_MODEL_SELECT$1=Symbol(""),V_MODEL_DYNAMIC$1=Symbol(""),V_ON_WITH_MODIFIERS$1=Symbol(""),V_ON_WITH_KEYS$1=Symbol(""),V_SHOW$1=Symbol(""),TRANSITION$1=Symbol(""),TRANSITION_GROUP$1=Symbol("");registerRuntimeHelpers$1({[V_MODEL_RADIO$1]:"vModelRadio",[V_MODEL_CHECKBOX$1]:"vModelCheckbox",[V_MODEL_TEXT$1]:"vModelText",[V_MODEL_SELECT$1]:"vModelSelect",[V_MODEL_DYNAMIC$1]:"vModelDynamic",[V_ON_WITH_MODIFIERS$1]:"withModifiers",[V_ON_WITH_KEYS$1]:"withKeys",[V_SHOW$1]:"vShow",[TRANSITION$1]:"Transition",[TRANSITION_GROUP$1]:"TransitionGroup"});let decoder;function decodeHtmlBrowser(n,e=!1){return decoder||(decoder=document.createElement("div")),e?(decoder.innerHTML=`
`,decoder.children[0].getAttribute("foo")):(decoder.innerHTML=n,decoder.textContent)}const parserOptions$1={parseMode:"html",isVoidTag:isVoidTag$1,isNativeTag:n=>isHTMLTag$1(n)||isSVGTag$1(n)||isMathMLTag$1(n),isPreTag:n=>n==="pre",isIgnoreNewlineTag:n=>n==="pre"||n==="textarea",decodeEntities:decodeHtmlBrowser,isBuiltInComponent:n=>{if(n==="Transition"||n==="transition")return TRANSITION$1;if(n==="TransitionGroup"||n==="transition-group")return TRANSITION_GROUP$1},getNamespace(n,e,t){let i=e?e.ns:t;if(e&&i===2)if(e.tag==="annotation-xml"){if(n==="svg")return 1;e.props.some(s=>s.type===6&&s.name==="encoding"&&s.value!=null&&(s.value.content==="text/html"||s.value.content==="application/xhtml+xml"))&&(i=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&n!=="mglyph"&&n!=="malignmark"&&(i=0);else e&&i===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(i=0);if(i===0){if(n==="svg")return 1;if(n==="math")return 2}return i}},transformStyle$1=n=>{n.type===1&&n.props.forEach((e,t)=>{e.type===6&&e.name==="style"&&e.value&&(n.props[t]={type:7,name:"bind",arg:createSimpleExpression$1("style",!0,e.loc),exp:parseInlineCSS$1(e.value.content,e.loc),modifiers:[],loc:e.loc})})},parseInlineCSS$1=(n,e)=>{const t=parseStringStyle$1(n);return createSimpleExpression$1(JSON.stringify(t),!1,e,3)};function createDOMCompilerError$1(n,e){return createCompilerError$1(n,e)}const transformVHtml$1=(n,e,t)=>{const{exp:i,loc:s}=n;return i||t.onError(createDOMCompilerError$1(53,s)),e.children.length&&(t.onError(createDOMCompilerError$1(54,s)),e.children.length=0),{props:[createObjectProperty$1(createSimpleExpression$1("innerHTML",!0,s),i||createSimpleExpression$1("",!0))]}},transformVText$1=(n,e,t)=>{const{exp:i,loc:s}=n;return i||t.onError(createDOMCompilerError$1(55,s)),e.children.length&&(t.onError(createDOMCompilerError$1(56,s)),e.children.length=0),{props:[createObjectProperty$1(createSimpleExpression$1("textContent",!0),i?getConstantType$1(i,t)>0?i:createCallExpression$1(t.helperString(TO_DISPLAY_STRING$1),[i],s):createSimpleExpression$1("",!0))]}},transformModel$2=(n,e,t)=>{const i=transformModel$3(n,e,t);if(!i.props.length||e.tagType===1)return i;n.arg&&t.onError(createDOMCompilerError$1(58,n.arg.loc));const{tag:s}=e,r=t.isCustomElement(s);if(s==="input"||s==="textarea"||s==="select"||r){let o=V_MODEL_TEXT$1,a=!1;if(s==="input"||r){const l=findProp$1(e,"type");if(l){if(l.type===7)o=V_MODEL_DYNAMIC$1;else if(l.value)switch(l.value.content){case"radio":o=V_MODEL_RADIO$1;break;case"checkbox":o=V_MODEL_CHECKBOX$1;break;case"file":a=!0,t.onError(createDOMCompilerError$1(59,n.loc));break}}else hasDynamicKeyVBind$1(e)&&(o=V_MODEL_DYNAMIC$1)}else s==="select"&&(o=V_MODEL_SELECT$1);a||(i.needRuntime=t.helper(o))}else t.onError(createDOMCompilerError$1(57,n.loc));return i.props=i.props.filter(o=>!(o.key.type===4&&o.key.content==="modelValue")),i},isEventOptionModifier$1=makeMap$1("passive,once,capture"),isNonKeyModifier$1=makeMap$1("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),maybeKeyModifier$1=makeMap$1("left,right"),isKeyboardEvent$2=makeMap$1("onkeyup,onkeydown,onkeypress"),resolveModifiers$1=(n,e,t,i)=>{const s=[],r=[],o=[];for(let a=0;aisStaticExp$1(n)&&n.content.toLowerCase()==="onclick"?createSimpleExpression$1(e,!0):n.type!==4?createCompoundExpression$1(["(",n,`) === "onClick" ? "${e}" : (`,n,")"]):n,transformOn$2=(n,e,t)=>transformOn$3(n,e,t,i=>{const{modifiers:s}=n;if(!s.length)return i;let{key:r,value:o}=i.props[0];const{keyModifiers:a,nonKeyModifiers:l,eventOptionModifiers:c}=resolveModifiers$1(r,s,t,n.loc);if(l.includes("right")&&(r=transformClick$1(r,"onContextmenu")),l.includes("middle")&&(r=transformClick$1(r,"onMouseup")),l.length&&(o=createCallExpression$1(t.helper(V_ON_WITH_MODIFIERS$1),[o,JSON.stringify(l)])),a.length&&(!isStaticExp$1(r)||isKeyboardEvent$2(r.content.toLowerCase()))&&(o=createCallExpression$1(t.helper(V_ON_WITH_KEYS$1),[o,JSON.stringify(a)])),c.length){const d=c.map(capitalize$1).join("");r=isStaticExp$1(r)?createSimpleExpression$1(`${r.content}${d}`,!0):createCompoundExpression$1(["(",r,`) + "${d}"`])}return{props:[createObjectProperty$1(r,o)]}}),transformShow$1=(n,e,t)=>{const{exp:i,loc:s}=n;return i||t.onError(createDOMCompilerError$1(61,s)),{props:[],needRuntime:t.helper(V_SHOW$1)}},ignoreSideEffectTags$1=(n,e)=>{n.type===1&&n.tagType===0&&(n.tag==="script"||n.tag==="style")&&e.removeNode()},DOMNodeTransforms$1=[transformStyle$1],DOMDirectiveTransforms$1={cloak:noopDirectiveTransform$1,html:transformVHtml$1,text:transformVText$1,model:transformModel$2,on:transformOn$2,show:transformShow$1};function compile$2(n,e={}){return baseCompile$1(n,extend$1({},parserOptions$1,e,{nodeTransforms:[ignoreSideEffectTags$1,...DOMNodeTransforms$1,...e.nodeTransforms||[]],directiveTransforms:extend$1({},DOMDirectiveTransforms$1,e.directiveTransforms||{}),transformHoist:null}))}/** +* vue v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const compileCache=Object.create(null);function compileToFunction(n,e){if(!isString$4(n))if(n.nodeType)n=n.innerHTML;else return NOOP$1;const t=genCacheKey$1(n,e),i=compileCache[t];if(i)return i;if(n[0]==="#"){const a=document.querySelector(n);n=a?a.innerHTML:""}const s=extend$1({hoistStatic:!0,onError:void 0,onWarn:NOOP$1},e);!s.isCustomElement&&typeof customElements<"u"&&(s.isCustomElement=a=>!!customElements.get(a));const{code:r}=compile$2(n,s),o=new Function("Vue",r)(runtimeDom);return o._rc=!0,compileCache[t]=o}registerRuntimeCompiler(compileToFunction);const _export_sfc=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},_sfc_main$2={};function _sfc_render(n,e){const t=resolveComponent("Playground");return openBlock(),createBlock$1(t)}const App=_export_sfc(_sfc_main$2,[["render",_sfc_render]]),scriptRel="modulepreload",assetsURL=function(n){return"/"+n},seen$2={},__vitePreload=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(r=>{if(r=assetsURL(r),r in seen$2)return;seen$2[r]=!0;const o=r.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!i)for(let d=s.length-1;d>=0;d--){const u=s[d];if(u.href===r&&(!o||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${a}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":scriptRel,o||(c.as="script",c.crossOrigin=""),c.href=r,document.head.appendChild(c),o)return new Promise((d,u)=>{c.addEventListener("load",d),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})};function tail(n,e=0){return n[n.length-(1+e)]}function tail2(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function equals$1(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function binarySearch2(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,r=e(s);if(r<0)t=s+1;else if(r>0)i=s-1;else return s}return-(t+1)}function quickSelect(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],r=[],o=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?r.push(a):o.push(a)}return n!!e)}function coalesceInPlace(n){let e=0;for(let t=0;t0}function distinct(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function firstOrDefault(n,e){return n.length>0?n[0]:e}function range$2(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function arrayInsert(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function pushToStart(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function pushToEnd(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function pushMany(n,e){for(const t of e)n.push(t)}function asArray(n){return Array.isArray(n)?n:[n]}function insertInto(n,e,t){const i=getActualStartIndex(n,e),s=n.length,r=t.length;n.length=s+r;for(let o=s-1;o>=i;o--)n[o+r]=n[o];for(let o=0;o0}n.isGreaterThan=i;function s(r){return r===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(CompareResult||(CompareResult={}));function compareBy(n,e){return(t,i)=>e(n(t),n(i))}function tieBreakComparators(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!CompareResult.isNeitherLessOrGreaterThan(s))return s}return CompareResult.neitherLessOrGreaterThan}}const numberComparator=(n,e)=>n-e,booleanComparator=(n,e)=>numberComparator(n?1:0,e?1:0);function reverseOrder(n){return(e,t)=>-n(e,t)}class ArrayQueue{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const nl=class nl{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new nl(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new nl(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||CompareResult.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};nl.empty=new nl(e=>{});let CallbackIterable=nl;class Permutation{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((s,r)=>t(e[s],e[r]));return new Permutation(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t"u"}function isDefined(n){return!isUndefinedOrNull(n)}function isUndefinedOrNull(n){return isUndefined$1(n)||n===null}function assertType(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function assertIsDefined(n){if(isUndefinedOrNull(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function isFunction$2(n){return typeof n=="function"}function validateConstraints(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?deepClone(i):i}),e}function deepFreeze(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(_hasOwnProperty.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!isTypedArray(s)&&e.push(s)}}return n}const _hasOwnProperty=Object.prototype.hasOwnProperty;function cloneAndChange(n,e){return _cloneAndChange(n,e,new Set)}function _cloneAndChange(n,e,t){if(isUndefinedOrNull(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const r of n)s.push(_cloneAndChange(r,e,t));return s}if(isObject(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const r in n)_hasOwnProperty.call(n,r)&&(s[r]=_cloneAndChange(n[r],e,t));return t.delete(n),s}return n}function mixin(n,e,t=!0){return isObject(n)?(isObject(e)&&Object.keys(e).forEach(i=>{i in n?t&&(isObject(n[i])&&isObject(e[i])?mixin(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function equals(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const r=Array.prototype.slice.call(arguments,0);return e(s,r)},i={};for(const s of n)i[s]=t(s);return i}function getNLSMessages(){return globalThis._VSCODE_NLS_MESSAGES}function getNLSLanguage(){return globalThis._VSCODE_NLS_LANGUAGE}const isPseudo=getNLSLanguage()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function _format$1(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const r=s[0],o=e[r];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),isPseudo&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function localize(n,e,...t){return _format$1(typeof n=="number"?lookupMessage(n,e):e,t)}function lookupMessage(n,e){var i;const t=(i=getNLSMessages())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function localize2(n,e,...t){let i;typeof n=="number"?i=lookupMessage(n,e):i=e;const s=_format$1(i,t);return{value:s,original:e===i?s:_format$1(e,t)}}const LANGUAGE_DEFAULT="en";let _isWindows=!1,_isMacintosh=!1,_isLinux=!1,_isNative=!1,_isWeb=!1,_isIOS=!1,_isMobile=!1,_locale,_language=LANGUAGE_DEFAULT,_platformLocale=LANGUAGE_DEFAULT,_translationsConfigFile,_userAgent;const $globalThis=globalThis;let nodeProcess;var Uv;typeof $globalThis.vscode<"u"&&typeof $globalThis.vscode.process<"u"?nodeProcess=$globalThis.vscode.process:typeof process<"u"&&typeof((Uv=process==null?void 0:process.versions)==null?void 0:Uv.node)=="string"&&(nodeProcess=process);var Kv;const isElectronProcess=typeof((Kv=nodeProcess==null?void 0:nodeProcess.versions)==null?void 0:Kv.electron)=="string",isElectronRenderer=isElectronProcess&&(nodeProcess==null?void 0:nodeProcess.type)==="renderer";var jv;if(typeof nodeProcess=="object"){_isWindows=nodeProcess.platform==="win32",_isMacintosh=nodeProcess.platform==="darwin",_isLinux=nodeProcess.platform==="linux",_isLinux&&nodeProcess.env.SNAP&&nodeProcess.env.SNAP_REVISION,nodeProcess.env.CI||nodeProcess.env.BUILD_ARTIFACTSTAGINGDIRECTORY,_locale=LANGUAGE_DEFAULT,_language=LANGUAGE_DEFAULT;const n=nodeProcess.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);_locale=e.userLocale,_platformLocale=e.osLocale,_language=e.resolvedLanguage||LANGUAGE_DEFAULT,_translationsConfigFile=(jv=e.languagePack)==null?void 0:jv.translationsConfigFile}catch{}_isNative=!0}else typeof navigator=="object"&&!isElectronRenderer?(_userAgent=navigator.userAgent,_isWindows=_userAgent.indexOf("Windows")>=0,_isMacintosh=_userAgent.indexOf("Macintosh")>=0,_isIOS=(_userAgent.indexOf("Macintosh")>=0||_userAgent.indexOf("iPad")>=0||_userAgent.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_isLinux=_userAgent.indexOf("Linux")>=0,_isMobile=(_userAgent==null?void 0:_userAgent.indexOf("Mobi"))>=0,_isWeb=!0,_language=getNLSLanguage()||LANGUAGE_DEFAULT,_locale=navigator.language.toLowerCase(),_platformLocale=_locale):console.error("Unable to resolve platform.");const isWindows=_isWindows,isMacintosh=_isMacintosh,isLinux=_isLinux,isNative=_isNative,isWeb=_isWeb,isWebWorker=_isWeb&&typeof $globalThis.importScripts=="function",webWorkerOrigin=isWebWorker?$globalThis.origin:void 0,isIOS=_isIOS,isMobile=_isMobile,userAgent$1=_userAgent,language=_language,setTimeout0IsFaster=typeof $globalThis.postMessage=="function"&&!$globalThis.importScripts,setTimeout0=(()=>{if(setTimeout0IsFaster){const n=[];$globalThis.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),$globalThis.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),OS$1=_isMacintosh||_isIOS?2:_isWindows?1:3;let _isLittleEndian=!0,_isLittleEndianComputed=!1;function isLittleEndian(){if(!_isLittleEndianComputed){_isLittleEndianComputed=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,_isLittleEndian=new Uint16Array(n.buffer)[0]===512+1}return _isLittleEndian}const isChrome$1=!!(userAgent$1&&userAgent$1.indexOf("Chrome")>=0),isFirefox$1=!!(userAgent$1&&userAgent$1.indexOf("Firefox")>=0),isSafari$1=!!(!isChrome$1&&userAgent$1&&userAgent$1.indexOf("Safari")>=0),isEdge=!!(userAgent$1&&userAgent$1.indexOf("Edg/")>=0),isAndroid$1=!!(userAgent$1&&userAgent$1.indexOf("Android")>=0),EDITOR_MODEL_DEFAULTS={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Iterable;(function(n){function e(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(L){yield L}n.single=s;function r(L){return e(L)?L:s(L)}n.wrap=r;function o(L){return L||t}n.from=o;function*a(L){for(let I=L.length-1;I>=0;I--)yield L[I]}n.reverse=a;function l(L){return!L||L[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(L){return L[Symbol.iterator]().next().value}n.first=c;function d(L,I){let N=0;for(const R of L)if(I(R,N++))return!0;return!1}n.some=d;function u(L,I){for(const N of L)if(I(N))return N}n.find=u;function*f(L,I){for(const N of L)I(N)&&(yield N)}n.filter=f;function*g(L,I){let N=0;for(const R of L)yield I(R,N++)}n.map=g;function*m(L,I){let N=0;for(const R of L)yield*I(R,N++)}n.flatMap=m;function*_(...L){for(const I of L)yield*I}n.concat=_;function v(L,I,N){let R=N;for(const T of L)R=I(R,T);return R}n.reduce=v;function*C(L,I,N=L.length){for(I<0&&(I+=L.length),N<0?N+=L.length:N>L.length&&(N=L.length);I{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Node$2.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Node$2.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Node$2.Undefined&&e.next!==Node$2.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Node$2.Undefined&&e.next===Node$2.Undefined?(this._first=Node$2.Undefined,this._last=Node$2.Undefined):e.next===Node$2.Undefined?(this._last=this._last.prev,this._last.next=Node$2.Undefined):e.prev===Node$2.Undefined&&(this._first=this._first.next,this._first.prev=Node$2.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Node$2.Undefined;)yield e.element,e=e.next}}const USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function createWordRegExp(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of USUAL_WORD_SEPARATORS)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const DEFAULT_WORD_REGEXP=createWordRegExp();function ensureValidWordDefinition(n){let e=DEFAULT_WORD_REGEXP;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const _defaultConfig=new LinkedList;_defaultConfig.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function getWordAtText(n,e,t,i,s){if(e=ensureValidWordDefinition(e),s||(s=Iterable.first(_defaultConfig)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),getWordAtText(n,e,t,i,s)}const r=Date.now(),o=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-r>=s.timeBudget);c++){const d=o-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=_findRegexMatchEnclosingPosition(e,t,o,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function _findRegexMatchEnclosingPosition(n,e,t,i){let s;for(;s=n.exec(e);){const r=s.index||0;if(r<=t&&n.lastIndex>=t)return s;if(i>0&&r>i)return null}return null}const MINIMAP_GUTTER_WIDTH=8;class ConfigurationChangedEvent{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class ComputeOptionsMemory{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class BaseEditorOption{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return applyUpdate(e,t)}compute(e,t,i){return i}}class ApplyUpdateResult{constructor(e,t){this.newValue=e,this.didChange=t}}function applyUpdate(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new ApplyUpdateResult(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&equals$1(n,e);return new ApplyUpdateResult(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=applyUpdate(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new ApplyUpdateResult(n,t)}class ComputedEditorOption{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return applyUpdate(e,t)}validate(e){return this.defaultValue}}class SimpleEditorOption{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return applyUpdate(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function boolean(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class EditorBooleanOption extends SimpleEditorOption{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return boolean(e,this.defaultValue)}}function clampedInt(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class EditorIntOption extends SimpleEditorOption{static clampedInt(e,t,i,s){return clampedInt(e,t,i,s)}constructor(e,t,i,s,r,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=s,o.maximum=r),super(e,t,i,o),this.minimum=s,this.maximum=r}validate(e){return EditorIntOption.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function clampedFloat(n,e,t,i){if(typeof n>"u")return e;const s=EditorFloatOption.float(n,e);return EditorFloatOption.clamp(s,t,i)}class EditorFloatOption extends SimpleEditorOption{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,r){typeof r<"u"&&(r.type="number",r.default=i),super(e,t,i,r),this.validationFn=s}validate(e){return this.validationFn(EditorFloatOption.float(e,this.defaultValue))}}class EditorStringOption extends SimpleEditorOption{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return EditorStringOption.string(e,this.defaultValue)}}function stringSet(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class EditorStringEnumOption extends SimpleEditorOption{constructor(e,t,i,s,r=void 0){typeof r<"u"&&(r.type="string",r.enum=s,r.default=i),super(e,t,i,r),this._allowedValues=s}validate(e){return stringSet(e,this.defaultValue,this._allowedValues)}}class EditorEnumOption extends BaseEditorOption{constructor(e,t,i,s,r,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=s),super(e,t,i,a),this._allowedValues=r,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function _autoIndentFromString(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class EditorAccessibilitySupport extends BaseEditorOption{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[localize("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),localize("accessibilitySupport.on","Optimize for usage with a Screen Reader."),localize("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:localize("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class EditorComments extends BaseEditorOption{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:localize("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:localize("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:boolean(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:boolean(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function _cursorBlinkingStyleFromString(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var TextEditorCursorStyle$1;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(TextEditorCursorStyle$1||(TextEditorCursorStyle$1={}));function _cursorStyleFromString(n){switch(n){case"line":return TextEditorCursorStyle$1.Line;case"block":return TextEditorCursorStyle$1.Block;case"underline":return TextEditorCursorStyle$1.Underline;case"line-thin":return TextEditorCursorStyle$1.LineThin;case"block-outline":return TextEditorCursorStyle$1.BlockOutline;case"underline-thin":return TextEditorCursorStyle$1.UnderlineThin}}class EditorClassName extends ComputedEditorOption{constructor(){super(143)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(74)==="default"?s.push("mouse-default"):t.get(74)==="copy"&&s.push("mouse-copy"),t.get(112)&&s.push("showUnused"),t.get(141)&&s.push("showDeprecated"),s.join(" ")}}class EditorEmptySelectionClipboard extends EditorBooleanOption{constructor(){super(37,"emptySelectionClipboard",!0,{description:localize("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class EditorFind extends BaseEditorOption{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:localize("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[localize("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),localize("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),localize("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:localize("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[localize("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),localize("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),localize("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:localize("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:localize("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:isMacintosh},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:localize("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:localize("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:boolean(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":stringSet(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":stringSet(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:boolean(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:boolean(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:boolean(t.loop,this.defaultValue.loop)}}}const ur=class ur extends BaseEditorOption{constructor(){super(51,"fontLigatures",ur.OFF,{anyOf:[{type:"boolean",description:localize("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:localize("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:localize("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?ur.OFF:e==="true"?ur.ON:e:e?ur.ON:ur.OFF}};ur.OFF='"liga" off, "calt" off',ur.ON='"liga" on, "calt" on';let EditorFontLigatures=ur;const hr=class hr extends BaseEditorOption{constructor(){super(54,"fontVariations",hr.OFF,{anyOf:[{type:"boolean",description:localize("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:localize("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:localize("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?hr.OFF:e==="true"?hr.TRANSLATE:e:e?hr.TRANSLATE:hr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};hr.OFF="normal",hr.TRANSLATE="translate";let EditorFontVariations=hr;class EditorFontInfo extends ComputedEditorOption{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class EditorFontSize extends SimpleEditorOption{constructor(){super(52,"fontSize",EDITOR_FONT_DEFAULTS.fontSize,{type:"number",minimum:6,maximum:100,default:EDITOR_FONT_DEFAULTS.fontSize,description:localize("fontSize","Controls the font size in pixels.")})}validate(e){const t=EditorFloatOption.float(e,this.defaultValue);return t===0?EDITOR_FONT_DEFAULTS.fontSize:EditorFloatOption.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const ss=class ss extends BaseEditorOption{constructor(){super(53,"fontWeight",EDITOR_FONT_DEFAULTS.fontWeight,{anyOf:[{type:"number",minimum:ss.MINIMUM_VALUE,maximum:ss.MAXIMUM_VALUE,errorMessage:localize("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:ss.SUGGESTION_VALUES}],default:EDITOR_FONT_DEFAULTS.fontWeight,description:localize("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(EditorIntOption.clampedInt(e,EDITOR_FONT_DEFAULTS.fontWeight,ss.MINIMUM_VALUE,ss.MAXIMUM_VALUE))}};ss.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],ss.MINIMUM_VALUE=1,ss.MAXIMUM_VALUE=1e3;let EditorFontWeight=ss;class EditorGoToLocation extends BaseEditorOption{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[localize("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),localize("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),localize("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:localize("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:localize("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:localize("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:localize("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:localize("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:localize("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:localize("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:localize("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:localize("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:localize("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:localize("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:stringSet(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??stringSet(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??stringSet(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??stringSet(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??stringSet(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??stringSet(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??stringSet(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:EditorStringOption.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:EditorStringOption.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:EditorStringOption.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:EditorStringOption.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:EditorStringOption.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:EditorStringOption.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class EditorHover extends BaseEditorOption{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:localize("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:localize("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:localize("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:localize("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:localize("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),delay:EditorIntOption.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:boolean(t.sticky,this.defaultValue.sticky),hidingDelay:EditorIntOption.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:boolean(t.above,this.defaultValue.above)}}}class EditorLayoutInfoComputer extends ComputedEditorOption{constructor(){super(146)}compute(e,t,i){return EditorLayoutInfoComputer.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const r=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:r,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let f=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,m=e.minimap.size,_=e.minimap.side,v=e.verticalScrollbarWidth,C=e.viewLineCount,S=e.remainingWidth,w=e.isViewportWrapping,L=u?2:3;let I=Math.floor(r*s);const N=I/r;let R=!1,T=!1,A=L*f,F=f/r,B=1;if(m==="fill"||m==="fit"){const{typicalViewportLineCount:q,extraLinesBeforeFirstLine:Q,extraLinesBeyondLastLine:ce,desiredRatio:ie,minimapLineCount:Ce}=EditorLayoutInfoComputer.computeContainedMinimapLineCount({viewLineCount:C,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:r});if(C/Ce>1)R=!0,T=!0,f=1,A=1,F=f/r;else{let be=!1,De=f+1;if(m==="fit"){const Te=Math.ceil((Q+C+ce)*A);w&&a&&S<=t.stableFitRemainingWidth?(be=!0,De=t.stableFitMaxMinimapScale):be=Te>I}if(m==="fill"||be){R=!0;const Te=f;A=Math.min(l*r,Math.max(1,Math.floor(1/ie))),w&&a&&S<=t.stableFitRemainingWidth&&(De=t.stableFitMaxMinimapScale),f=Math.min(De,Math.max(1,Math.floor(A/L))),f>Te&&(B=Math.min(2,f/Te)),F=f/r/B,I=Math.ceil(Math.max(q,Q+C+ce)*A),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=S,t.stableFitMaxMinimapScale=f):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const W=Math.floor(g*F),G=Math.min(W,Math.max(0,Math.floor((S-v-2)*F/(c+F)))+MINIMAP_GUTTER_WIDTH);let j=Math.floor(r*G);const K=j/r;j=Math.floor(j*B);const ee=u?1:2,U=_==="left"?0:i-G-v;return{renderMinimap:ee,minimapLeft:U,minimapWidth:G,minimapHeightIsEditorHeight:R,minimapIsSampling:T,minimapScale:f,minimapLineHeight:A,minimapCanvasInnerWidth:j,minimapCanvasInnerHeight:I,minimapCanvasOuterWidth:K,minimapCanvasOuterHeight:N}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,r=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(138),f=u==="inherit"?e.get(137):u,g=f==="inherit"?e.get(133):f,m=e.get(136),_=t.isDominatedByLongLines,v=e.get(57),C=e.get(68).renderType!==0,S=e.get(69),w=e.get(106),L=e.get(84),I=e.get(73),N=e.get(104),R=N.verticalScrollbarSize,T=N.verticalHasArrows,A=N.arrowSize,F=N.horizontalScrollbarSize,B=e.get(43),W=e.get(111)!=="never";let G=e.get(66);B&&W&&(G+=16);let j=0;if(C){const ze=Math.max(o,S);j=Math.round(ze*l)}let K=0;v&&(K=r*t.glyphMarginDecorationLaneCount);let ee=0,U=ee+K,q=U+j,Q=q+G;const ce=i-K-j-G;let ie=!1,Ce=!1,ae=-1;f==="inherit"&&_?(ie=!0,Ce=!0):g==="on"||g==="bounded"?Ce=!0:g==="wordWrapColumn"&&(ae=m);const be=EditorLayoutInfoComputer._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:L.top,paddingBottom:L.bottom,minimap:I,verticalScrollbarWidth:R,viewLineCount:d,remainingWidth:ce,isViewportWrapping:Ce},t.memory||new ComputeOptionsMemory);be.renderMinimap!==0&&be.minimapLeft===0&&(ee+=be.minimapWidth,U+=be.minimapWidth,q+=be.minimapWidth,Q+=be.minimapWidth);const De=ce-be.minimapWidth,Te=Math.max(1,Math.floor((De-R-2)/a)),xe=T?A:0;return Ce&&(ae=Math.max(1,Te),g==="bounded"&&(ae=Math.min(ae,m))),{width:i,height:s,glyphMarginLeft:ee,glyphMarginWidth:K,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:U,lineNumbersWidth:j,decorationsLeft:q,decorationsWidth:G,contentLeft:Q,contentWidth:De,minimap:be,viewportColumn:Te,isWordWrapMinified:ie,isViewportWrapping:Ce,wrappingColumn:ae,verticalScrollbarWidth:R,horizontalScrollbarHeight:F,overviewRuler:{top:xe,width:R,height:s-2*xe,right:0}}}}class WrappingStrategy extends BaseEditorOption{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[localize("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),localize("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:localize("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return stringSet(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var ShowLightbulbIconMode$1;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(ShowLightbulbIconMode$1||(ShowLightbulbIconMode$1={}));class EditorLightbulb extends BaseEditorOption{constructor(){const e={enabled:ShowLightbulbIconMode$1.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[ShowLightbulbIconMode$1.Off,ShowLightbulbIconMode$1.OnCode,ShowLightbulbIconMode$1.On],default:e.enabled,enumDescriptions:[localize("editor.lightbulb.enabled.off","Disable the code action menu."),localize("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),localize("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:localize("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:stringSet(e.enabled,this.defaultValue.enabled,[ShowLightbulbIconMode$1.Off,ShowLightbulbIconMode$1.OnCode,ShowLightbulbIconMode$1.On])}}}class EditorStickyScroll extends BaseEditorOption{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:localize("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:localize("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:localize("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:localize("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),maxLineCount:EditorIntOption.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:stringSet(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:boolean(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class EditorInlayHints extends BaseEditorOption{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:localize("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[localize("editor.inlayHints.on","Inlay hints are enabled"),localize("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",isMacintosh?"Ctrl+Option":"Ctrl+Alt"),localize("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",isMacintosh?"Ctrl+Option":"Ctrl+Alt"),localize("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:localize("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:localize("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:localize("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:stringSet(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:EditorIntOption.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:EditorStringOption.string(t.fontFamily,this.defaultValue.fontFamily),padding:boolean(t.padding,this.defaultValue.padding)}}}class EditorLineDecorationsWidth extends BaseEditorOption{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):EditorIntOption.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?EditorIntOption.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class EditorLineHeight extends EditorFloatOption{constructor(){super(67,"lineHeight",EDITOR_FONT_DEFAULTS.lineHeight,e=>EditorFloatOption.clamp(e,0,150),{markdownDescription:localize("lineHeight",`Controls the line height. + - Use 0 to automatically compute the line height from the font size. + - Values between 0 and 8 will be used as a multiplier with the font size. + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class EditorMinimap extends BaseEditorOption{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:localize("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:localize("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[localize("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),localize("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),localize("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:localize("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:localize("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:localize("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:localize("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:localize("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:localize("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:localize("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:localize("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:localize("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:localize("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),autohide:boolean(t.autohide,this.defaultValue.autohide),size:stringSet(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:stringSet(t.side,this.defaultValue.side,["right","left"]),showSlider:stringSet(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:boolean(t.renderCharacters,this.defaultValue.renderCharacters),scale:EditorIntOption.clampedInt(t.scale,1,1,3),maxColumn:EditorIntOption.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:boolean(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:boolean(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:EditorFloatOption.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:EditorFloatOption.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function _multiCursorModifierFromString(n){return n==="ctrlCmd"?isMacintosh?"metaKey":"ctrlKey":"altKey"}class EditorPadding extends BaseEditorOption{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:localize("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:localize("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:EditorIntOption.clampedInt(t.top,0,0,1e3),bottom:EditorIntOption.clampedInt(t.bottom,0,0,1e3)}}}class EditorParameterHints extends BaseEditorOption{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:localize("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:localize("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),cycle:boolean(t.cycle,this.defaultValue.cycle)}}}class EditorPixelRatio extends ComputedEditorOption{constructor(){super(144)}compute(e,t,i){return e.pixelRatio}}class PlaceholderOption extends BaseEditorOption{constructor(){super(88,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class EditorQuickSuggestions extends BaseEditorOption{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[localize("on","Quick suggestions show inside the suggest widget"),localize("inline","Quick suggestions show as ghost text"),localize("off","Quick suggestions are disabled")]}];super(90,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:localize("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:localize("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:localize("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:localize("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,r=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=stringSet(t,this.defaultValue.other,r),typeof i=="boolean"?a=i?"on":"off":a=stringSet(i,this.defaultValue.comments,r),typeof s=="boolean"?l=s?"on":"off":l=stringSet(s,this.defaultValue.strings,r),{other:o,comments:a,strings:l}}}class EditorRenderLineNumbersOption extends BaseEditorOption{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[localize("lineNumbers.off","Line numbers are not rendered."),localize("lineNumbers.on","Line numbers are rendered as absolute number."),localize("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),localize("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:localize("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function filterValidationDecorations(n){const e=n.get(99);return e==="editable"?n.get(92):e!=="on"}class EditorRulers extends BaseEditorOption{constructor(){const e=[],t={type:"number",description:localize("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(103,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:localize("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:localize("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:EditorIntOption.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:EditorIntOption.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class ReadonlyMessage extends BaseEditorOption{constructor(){super(93,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function _scrollbarVisibilityFromString(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let EditorScrollbar$1=class extends BaseEditorOption{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(104,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[localize("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),localize("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),localize("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:localize("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[localize("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),localize("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),localize("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:localize("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:localize("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:localize("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:localize("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:localize("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=EditorIntOption.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=EditorIntOption.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:EditorIntOption.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:_scrollbarVisibilityFromString(t.vertical,this.defaultValue.vertical),horizontal:_scrollbarVisibilityFromString(t.horizontal,this.defaultValue.horizontal),useShadows:boolean(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:boolean(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:boolean(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:boolean(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:boolean(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:EditorIntOption.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:EditorIntOption.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:boolean(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:boolean(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const inUntrustedWorkspace="inUntrustedWorkspace",unicodeHighlightConfigKeys={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class UnicodeHighlight extends BaseEditorOption{constructor(){const e={nonBasicASCII:inUntrustedWorkspace,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:inUntrustedWorkspace,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(126,"unicodeHighlight",e,{[unicodeHighlightConfigKeys.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.nonBasicASCII,description:localize("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[unicodeHighlightConfigKeys.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:localize("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[unicodeHighlightConfigKeys.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:localize("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[unicodeHighlightConfigKeys.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.includeComments,description:localize("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[unicodeHighlightConfigKeys.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,inUntrustedWorkspace],default:e.includeStrings,description:localize("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[unicodeHighlightConfigKeys.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:localize("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[unicodeHighlightConfigKeys.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:localize("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(equals(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(equals(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const s=super.applyUpdate(e,t);return i?new ApplyUpdateResult(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:primitiveSet(t.nonBasicASCII,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),invisibleCharacters:boolean(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:boolean(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:primitiveSet(t.includeComments,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),includeStrings:primitiveSet(t.includeStrings,inUntrustedWorkspace,[!0,!1,inUntrustedWorkspace]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,r]of Object.entries(e))r===!0&&(i[s]=!0);return i}}class InlineEditorSuggest extends BaseEditorOption{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:localize("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[localize("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),localize("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),localize("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:localize("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:localize("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:localize("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),mode:stringSet(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:stringSet(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:boolean(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:boolean(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:EditorStringOption.string(t.fontFamily,this.defaultValue.fontFamily)}}}class InlineEditorEdit extends BaseEditorOption{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:localize("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[localize("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),localize("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),localize("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:localize("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:localize("inlineEdit.fontFamily","Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),showToolbar:stringSet(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:EditorStringOption.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:boolean(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class BracketPairColorization extends BaseEditorOption{constructor(){const e={enabled:EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:localize("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:localize("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:boolean(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class GuideOptions extends BaseEditorOption{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[localize("editor.guides.bracketPairs.true","Enables bracket pair guides."),localize("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),localize("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:localize("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[localize("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),localize("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),localize("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:localize("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:localize("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:localize("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[localize("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),localize("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),localize("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:localize("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:primitiveSet(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:primitiveSet(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:boolean(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:boolean(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:primitiveSet(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function primitiveSet(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class EditorSuggest extends BaseEditorOption{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(119,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[localize("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),localize("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:localize("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:localize("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:localize("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:localize("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[localize("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),localize("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),localize("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),localize("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:localize("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:localize("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:localize("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:localize("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:localize("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:localize("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:localize("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:localize("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:localize("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:stringSet(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:boolean(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:boolean(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:boolean(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:boolean(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:stringSet(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:boolean(t.showIcons,this.defaultValue.showIcons),showStatusBar:boolean(t.showStatusBar,this.defaultValue.showStatusBar),preview:boolean(t.preview,this.defaultValue.preview),previewMode:stringSet(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:boolean(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:boolean(t.showMethods,this.defaultValue.showMethods),showFunctions:boolean(t.showFunctions,this.defaultValue.showFunctions),showConstructors:boolean(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:boolean(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:boolean(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:boolean(t.showFields,this.defaultValue.showFields),showVariables:boolean(t.showVariables,this.defaultValue.showVariables),showClasses:boolean(t.showClasses,this.defaultValue.showClasses),showStructs:boolean(t.showStructs,this.defaultValue.showStructs),showInterfaces:boolean(t.showInterfaces,this.defaultValue.showInterfaces),showModules:boolean(t.showModules,this.defaultValue.showModules),showProperties:boolean(t.showProperties,this.defaultValue.showProperties),showEvents:boolean(t.showEvents,this.defaultValue.showEvents),showOperators:boolean(t.showOperators,this.defaultValue.showOperators),showUnits:boolean(t.showUnits,this.defaultValue.showUnits),showValues:boolean(t.showValues,this.defaultValue.showValues),showConstants:boolean(t.showConstants,this.defaultValue.showConstants),showEnums:boolean(t.showEnums,this.defaultValue.showEnums),showEnumMembers:boolean(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:boolean(t.showKeywords,this.defaultValue.showKeywords),showWords:boolean(t.showWords,this.defaultValue.showWords),showColors:boolean(t.showColors,this.defaultValue.showColors),showFiles:boolean(t.showFiles,this.defaultValue.showFiles),showReferences:boolean(t.showReferences,this.defaultValue.showReferences),showFolders:boolean(t.showFolders,this.defaultValue.showFolders),showTypeParameters:boolean(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:boolean(t.showSnippets,this.defaultValue.showSnippets),showUsers:boolean(t.showUsers,this.defaultValue.showUsers),showIssues:boolean(t.showIssues,this.defaultValue.showIssues)}}}class SmartSelect extends BaseEditorOption{constructor(){super(114,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:localize("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:localize("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:boolean(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:boolean(e.selectSubwords,this.defaultValue.selectSubwords)}}}class WordSegmenterLocales extends BaseEditorOption{constructor(){const e=[];super(131,"wordSegmenterLocales",e,{anyOf:[{description:localize("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:localize("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class WrappingIndentOption extends BaseEditorOption{constructor(){super(139,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[localize("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),localize("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),localize("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),localize("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:localize("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class EditorWrappingInfoComputer extends ComputedEditorOption{constructor(){super(147)}compute(e,t,i){const s=t.get(146);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class EditorDropIntoEditor extends BaseEditorOption{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:localize("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:localize("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[localize("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),localize("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),showDropSelector:stringSet(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class EditorPasteAs extends BaseEditorOption{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:localize("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:localize("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[localize("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),localize("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:boolean(t.enabled,this.defaultValue.enabled),showPasteSelector:stringSet(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const DEFAULT_WINDOWS_FONT_FAMILY="Consolas, 'Courier New', monospace",DEFAULT_MAC_FONT_FAMILY="Menlo, Monaco, 'Courier New', monospace",DEFAULT_LINUX_FONT_FAMILY="'Droid Sans Mono', 'monospace', monospace",EDITOR_FONT_DEFAULTS={fontFamily:isMacintosh?DEFAULT_MAC_FONT_FAMILY:isLinux?DEFAULT_LINUX_FONT_FAMILY:DEFAULT_WINDOWS_FONT_FAMILY,fontWeight:"normal",fontSize:isMacintosh?12:14,lineHeight:0,letterSpacing:0},editorOptionsRegistry=[];function register$2(n){return editorOptionsRegistry[n.id]=n,n}const EditorOptions={acceptSuggestionOnCommitCharacter:register$2(new EditorBooleanOption(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:localize("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:register$2(new EditorStringEnumOption(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",localize("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:localize("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:register$2(new EditorAccessibilitySupport),accessibilityPageSize:register$2(new EditorIntOption(3,"accessibilityPageSize",10,1,1073741824,{description:localize("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:register$2(new EditorStringOption(4,"ariaLabel",localize("editorViewAccessibleLabel","Editor content"))),ariaRequired:register$2(new EditorBooleanOption(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:register$2(new EditorBooleanOption(8,"screenReaderAnnounceInlineSuggestion",!0,{description:localize("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:register$2(new EditorStringEnumOption(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",localize("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),localize("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:localize("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:register$2(new EditorStringEnumOption(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",localize("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),localize("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:localize("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:register$2(new EditorStringEnumOption(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",localize("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:localize("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:register$2(new EditorStringEnumOption(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",localize("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:localize("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:register$2(new EditorStringEnumOption(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",localize("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),localize("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:localize("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:register$2(new EditorEnumOption(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],_autoIndentFromString,{enumDescriptions:[localize("editor.autoIndent.none","The editor will not insert indentation automatically."),localize("editor.autoIndent.keep","The editor will keep the current line's indentation."),localize("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),localize("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),localize("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:localize("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:register$2(new EditorBooleanOption(13,"automaticLayout",!1)),autoSurround:register$2(new EditorStringEnumOption(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[localize("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),localize("editor.autoSurround.quotes","Surround with quotes but not brackets."),localize("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:localize("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:register$2(new BracketPairColorization),bracketPairGuides:register$2(new GuideOptions),stickyTabStops:register$2(new EditorBooleanOption(117,"stickyTabStops",!1,{description:localize("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:register$2(new EditorBooleanOption(17,"codeLens",!0,{description:localize("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:register$2(new EditorStringOption(18,"codeLensFontFamily","",{description:localize("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:register$2(new EditorIntOption(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:localize("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:register$2(new EditorBooleanOption(20,"colorDecorators",!0,{description:localize("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:register$2(new EditorStringEnumOption(149,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[localize("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),localize("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),localize("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:localize("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:register$2(new EditorIntOption(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:localize("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:register$2(new EditorBooleanOption(22,"columnSelection",!1,{description:localize("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:register$2(new EditorComments),contextmenu:register$2(new EditorBooleanOption(24,"contextmenu",!0)),copyWithSyntaxHighlighting:register$2(new EditorBooleanOption(25,"copyWithSyntaxHighlighting",!0,{description:localize("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:register$2(new EditorEnumOption(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],_cursorBlinkingStyleFromString,{description:localize("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:register$2(new EditorStringEnumOption(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[localize("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),localize("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),localize("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:localize("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:register$2(new EditorEnumOption(28,"cursorStyle",TextEditorCursorStyle$1.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],_cursorStyleFromString,{description:localize("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:register$2(new EditorIntOption(29,"cursorSurroundingLines",0,0,1073741824,{description:localize("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:register$2(new EditorStringEnumOption(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[localize("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),localize("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:localize("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:register$2(new EditorIntOption(31,"cursorWidth",0,0,1073741824,{markdownDescription:localize("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:register$2(new EditorBooleanOption(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:register$2(new EditorBooleanOption(33,"disableMonospaceOptimizations",!1)),domReadOnly:register$2(new EditorBooleanOption(34,"domReadOnly",!1)),dragAndDrop:register$2(new EditorBooleanOption(35,"dragAndDrop",!0,{description:localize("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:register$2(new EditorEmptySelectionClipboard),dropIntoEditor:register$2(new EditorDropIntoEditor),stickyScroll:register$2(new EditorStickyScroll),experimentalWhitespaceRendering:register$2(new EditorStringEnumOption(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[localize("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),localize("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),localize("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:localize("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:register$2(new EditorStringOption(39,"extraEditorClassName","")),fastScrollSensitivity:register$2(new EditorFloatOption(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:localize("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:register$2(new EditorFind),fixedOverflowWidgets:register$2(new EditorBooleanOption(42,"fixedOverflowWidgets",!1)),folding:register$2(new EditorBooleanOption(43,"folding",!0,{description:localize("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:register$2(new EditorStringEnumOption(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[localize("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),localize("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:localize("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:register$2(new EditorBooleanOption(45,"foldingHighlight",!0,{description:localize("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:register$2(new EditorBooleanOption(46,"foldingImportsByDefault",!1,{description:localize("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:register$2(new EditorIntOption(47,"foldingMaximumRegions",5e3,10,65e3,{description:localize("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:register$2(new EditorBooleanOption(48,"unfoldOnClickAfterEndOfLine",!1,{description:localize("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:register$2(new EditorStringOption(49,"fontFamily",EDITOR_FONT_DEFAULTS.fontFamily,{description:localize("fontFamily","Controls the font family.")})),fontInfo:register$2(new EditorFontInfo),fontLigatures2:register$2(new EditorFontLigatures),fontSize:register$2(new EditorFontSize),fontWeight:register$2(new EditorFontWeight),fontVariations:register$2(new EditorFontVariations),formatOnPaste:register$2(new EditorBooleanOption(55,"formatOnPaste",!1,{description:localize("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:register$2(new EditorBooleanOption(56,"formatOnType",!1,{description:localize("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:register$2(new EditorBooleanOption(57,"glyphMargin",!0,{description:localize("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:register$2(new EditorGoToLocation),hideCursorInOverviewRuler:register$2(new EditorBooleanOption(59,"hideCursorInOverviewRuler",!1,{description:localize("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:register$2(new EditorHover),inDiffEditor:register$2(new EditorBooleanOption(61,"inDiffEditor",!1)),letterSpacing:register$2(new EditorFloatOption(64,"letterSpacing",EDITOR_FONT_DEFAULTS.letterSpacing,n=>EditorFloatOption.clamp(n,-5,20),{description:localize("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:register$2(new EditorLightbulb),lineDecorationsWidth:register$2(new EditorLineDecorationsWidth),lineHeight:register$2(new EditorLineHeight),lineNumbers:register$2(new EditorRenderLineNumbersOption),lineNumbersMinChars:register$2(new EditorIntOption(69,"lineNumbersMinChars",5,1,300)),linkedEditing:register$2(new EditorBooleanOption(70,"linkedEditing",!1,{description:localize("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:register$2(new EditorBooleanOption(71,"links",!0,{description:localize("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:register$2(new EditorStringEnumOption(72,"matchBrackets","always",["always","near","never"],{description:localize("matchBrackets","Highlight matching brackets.")})),minimap:register$2(new EditorMinimap),mouseStyle:register$2(new EditorStringEnumOption(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:register$2(new EditorFloatOption(75,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:localize("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:register$2(new EditorBooleanOption(76,"mouseWheelZoom",!1,{markdownDescription:isMacintosh?localize("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):localize("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:register$2(new EditorBooleanOption(77,"multiCursorMergeOverlapping",!0,{description:localize("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:register$2(new EditorEnumOption(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],_multiCursorModifierFromString,{markdownEnumDescriptions:[localize("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),localize("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:localize({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:register$2(new EditorStringEnumOption(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[localize("multiCursorPaste.spread","Each cursor pastes a single line of the text."),localize("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:localize("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:register$2(new EditorIntOption(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:localize("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:register$2(new EditorStringEnumOption(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[localize("occurrencesHighlight.off","Does not highlight occurrences."),localize("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),localize("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:localize("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:register$2(new EditorBooleanOption(82,"overviewRulerBorder",!0,{description:localize("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:register$2(new EditorIntOption(83,"overviewRulerLanes",3,0,3)),padding:register$2(new EditorPadding),pasteAs:register$2(new EditorPasteAs),parameterHints:register$2(new EditorParameterHints),peekWidgetDefaultFocus:register$2(new EditorStringEnumOption(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[localize("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),localize("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:localize("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:register$2(new PlaceholderOption),definitionLinkOpensInPeek:register$2(new EditorBooleanOption(89,"definitionLinkOpensInPeek",!1,{description:localize("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:register$2(new EditorQuickSuggestions),quickSuggestionsDelay:register$2(new EditorIntOption(91,"quickSuggestionsDelay",10,0,1073741824,{description:localize("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:register$2(new EditorBooleanOption(92,"readOnly",!1)),readOnlyMessage:register$2(new ReadonlyMessage),renameOnType:register$2(new EditorBooleanOption(94,"renameOnType",!1,{description:localize("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:localize("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:register$2(new EditorBooleanOption(95,"renderControlCharacters",!0,{description:localize("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:register$2(new EditorStringEnumOption(96,"renderFinalNewline",isLinux?"dimmed":"on",["off","on","dimmed"],{description:localize("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:register$2(new EditorStringEnumOption(97,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",localize("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:localize("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:register$2(new EditorBooleanOption(98,"renderLineHighlightOnlyWhenFocus",!1,{description:localize("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:register$2(new EditorStringEnumOption(99,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:register$2(new EditorStringEnumOption(100,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",localize("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),localize("renderWhitespace.selection","Render whitespace characters only on selected text."),localize("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:localize("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:register$2(new EditorIntOption(101,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:register$2(new EditorBooleanOption(102,"roundedSelection",!0,{description:localize("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:register$2(new EditorRulers),scrollbar:register$2(new EditorScrollbar$1),scrollBeyondLastColumn:register$2(new EditorIntOption(105,"scrollBeyondLastColumn",4,0,1073741824,{description:localize("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:register$2(new EditorBooleanOption(106,"scrollBeyondLastLine",!0,{description:localize("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:register$2(new EditorBooleanOption(107,"scrollPredominantAxis",!0,{description:localize("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:register$2(new EditorBooleanOption(108,"selectionClipboard",!0,{description:localize("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:isLinux})),selectionHighlight:register$2(new EditorBooleanOption(109,"selectionHighlight",!0,{description:localize("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:register$2(new EditorBooleanOption(110,"selectOnLineNumbers",!0)),showFoldingControls:register$2(new EditorStringEnumOption(111,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[localize("showFoldingControls.always","Always show the folding controls."),localize("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),localize("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:localize("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:register$2(new EditorBooleanOption(112,"showUnused",!0,{description:localize("showUnused","Controls fading out of unused code.")})),showDeprecated:register$2(new EditorBooleanOption(141,"showDeprecated",!0,{description:localize("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:register$2(new EditorInlayHints),snippetSuggestions:register$2(new EditorStringEnumOption(113,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[localize("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),localize("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),localize("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),localize("snippetSuggestions.none","Do not show snippet suggestions.")],description:localize("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:register$2(new SmartSelect),smoothScrolling:register$2(new EditorBooleanOption(115,"smoothScrolling",!1,{description:localize("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:register$2(new EditorIntOption(118,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:register$2(new EditorSuggest),inlineSuggest:register$2(new InlineEditorSuggest),inlineEdit:register$2(new InlineEditorEdit),inlineCompletionsAccessibilityVerbose:register$2(new EditorBooleanOption(150,"inlineCompletionsAccessibilityVerbose",!1,{description:localize("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:register$2(new EditorIntOption(120,"suggestFontSize",0,0,1e3,{markdownDescription:localize("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:register$2(new EditorIntOption(121,"suggestLineHeight",0,0,1e3,{markdownDescription:localize("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:register$2(new EditorBooleanOption(122,"suggestOnTriggerCharacters",!0,{description:localize("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:register$2(new EditorStringEnumOption(123,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[localize("suggestSelection.first","Always select the first suggestion."),localize("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),localize("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:localize("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:register$2(new EditorStringEnumOption(124,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[localize("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),localize("tabCompletion.off","Disable tab completions."),localize("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:localize("tabCompletion","Enables tab completions.")})),tabIndex:register$2(new EditorIntOption(125,"tabIndex",0,-1,1073741824)),unicodeHighlight:register$2(new UnicodeHighlight),unusualLineTerminators:register$2(new EditorStringEnumOption(127,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[localize("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),localize("unusualLineTerminators.off","Unusual line terminators are ignored."),localize("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:localize("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:register$2(new EditorBooleanOption(128,"useShadowDOM",!0)),useTabStops:register$2(new EditorBooleanOption(129,"useTabStops",!0,{description:localize("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:register$2(new EditorStringEnumOption(130,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[localize("wordBreak.normal","Use the default line break rule."),localize("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:localize("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:register$2(new WordSegmenterLocales),wordSeparators:register$2(new EditorStringOption(132,"wordSeparators",USUAL_WORD_SEPARATORS,{description:localize("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:register$2(new EditorStringEnumOption(133,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[localize("wordWrap.off","Lines will never wrap."),localize("wordWrap.on","Lines will wrap at the viewport width."),localize({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),localize({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:localize({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:register$2(new EditorStringOption(134,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:register$2(new EditorStringOption(135,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:register$2(new EditorIntOption(136,"wordWrapColumn",80,1,1073741824,{markdownDescription:localize({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:register$2(new EditorStringEnumOption(137,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:register$2(new EditorStringEnumOption(138,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:register$2(new EditorClassName),defaultColorDecorators:register$2(new EditorBooleanOption(148,"defaultColorDecorators",!1,{markdownDescription:localize("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:register$2(new EditorPixelRatio),tabFocusMode:register$2(new EditorBooleanOption(145,"tabFocusMode",!1,{markdownDescription:localize("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:register$2(new EditorLayoutInfoComputer),wrappingInfo:register$2(new EditorWrappingInfoComputer),wrappingIndent:register$2(new WrappingIndentOption),wrappingStrategy:register$2(new WrappingStrategy)};class ErrorHandler{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ErrorNoTelemetry.isErrorNoTelemetry(e)?new ErrorNoTelemetry(e.message+` + +`+e.stack):new Error(e.message+` + +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const errorHandler=new ErrorHandler;function onUnexpectedError(n){isCancellationError(n)||errorHandler.onUnexpectedError(n)}function onUnexpectedExternalError(n){isCancellationError(n)||errorHandler.onUnexpectedExternalError(n)}function transformErrorForSerialization(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:ErrorNoTelemetry.isErrorNoTelemetry(n)}}return n}const canceledName="Canceled";function isCancellationError(n){return n instanceof CancellationError?!0:n instanceof Error&&n.name===canceledName&&n.message===canceledName}class CancellationError extends Error{constructor(){super(canceledName),this.name=this.message}}function canceled(){const n=new Error(canceledName);return n.name=n.message,n}function illegalArgument(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function illegalState(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class NotSupportedError extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class ErrorNoTelemetry extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof ErrorNoTelemetry)return e;const t=new ErrorNoTelemetry;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class BugIndicatingError extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,BugIndicatingError.prototype)}}function createSingleCallFunction(n,e){const t=this;let i=!1,s;return function(){if(i)return s;if(i=!0,e)try{s=n.apply(t,arguments)}finally{e()}else s=n.apply(t,arguments);return s}}function trackDisposable(n){return n}function setParentOfDisposable(n,e){}function markAsSingleton(n){return n}function isDisposable(n){return typeof n=="object"&&n!==null&&typeof n.dispose=="function"&&n.dispose.length===0}function dispose(n){if(Iterable.is(n)){const e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function combinedDisposable(...n){return toDisposable(()=>dispose(n))}function toDisposable(n){return{dispose:createSingleCallFunction(()=>{n()})}}const xh=class xh{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{dispose(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?xh.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}};xh.DISABLE_DISPOSED_WARNING=!1;let DisposableStore=xh;const bm=class bm{constructor(){this._store=new DisposableStore,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};bm.None=Object.freeze({dispose(){}});let Disposable=bm;class MutableDisposable{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class RefCountedDisposable{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class ImmortalReference{constructor(e){this.object=e}dispose(){}}class DisposableMap{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{dispose(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))==null||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const hasPerformanceNow=globalThis.performance&&typeof globalThis.performance.now=="function";class StopWatch{static create(e){return new StopWatch(e)}constructor(e){this._now=hasPerformanceNow&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var Event$1;(function(n){n.None=()=>Disposable.None;function e(G,j){return f(G,()=>{},0,void 0,!0,void 0,j)}n.defer=e;function t(G){return(j,K=null,ee)=>{let U=!1,q;return q=G(Q=>{if(!U)return q?q.dispose():U=!0,j.call(K,Q)},null,ee),U&&q.dispose(),q}}n.once=t;function i(G,j){return n.once(n.filter(G,j))}n.onceIf=i;function s(G,j,K){return d((ee,U=null,q)=>G(Q=>ee.call(U,j(Q)),null,q),K)}n.map=s;function r(G,j,K){return d((ee,U=null,q)=>G(Q=>{j(Q),ee.call(U,Q)},null,q),K)}n.forEach=r;function o(G,j,K){return d((ee,U=null,q)=>G(Q=>j(Q)&&ee.call(U,Q),null,q),K)}n.filter=o;function a(G){return G}n.signal=a;function l(...G){return(j,K=null,ee)=>{const U=combinedDisposable(...G.map(q=>q(Q=>j.call(K,Q))));return u(U,ee)}}n.any=l;function c(G,j,K,ee){let U=K;return s(G,q=>(U=j(U,q),U),ee)}n.reduce=c;function d(G,j){let K;const ee={onWillAddFirstListener(){K=G(U.fire,U)},onDidRemoveLastListener(){K==null||K.dispose()}},U=new Emitter$1(ee);return j==null||j.add(U),U.event}function u(G,j){return j instanceof Array?j.push(G):j&&j.add(G),G}function f(G,j,K=100,ee=!1,U=!1,q,Q){let ce,ie,Ce,ae=0,be;const De={leakWarningThreshold:q,onWillAddFirstListener(){ce=G(xe=>{ae++,ie=j(ie,xe),ee&&!Ce&&(Te.fire(ie),ie=void 0),be=()=>{const ze=ie;ie=void 0,Ce=void 0,(!ee||ae>1)&&Te.fire(ze),ae=0},typeof K=="number"?(clearTimeout(Ce),Ce=setTimeout(be,K)):Ce===void 0&&(Ce=0,queueMicrotask(be))})},onWillRemoveListener(){U&&ae>0&&(be==null||be())},onDidRemoveLastListener(){be=void 0,ce.dispose()}},Te=new Emitter$1(De);return Q==null||Q.add(Te),Te.event}n.debounce=f;function g(G,j=0,K){return n.debounce(G,(ee,U)=>ee?(ee.push(U),ee):[U],j,void 0,!0,void 0,K)}n.accumulate=g;function m(G,j=(ee,U)=>ee===U,K){let ee=!0,U;return o(G,q=>{const Q=ee||!j(q,U);return ee=!1,U=q,Q},K)}n.latch=m;function _(G,j,K){return[n.filter(G,j,K),n.filter(G,ee=>!j(ee),K)]}n.split=_;function v(G,j=!1,K=[],ee){let U=K.slice(),q=G(ie=>{U?U.push(ie):ce.fire(ie)});ee&&ee.add(q);const Q=()=>{U==null||U.forEach(ie=>ce.fire(ie)),U=null},ce=new Emitter$1({onWillAddFirstListener(){q||(q=G(ie=>ce.fire(ie)),ee&&ee.add(q))},onDidAddFirstListener(){U&&(j?setTimeout(Q):Q())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return ee&&ee.add(ce),ce.event}n.buffer=v;function C(G,j){return(ee,U,q)=>{const Q=j(new w);return G(function(ce){const ie=Q.evaluate(ce);ie!==S&&ee.call(U,ie)},void 0,q)}}n.chain=C;const S=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(K=>(j(K),K)),this}filter(j){return this.steps.push(K=>j(K)?K:S),this}reduce(j,K){let ee=K;return this.steps.push(U=>(ee=j(ee,U),ee)),this}latch(j=(K,ee)=>K===ee){let K=!0,ee;return this.steps.push(U=>{const q=K||!j(U,ee);return K=!1,ee=U,q?U:S}),this}evaluate(j){for(const K of this.steps)if(j=K(j),j===S)break;return j}}function L(G,j,K=ee=>ee){const ee=(...ce)=>Q.fire(K(...ce)),U=()=>G.on(j,ee),q=()=>G.removeListener(j,ee),Q=new Emitter$1({onWillAddFirstListener:U,onDidRemoveLastListener:q});return Q.event}n.fromNodeEventEmitter=L;function I(G,j,K=ee=>ee){const ee=(...ce)=>Q.fire(K(...ce)),U=()=>G.addEventListener(j,ee),q=()=>G.removeEventListener(j,ee),Q=new Emitter$1({onWillAddFirstListener:U,onDidRemoveLastListener:q});return Q.event}n.fromDOMEventEmitter=I;function N(G){return new Promise(j=>t(G)(j))}n.toPromise=N;function R(G){const j=new Emitter$1;return G.then(K=>{j.fire(K)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}n.fromPromise=R;function T(G,j){return G(K=>j.fire(K))}n.forward=T;function A(G,j,K){return j(K),G(ee=>j(ee))}n.runAndSubscribe=A;class F{constructor(j,K){this._observable=j,this._counter=0,this._hasChanged=!1;const ee={onWillAddFirstListener:()=>{j.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Emitter$1(ee),K&&K.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,K){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(G,j){return new F(G,j).emitter.event}n.fromObservable=B;function W(G){return(j,K,ee)=>{let U=0,q=!1;const Q={beginUpdate(){U++},endUpdate(){U--,U===0&&(G.reportChanges(),q&&(q=!1,j.call(K)))},handlePossibleChange(){},handleChange(){q=!0}};G.addObserver(Q),G.reportChanges();const ce={dispose(){G.removeObserver(Q)}};return ee instanceof DisposableStore?ee.add(ce):Array.isArray(ee)&&ee.push(ce),ce}}n.fromObservableLight=W})(Event$1||(Event$1={}));const sl=class sl{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${sl._idPool++}`,sl.all.add(this)}start(e){this._stopWatch=new StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};sl.all=new Set,sl._idPool=0;let EventProfiling=sl,_globalLeakWarningThreshold=-1;const Eh=class Eh{constructor(e,t,i=(Eh._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t{var a,l,c,d,u;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const f=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(f);const g=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new ListenerRefusalError(`${f}. HINT: Stack shows most frequent listener (${g[1]}-times)`,g[0]);return(((a=this._options)==null?void 0:a.onListenerError)||onUnexpectedError)(m),Disposable.None}if(this._disposed)return Disposable.None;t&&(e=e.bind(t));const s=new UniqueContainer(e);let r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Stacktrace.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof UniqueContainer?(this._deliveryQueue??(this._deliveryQueue=new EventDeliveryQueuePrivate),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=s,(u=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||u.call(d,this)),this._size++;const o=toDisposable(()=>{r==null||r(),this._removeListener(s)});return i instanceof DisposableStore?i.add(o):Array.isArray(i)&&i.push(o),o}),this._event}_removeListener(e){var r,o,a,l;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*compactionThreshold<=t.length){let c=0;for(let d=0;d0}};const createEventDeliveryQueue=()=>new EventDeliveryQueuePrivate;class EventDeliveryQueuePrivate{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class PauseableEmitter extends Emitter$1{constructor(e){super(e),this._isPaused=0,this._eventQueue=new LinkedList,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class DebounceEmitter extends PauseableEmitter{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class MicrotaskEmitter extends Emitter$1{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class EventMultiplexer{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Emitter$1({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),toDisposable(createSingleCallFunction(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class EventBufferer{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,r,o)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(r,a)):s.call(r,a);return}const c=l;if(!c){s.call(r,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),s.call(r,c.reducedResult)})},void 0,o)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(s=>s()),i}}class Relay{constructor(){this.listening=!1,this.inputEvent=Event$1.None,this.inputEventListener=Disposable.None,this.emitter=new Emitter$1({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const shortcutEvent=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var CancellationToken;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof MutableToken?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Event$1.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:shortcutEvent})})(CancellationToken||(CancellationToken={}));class MutableToken{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?shortcutEvent:(this._emitter||(this._emitter=new Emitter$1),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let CancellationTokenSource$1=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new MutableToken),this._token}cancel(){this._token?this._token instanceof MutableToken&&this._token.cancel():this._token=CancellationToken.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)==null||t.dispose(),this._token?this._token instanceof MutableToken&&this._token.dispose():this._token=CancellationToken.None}};function cancelOnDispose(n){const e=new CancellationTokenSource$1;return n.add({dispose(){e.cancel()}}),e.token}class KeyCodeStrMap{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const uiMap=new KeyCodeStrMap,userSettingsUSMap=new KeyCodeStrMap,userSettingsGeneralMap=new KeyCodeStrMap,EVENT_KEY_CODE_MAP=new Array(230),scanCodeStrToInt=Object.create(null),scanCodeLowerCaseStrToInt=Object.create(null),IMMUTABLE_CODE_TO_KEY_CODE=[];for(let n=0;n<=193;n++)IMMUTABLE_CODE_TO_KEY_CODE[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[r,o,a,l,c,d,u,f,g]=s;if(i[o]||(i[o]=!0,scanCodeStrToInt[a]=o,scanCodeLowerCaseStrToInt[a.toLowerCase()]=o,r&&(IMMUTABLE_CODE_TO_KEY_CODE[o]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);uiMap.define(l,c),userSettingsUSMap.define(l,f||c),userSettingsGeneralMap.define(l,g||f||c)}d&&(EVENT_KEY_CODE_MAP[d]=l)}})();var KeyCodeUtils;(function(n){function e(a){return uiMap.keyCodeToStr(a)}n.toString=e;function t(a){return uiMap.strToKeyCode(a)}n.fromString=t;function i(a){return userSettingsUSMap.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return userSettingsGeneralMap.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function r(a){return userSettingsUSMap.strToKeyCode(a)||userSettingsGeneralMap.strToKeyCode(a)}n.fromUserSettings=r;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return uiMap.keyCodeToStr(a)}n.toElectronAccelerator=o})(KeyCodeUtils||(KeyCodeUtils={}));function KeyChord(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let safeProcess;const vscodeGlobal=globalThis.vscode;var qv;if(typeof vscodeGlobal<"u"&&typeof vscodeGlobal.process<"u"){const n=vscodeGlobal.process;safeProcess={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"&&typeof((qv=process==null?void 0:process.versions)==null?void 0:qv.node)=="string"?safeProcess={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:safeProcess={get platform(){return isWindows?"win32":isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const cwd$1=safeProcess.cwd,env$1=safeProcess.env,platform$1=safeProcess.platform,CHAR_UPPERCASE_A=65,CHAR_LOWERCASE_A=97,CHAR_UPPERCASE_Z=90,CHAR_LOWERCASE_Z=122,CHAR_DOT=46,CHAR_FORWARD_SLASH=47,CHAR_BACKWARD_SLASH=92,CHAR_COLON=58,CHAR_QUESTION_MARK=63;class ErrorInvalidArgType extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const r=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${r} ${s} of type ${t}`;o+=`. Received type ${typeof i}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function validateObject(n,e){if(n===null||typeof n!="object")throw new ErrorInvalidArgType(e,"Object",n)}function validateString(n,e){if(typeof n!="string")throw new ErrorInvalidArgType(e,"string",n)}const platformIsWin32=platform$1==="win32";function isPathSeparator$1(n){return n===CHAR_FORWARD_SLASH||n===CHAR_BACKWARD_SLASH}function isPosixPathSeparator(n){return n===CHAR_FORWARD_SLASH}function isWindowsDeviceRoot(n){return n>=CHAR_UPPERCASE_A&&n<=CHAR_UPPERCASE_Z||n>=CHAR_LOWERCASE_A&&n<=CHAR_LOWERCASE_Z}function normalizeString(n,e,t,i){let s="",r=0,o=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){const d=s.lastIndexOf(t);d===-1?(s="",r=0):(s=s.slice(0,d),r=s.length-1-s.lastIndexOf(t)),o=c,a=0;continue}else if(s.length!==0){s="",r=0,o=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",r=2)}else s.length>0?s+=`${t}${n.slice(o+1,c)}`:s=n.slice(o+1,c),r=c-o-1;o=c,a=0}else l===CHAR_DOT&&a!==-1?++a:a=-1}return s}function formatExt(n){return n?`${n[0]==="."?"":"."}${n}`:""}function _format(n,e){validateObject(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${formatExt(e.ext)}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const win32={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let r;if(s>=0){if(r=n[s],validateString(r,`paths[${s}]`),r.length===0)continue}else e.length===0?r=cwd$1():(r=env$1[`=${e}`]||cwd$1(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===CHAR_BACKWARD_SLASH)&&(r=`${e}\\`));const o=r.length;let a=0,l="",c=!1;const d=r.charCodeAt(0);if(o===1)isPathSeparator$1(d)&&(a=1,c=!0);else if(isPathSeparator$1(d))if(c=!0,isPathSeparator$1(r.charCodeAt(1))){let u=2,f=u;for(;u2&&isPathSeparator$1(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=normalizeString(t,!i,"\\",isPathSeparator$1),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){validateString(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const r=n.charCodeAt(0);if(e===1)return isPosixPathSeparator(r)?"\\":n;if(isPathSeparator$1(r))if(s=!0,isPathSeparator$1(n.charCodeAt(1))){let a=2,l=a;for(;a2&&isPathSeparator$1(n.charCodeAt(2))&&(s=!0,t=3));let o=t0&&isPathSeparator$1(n.charCodeAt(e-1))&&(o+="\\"),i===void 0?s?`\\${o}`:o:s?`${i}\\${o}`:`${i}${o}`},isAbsolute(n){validateString(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return isPathSeparator$1(t)||e>2&&isWindowsDeviceRoot(t)&&n.charCodeAt(1)===CHAR_COLON&&isPathSeparator$1(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let r=0;r0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&isPathSeparator$1(t.charCodeAt(0))){++s;const r=t.length;r>1&&isPathSeparator$1(t.charCodeAt(1))&&(++s,r>2&&(isPathSeparator$1(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return win32.normalize(e)},relative(n,e){if(validateString(n,"from"),validateString(e,"to"),n===e)return"";const t=win32.resolve(n),i=win32.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(r-1)===CHAR_BACKWARD_SLASH;)r--;const o=r-s;let a=0;for(;aa&&e.charCodeAt(l-1)===CHAR_BACKWARD_SLASH;)l--;const c=l-a,d=od){if(e.charCodeAt(a+f)===CHAR_BACKWARD_SLASH)return i.slice(a+f+1);if(f===2)return i.slice(a+f)}o>d&&(n.charCodeAt(s+f)===CHAR_BACKWARD_SLASH?u=f:f===2&&(u=3)),u===-1&&(u=0)}let g="";for(f=s+u+1;f<=r;++f)(f===r||n.charCodeAt(f)===CHAR_BACKWARD_SLASH)&&(g+=g.length===0?"..":"\\..");return a+=u,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===CHAR_BACKWARD_SLASH&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=win32.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===CHAR_BACKWARD_SLASH){if(e.charCodeAt(1)===CHAR_BACKWARD_SLASH){const t=e.charCodeAt(2);if(t!==CHAR_QUESTION_MARK&&t!==CHAR_DOT)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(isWindowsDeviceRoot(e.charCodeAt(0))&&e.charCodeAt(1)===CHAR_COLON&&e.charCodeAt(2)===CHAR_BACKWARD_SLASH)return`\\\\?\\${e}`;return n},dirname(n){validateString(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return isPathSeparator$1(s)?n:".";if(isPathSeparator$1(s)){if(t=i=1,isPathSeparator$1(n.charCodeAt(1))){let a=2,l=a;for(;a2&&isPathSeparator$1(n.charCodeAt(2))?3:2,i=t);let r=-1,o=!0;for(let a=e-1;a>=i;--a)if(isPathSeparator$1(n.charCodeAt(a))){if(!o){r=a;break}}else o=!1;if(r===-1){if(t===-1)return".";r=t}return n.slice(0,r)},basename(n,e){e!==void 0&&validateString(e,"suffix"),validateString(n,"path");let t=0,i=-1,s=!0,r;if(n.length>=2&&isWindowsDeviceRoot(n.charCodeAt(0))&&n.charCodeAt(1)===CHAR_COLON&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(r=n.length-1;r>=t;--r){const l=n.charCodeAt(r);if(isPathSeparator$1(l)){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(r=n.length-1;r>=t;--r)if(isPathSeparator$1(n.charCodeAt(r))){if(!s){t=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":n.slice(t,i)},extname(n){validateString(n,"path");let e=0,t=-1,i=0,s=-1,r=!0,o=0;n.length>=2&&n.charCodeAt(1)===CHAR_COLON&&isWindowsDeviceRoot(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(isPathSeparator$1(l)){if(!r){i=a+1;break}continue}s===-1&&(r=!1,s=a+1),l===CHAR_DOT?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||s===-1||o===0||o===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:_format.bind(null,"\\"),parse(n){validateString(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return isPathSeparator$1(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(isPathSeparator$1(s)){if(i=1,isPathSeparator$1(n.charCodeAt(1))){let u=2,f=u;for(;u0&&(e.root=n.slice(0,i));let r=-1,o=i,a=-1,l=!0,c=n.length-1,d=0;for(;c>=i;--c){if(s=n.charCodeAt(c),isPathSeparator$1(s)){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===CHAR_DOT?r===-1?r=c:d!==1&&(d=1):r!==-1&&(d=-1)}return a!==-1&&(r===-1||d===0||d===1&&r===a-1&&r===o+1?e.base=e.name=n.slice(o,a):(e.name=n.slice(o,r),e.base=n.slice(o,a),e.ext=n.slice(r,a))),o>0&&o!==i?e.dir=n.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},posixCwd=(()=>{if(platformIsWin32){const n=/\\/g;return()=>{const e=cwd$1().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>cwd$1()})(),posix={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:posixCwd();validateString(s,`paths[${i}]`),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===CHAR_FORWARD_SLASH)}return e=normalizeString(e,!t,"/",isPosixPathSeparator),t?`/${e}`:e.length>0?e:"."},normalize(n){if(validateString(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===CHAR_FORWARD_SLASH,t=n.charCodeAt(n.length-1)===CHAR_FORWARD_SLASH;return n=normalizeString(n,!e,"/",isPosixPathSeparator),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return validateString(n,"path"),n.length>0&&n.charCodeAt(0)===CHAR_FORWARD_SLASH},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":posix.normalize(e)},relative(n,e){if(validateString(n,"from"),validateString(e,"to"),n===e||(n=posix.resolve(n),e=posix.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,r=1,o=e.length-r,a=sa){if(e.charCodeAt(r+c)===CHAR_FORWARD_SLASH)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else s>a&&(n.charCodeAt(t+c)===CHAR_FORWARD_SLASH?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===CHAR_FORWARD_SLASH)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(r+l)}`},toNamespacedPath(n){return n},dirname(n){if(validateString(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===CHAR_FORWARD_SLASH;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===CHAR_FORWARD_SLASH){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&validateString(e,"ext"),validateString(n,"path");let t=0,i=-1,s=!0,r;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let o=e.length-1,a=-1;for(r=n.length-1;r>=0;--r){const l=n.charCodeAt(r);if(l===CHAR_FORWARD_SLASH){if(!s){t=r+1;break}}else a===-1&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(r=n.length-1;r>=0;--r)if(n.charCodeAt(r)===CHAR_FORWARD_SLASH){if(!s){t=r+1;break}}else i===-1&&(s=!1,i=r+1);return i===-1?"":n.slice(t,i)},extname(n){validateString(n,"path");let e=-1,t=0,i=-1,s=!0,r=0;for(let o=n.length-1;o>=0;--o){const a=n.charCodeAt(o);if(a===CHAR_FORWARD_SLASH){if(!s){t=o+1;break}continue}i===-1&&(s=!1,i=o+1),a===CHAR_DOT?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:_format.bind(null,"/"),parse(n){validateString(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===CHAR_FORWARD_SLASH;let i;t?(e.root="/",i=1):i=0;let s=-1,r=0,o=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const d=n.charCodeAt(l);if(d===CHAR_FORWARD_SLASH){if(!a){r=l+1;break}continue}o===-1&&(a=!1,o=l+1),d===CHAR_DOT?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(o!==-1){const d=r===0&&t?1:r;s===-1||c===0||c===1&&s===o-1&&s===r+1?e.base=e.name=n.slice(d,o):(e.name=n.slice(d,s),e.base=n.slice(d,o),e.ext=n.slice(s,o))}return r>0?e.dir=n.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};posix.win32=win32.win32=win32;posix.posix=win32.posix=posix;const normalize=platformIsWin32?win32.normalize:posix.normalize,join$2=platformIsWin32?win32.join:posix.join,resolve$1=platformIsWin32?win32.resolve:posix.resolve,relative$1=platformIsWin32?win32.relative:posix.relative,dirname$2=platformIsWin32?win32.dirname:posix.dirname,basename$2=platformIsWin32?win32.basename:posix.basename,extname$2=platformIsWin32?win32.extname:posix.extname,sep$1=platformIsWin32?win32.sep:posix.sep,_schemePattern=/^\w[\w\d+.-]*$/,_singleSlashStart=/^\//,_doubleSlashStart=/^\/\//;function _validateUri(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!_schemePattern.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!_singleSlashStart.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(_doubleSlashStart.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function _schemeFix(n,e){return!n&&!e?"file":n}function _referenceResolution(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==_slash&&(e=_slash+e):e=_slash;break}return e}const _empty="",_slash="/",_regexp=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class URI{static isUri(e){return e instanceof URI?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,r,o=!1){typeof e=="object"?(this.scheme=e.scheme||_empty,this.authority=e.authority||_empty,this.path=e.path||_empty,this.query=e.query||_empty,this.fragment=e.fragment||_empty):(this.scheme=_schemeFix(e,o),this.authority=t||_empty,this.path=_referenceResolution(this.scheme,i||_empty),this.query=s||_empty,this.fragment=r||_empty,_validateUri(this,o))}get fsPath(){return uriToFsPath(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:r,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=_empty),i===void 0?i=this.authority:i===null&&(i=_empty),s===void 0?s=this.path:s===null&&(s=_empty),r===void 0?r=this.query:r===null&&(r=_empty),o===void 0?o=this.fragment:o===null&&(o=_empty),t===this.scheme&&i===this.authority&&s===this.path&&r===this.query&&o===this.fragment?this:new Uri$1(t,i,s,r,o)}static parse(e,t=!1){const i=_regexp.exec(e);return i?new Uri$1(i[2]||_empty,percentDecode(i[4]||_empty),percentDecode(i[5]||_empty),percentDecode(i[7]||_empty),percentDecode(i[9]||_empty),t):new Uri$1(_empty,_empty,_empty,_empty,_empty)}static file(e){let t=_empty;if(isWindows&&(e=e.replace(/\\/g,_slash)),e[0]===_slash&&e[1]===_slash){const i=e.indexOf(_slash,2);i===-1?(t=e.substring(2),e=_slash):(t=e.substring(2,i),e=e.substring(i)||_slash)}return new Uri$1("file",t,e,_empty,_empty)}static from(e,t){return new Uri$1(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return isWindows&&e.scheme==="file"?i=URI.file(win32.join(uriToFsPath(e,!0),...t)).path:i=posix.join(e.path,...t),e.with({path:i})}toString(e=!1){return _asFormatted(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof URI)return e;{const t=new Uri$1(e);return t._formatted=e.external??null,t._fsPath=e._sep===_pathSepMarker?e.fsPath??null:null,t}}else return e}}const _pathSepMarker=isWindows?1:void 0;let Uri$1=class extends URI{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=uriToFsPath(this,!1)),this._fsPath}toString(e=!1){return e?_asFormatted(this,!0):(this._formatted||(this._formatted=_asFormatted(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=_pathSepMarker),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const encodeTable={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function encodeURIComponentFast(n,e,t){let i,s=-1;for(let r=0;r=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||t&&o===91||t&&o===93||t&&o===58)s!==-1&&(i+=encodeURIComponent(n.substring(s,r)),s=-1),i!==void 0&&(i+=n.charAt(r));else{i===void 0&&(i=n.substr(0,r));const a=encodeTable[o];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,r)),s=-1),i+=a):s===-1&&(s=r)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function encodeURIComponentMinimal(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,isWindows&&(t=t.replace(/\//g,"\\")),t}function _asFormatted(n,e){const t=e?encodeURIComponentMinimal:encodeURIComponentFast;let i="",{scheme:s,authority:r,path:o,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(r||s==="file")&&(i+=_slash,i+=_slash),r){let c=r.indexOf("@");if(c!==-1){const d=r.substr(0,c);r=r.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?i+=t(r,!1,!0):(i+=t(r.substr(0,c),!1,!0),i+=r.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const c=o.charCodeAt(1);c>=65&&c<=90&&(o=`/${String.fromCharCode(c+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const c=o.charCodeAt(0);c>=65&&c<=90&&(o=`${String.fromCharCode(c+32)}:${o.substr(2)}`)}i+=t(o,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:encodeURIComponentFast(l,!1,!1)),i}function decodeURIComponentGraceful(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+decodeURIComponentGraceful(n.substr(3)):n}}const _rEncodedAsHex=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function percentDecode(n){return n.match(_rEncodedAsHex)?n.replace(_rEncodedAsHex,e=>decodeURIComponentGraceful(e)):n}let Position$1=class Jo{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Jo(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Jo.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Jo.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return $i.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return $i.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return $i.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return $i.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return $i.plusRange(this,e)}static plusRange(e,t){let i,s,r,o;return t.startLineNumbere.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new $i(i,s,r,o)}intersectRanges(e){return $i.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(r=c,o=d):r===c&&(o=Math.min(o,d)),i>r||i===r&&s>o?null:new $i(i,s,r,o)}equalsRange(e){return $i.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return $i.getEndPosition(this)}static getEndPosition(e){return new Position$1(e.endLineNumber,e.endColumn)}getStartPosition(){return $i.getStartPosition(this)}static getStartPosition(e){return new Position$1(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new $i(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new $i(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return $i.collapseToStart(this)}static collapseToStart(e){return new $i(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return $i.collapseToEnd(this)}static collapseToEnd(e){return new $i(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new $i(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new $i(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new $i(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},Selection$1=class Pn extends Range$2{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Pn.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Pn(this.startLineNumber,this.startColumn,e,t):new Pn(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Position$1(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Position$1(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Pn(e,t,this.endLineNumber,this.endColumn):new Pn(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Pn(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Pn(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Pn(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Pn(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var s;(s=this._factories.get(e))==null||s.dispose();const i=new TokenizationSupportFactoryData(this,e,t);return this._factories.set(e,i),toDisposable(()=>{const r=this._factories.get(e);!r||r!==i||(this._factories.delete(e),r.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class TokenizationSupportFactoryData extends Disposable{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let Token$2=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class TokenizationResult{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class EncodedTokenizationResult{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var HoverVerbosityAction$1;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(HoverVerbosityAction$1||(HoverVerbosityAction$1={}));var CompletionItemKinds;(function(n){const e=new Map;e.set(0,Codicon.symbolMethod),e.set(1,Codicon.symbolFunction),e.set(2,Codicon.symbolConstructor),e.set(3,Codicon.symbolField),e.set(4,Codicon.symbolVariable),e.set(5,Codicon.symbolClass),e.set(6,Codicon.symbolStruct),e.set(7,Codicon.symbolInterface),e.set(8,Codicon.symbolModule),e.set(9,Codicon.symbolProperty),e.set(10,Codicon.symbolEvent),e.set(11,Codicon.symbolOperator),e.set(12,Codicon.symbolUnit),e.set(13,Codicon.symbolValue),e.set(15,Codicon.symbolEnum),e.set(14,Codicon.symbolConstant),e.set(15,Codicon.symbolEnum),e.set(16,Codicon.symbolEnumMember),e.set(17,Codicon.symbolKeyword),e.set(27,Codicon.symbolSnippet),e.set(18,Codicon.symbolText),e.set(19,Codicon.symbolColor),e.set(20,Codicon.symbolFile),e.set(21,Codicon.symbolReference),e.set(22,Codicon.symbolCustomColor),e.set(23,Codicon.symbolFolder),e.set(24,Codicon.symbolTypeParameter),e.set(25,Codicon.account),e.set(26,Codicon.issues);function t(r){let o=e.get(r);return o||(console.info("No codicon found for CompletionItemKind "+r),o=Codicon.symbolProperty),o}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function s(r,o){let a=i.get(r);return typeof a>"u"&&!o&&(a=9),a}n.fromString=s})(CompletionItemKinds||(CompletionItemKinds={}));var InlineCompletionTriggerKind$1;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(InlineCompletionTriggerKind$1||(InlineCompletionTriggerKind$1={}));class SelectedSuggestionInfo{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return Range$2.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var DocumentPasteTriggerKind;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(DocumentPasteTriggerKind||(DocumentPasteTriggerKind={}));var SignatureHelpTriggerKind$1;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(SignatureHelpTriggerKind$1||(SignatureHelpTriggerKind$1={}));var DocumentHighlightKind$1;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(DocumentHighlightKind$1||(DocumentHighlightKind$1={}));function isLocationLink(n){return n&&URI.isUri(n.uri)&&Range$2.isIRange(n.range)&&(Range$2.isIRange(n.originSelectionRange)||Range$2.isIRange(n.targetSelectionRange))}const symbolKindNames={17:localize("Array","array"),16:localize("Boolean","boolean"),4:localize("Class","class"),13:localize("Constant","constant"),8:localize("Constructor","constructor"),9:localize("Enum","enumeration"),21:localize("EnumMember","enumeration member"),23:localize("Event","event"),7:localize("Field","field"),0:localize("File","file"),11:localize("Function","function"),10:localize("Interface","interface"),19:localize("Key","key"),5:localize("Method","method"),1:localize("Module","module"),2:localize("Namespace","namespace"),20:localize("Null","null"),15:localize("Number","number"),18:localize("Object","object"),24:localize("Operator","operator"),3:localize("Package","package"),6:localize("Property","property"),14:localize("String","string"),22:localize("Struct","struct"),25:localize("TypeParameter","type parameter"),12:localize("Variable","variable")};function getAriaLabelForSymbol(n,e){return localize("symbolAriaLabel","{0} ({1})",n,symbolKindNames[e])}var SymbolKinds;(function(n){const e=new Map;e.set(0,Codicon.symbolFile),e.set(1,Codicon.symbolModule),e.set(2,Codicon.symbolNamespace),e.set(3,Codicon.symbolPackage),e.set(4,Codicon.symbolClass),e.set(5,Codicon.symbolMethod),e.set(6,Codicon.symbolProperty),e.set(7,Codicon.symbolField),e.set(8,Codicon.symbolConstructor),e.set(9,Codicon.symbolEnum),e.set(10,Codicon.symbolInterface),e.set(11,Codicon.symbolFunction),e.set(12,Codicon.symbolVariable),e.set(13,Codicon.symbolConstant),e.set(14,Codicon.symbolString),e.set(15,Codicon.symbolNumber),e.set(16,Codicon.symbolBoolean),e.set(17,Codicon.symbolArray),e.set(18,Codicon.symbolObject),e.set(19,Codicon.symbolKey),e.set(20,Codicon.symbolNull),e.set(21,Codicon.symbolEnumMember),e.set(22,Codicon.symbolStruct),e.set(23,Codicon.symbolEvent),e.set(24,Codicon.symbolOperator),e.set(25,Codicon.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=Codicon.symbolProperty),s}n.toIcon=t})(SymbolKinds||(SymbolKinds={}));const Mn=class Mn{static fromValue(e){switch(e){case"comment":return Mn.Comment;case"imports":return Mn.Imports;case"region":return Mn.Region}return new Mn(e)}constructor(e){this.value=e}};Mn.Comment=new Mn("comment"),Mn.Imports=new Mn("imports"),Mn.Region=new Mn("region");let FoldingRangeKind=Mn;var NewSymbolNameTag$1;(function(n){n[n.AIGenerated=1]="AIGenerated"})(NewSymbolNameTag$1||(NewSymbolNameTag$1={}));var NewSymbolNameTriggerKind$1;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(NewSymbolNameTriggerKind$1||(NewSymbolNameTriggerKind$1={}));var Command$1;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(Command$1||(Command$1={}));var InlayHintKind$1;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(InlayHintKind$1||(InlayHintKind$1={}));class LazyTokenizationSupport{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const TokenizationRegistry=new TokenizationRegistry$1,TreeSitterTokenizationRegistry=new TokenizationRegistry$1;var InlineEditTriggerKind$1;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(InlineEditTriggerKind$1||(InlineEditTriggerKind$1={}));var AccessibilitySupport;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(AccessibilitySupport||(AccessibilitySupport={}));var CodeActionTriggerType;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(CodeActionTriggerType||(CodeActionTriggerType={}));var CompletionItemInsertTextRule;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(CompletionItemInsertTextRule||(CompletionItemInsertTextRule={}));var CompletionItemKind;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(CompletionItemKind||(CompletionItemKind={}));var CompletionItemTag;(function(n){n[n.Deprecated=1]="Deprecated"})(CompletionItemTag||(CompletionItemTag={}));var CompletionTriggerKind;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(CompletionTriggerKind||(CompletionTriggerKind={}));var ContentWidgetPositionPreference;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(ContentWidgetPositionPreference||(ContentWidgetPositionPreference={}));var CursorChangeReason;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(CursorChangeReason||(CursorChangeReason={}));var DefaultEndOfLine;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(DefaultEndOfLine||(DefaultEndOfLine={}));var DocumentHighlightKind;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(DocumentHighlightKind||(DocumentHighlightKind={}));var EditorAutoIndentStrategy;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(EditorAutoIndentStrategy||(EditorAutoIndentStrategy={}));var EditorOption;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.inlineEdit=63]="inlineEdit",n[n.letterSpacing=64]="letterSpacing",n[n.lightbulb=65]="lightbulb",n[n.lineDecorationsWidth=66]="lineDecorationsWidth",n[n.lineHeight=67]="lineHeight",n[n.lineNumbers=68]="lineNumbers",n[n.lineNumbersMinChars=69]="lineNumbersMinChars",n[n.linkedEditing=70]="linkedEditing",n[n.links=71]="links",n[n.matchBrackets=72]="matchBrackets",n[n.minimap=73]="minimap",n[n.mouseStyle=74]="mouseStyle",n[n.mouseWheelScrollSensitivity=75]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=76]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=77]="multiCursorMergeOverlapping",n[n.multiCursorModifier=78]="multiCursorModifier",n[n.multiCursorPaste=79]="multiCursorPaste",n[n.multiCursorLimit=80]="multiCursorLimit",n[n.occurrencesHighlight=81]="occurrencesHighlight",n[n.overviewRulerBorder=82]="overviewRulerBorder",n[n.overviewRulerLanes=83]="overviewRulerLanes",n[n.padding=84]="padding",n[n.pasteAs=85]="pasteAs",n[n.parameterHints=86]="parameterHints",n[n.peekWidgetDefaultFocus=87]="peekWidgetDefaultFocus",n[n.placeholder=88]="placeholder",n[n.definitionLinkOpensInPeek=89]="definitionLinkOpensInPeek",n[n.quickSuggestions=90]="quickSuggestions",n[n.quickSuggestionsDelay=91]="quickSuggestionsDelay",n[n.readOnly=92]="readOnly",n[n.readOnlyMessage=93]="readOnlyMessage",n[n.renameOnType=94]="renameOnType",n[n.renderControlCharacters=95]="renderControlCharacters",n[n.renderFinalNewline=96]="renderFinalNewline",n[n.renderLineHighlight=97]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=98]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=99]="renderValidationDecorations",n[n.renderWhitespace=100]="renderWhitespace",n[n.revealHorizontalRightPadding=101]="revealHorizontalRightPadding",n[n.roundedSelection=102]="roundedSelection",n[n.rulers=103]="rulers",n[n.scrollbar=104]="scrollbar",n[n.scrollBeyondLastColumn=105]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=106]="scrollBeyondLastLine",n[n.scrollPredominantAxis=107]="scrollPredominantAxis",n[n.selectionClipboard=108]="selectionClipboard",n[n.selectionHighlight=109]="selectionHighlight",n[n.selectOnLineNumbers=110]="selectOnLineNumbers",n[n.showFoldingControls=111]="showFoldingControls",n[n.showUnused=112]="showUnused",n[n.snippetSuggestions=113]="snippetSuggestions",n[n.smartSelect=114]="smartSelect",n[n.smoothScrolling=115]="smoothScrolling",n[n.stickyScroll=116]="stickyScroll",n[n.stickyTabStops=117]="stickyTabStops",n[n.stopRenderingLineAfter=118]="stopRenderingLineAfter",n[n.suggest=119]="suggest",n[n.suggestFontSize=120]="suggestFontSize",n[n.suggestLineHeight=121]="suggestLineHeight",n[n.suggestOnTriggerCharacters=122]="suggestOnTriggerCharacters",n[n.suggestSelection=123]="suggestSelection",n[n.tabCompletion=124]="tabCompletion",n[n.tabIndex=125]="tabIndex",n[n.unicodeHighlighting=126]="unicodeHighlighting",n[n.unusualLineTerminators=127]="unusualLineTerminators",n[n.useShadowDOM=128]="useShadowDOM",n[n.useTabStops=129]="useTabStops",n[n.wordBreak=130]="wordBreak",n[n.wordSegmenterLocales=131]="wordSegmenterLocales",n[n.wordSeparators=132]="wordSeparators",n[n.wordWrap=133]="wordWrap",n[n.wordWrapBreakAfterCharacters=134]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=135]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=136]="wordWrapColumn",n[n.wordWrapOverride1=137]="wordWrapOverride1",n[n.wordWrapOverride2=138]="wordWrapOverride2",n[n.wrappingIndent=139]="wrappingIndent",n[n.wrappingStrategy=140]="wrappingStrategy",n[n.showDeprecated=141]="showDeprecated",n[n.inlayHints=142]="inlayHints",n[n.editorClassName=143]="editorClassName",n[n.pixelRatio=144]="pixelRatio",n[n.tabFocusMode=145]="tabFocusMode",n[n.layoutInfo=146]="layoutInfo",n[n.wrappingInfo=147]="wrappingInfo",n[n.defaultColorDecorators=148]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=149]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=150]="inlineCompletionsAccessibilityVerbose"})(EditorOption||(EditorOption={}));var EndOfLinePreference;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(EndOfLinePreference||(EndOfLinePreference={}));var EndOfLineSequence;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(EndOfLineSequence||(EndOfLineSequence={}));var GlyphMarginLane$1;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(GlyphMarginLane$1||(GlyphMarginLane$1={}));var HoverVerbosityAction;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(HoverVerbosityAction||(HoverVerbosityAction={}));var IndentAction$1;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(IndentAction$1||(IndentAction$1={}));var InjectedTextCursorStops$1;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(InjectedTextCursorStops$1||(InjectedTextCursorStops$1={}));var InlayHintKind;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(InlayHintKind||(InlayHintKind={}));var InlineCompletionTriggerKind;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(InlineCompletionTriggerKind||(InlineCompletionTriggerKind={}));var InlineEditTriggerKind;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(InlineEditTriggerKind||(InlineEditTriggerKind={}));var KeyCode$1;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(KeyCode$1||(KeyCode$1={}));var MarkerSeverity$2;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(MarkerSeverity$2||(MarkerSeverity$2={}));var MarkerTag$1;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(MarkerTag$1||(MarkerTag$1={}));var MinimapPosition;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(MinimapPosition||(MinimapPosition={}));var MinimapSectionHeaderStyle;(function(n){n[n.Normal=1]="Normal",n[n.Underlined=2]="Underlined"})(MinimapSectionHeaderStyle||(MinimapSectionHeaderStyle={}));var MouseTargetType;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(MouseTargetType||(MouseTargetType={}));var NewSymbolNameTag;(function(n){n[n.AIGenerated=1]="AIGenerated"})(NewSymbolNameTag||(NewSymbolNameTag={}));var NewSymbolNameTriggerKind;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(NewSymbolNameTriggerKind||(NewSymbolNameTriggerKind={}));var OverlayWidgetPositionPreference;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(OverlayWidgetPositionPreference||(OverlayWidgetPositionPreference={}));var OverviewRulerLane$1;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(OverviewRulerLane$1||(OverviewRulerLane$1={}));var PartialAcceptTriggerKind;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(PartialAcceptTriggerKind||(PartialAcceptTriggerKind={}));var PositionAffinity;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(PositionAffinity||(PositionAffinity={}));var RenderLineNumbersType;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(RenderLineNumbersType||(RenderLineNumbersType={}));var RenderMinimap;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(RenderMinimap||(RenderMinimap={}));var ScrollType;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(ScrollType||(ScrollType={}));var ScrollbarVisibility;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(ScrollbarVisibility||(ScrollbarVisibility={}));var SelectionDirection$1;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(SelectionDirection$1||(SelectionDirection$1={}));var ShowLightbulbIconMode;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(ShowLightbulbIconMode||(ShowLightbulbIconMode={}));var SignatureHelpTriggerKind;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(SignatureHelpTriggerKind||(SignatureHelpTriggerKind={}));var SymbolKind;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(SymbolKind||(SymbolKind={}));var SymbolTag;(function(n){n[n.Deprecated=1]="Deprecated"})(SymbolTag||(SymbolTag={}));var TextEditorCursorBlinkingStyle;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(TextEditorCursorBlinkingStyle||(TextEditorCursorBlinkingStyle={}));var TextEditorCursorStyle;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(TextEditorCursorStyle||(TextEditorCursorStyle={}));var TrackedRangeStickiness;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(TrackedRangeStickiness||(TrackedRangeStickiness={}));var WrappingIndent;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(WrappingIndent||(WrappingIndent={}));var bo;let KeyMod$1=(bo=class{static chord(e,t){return KeyChord(e,t)}},bo.CtrlCmd=2048,bo.Shift=1024,bo.Alt=512,bo.WinCtrl=256,bo);function createMonacoBaseAPI(){return{editor:void 0,languages:void 0,CancellationTokenSource:CancellationTokenSource$1,Emitter:Emitter$1,KeyCode:KeyCode$1,KeyMod:KeyMod$1,Position:Position$1,Range:Range$2,Selection:Selection$1,SelectionDirection:SelectionDirection$1,MarkerSeverity:MarkerSeverity$2,MarkerTag:MarkerTag$1,Uri:URI,Token:Token$2}}function ensureCodeWindow(n,e){const t=n;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const mainWindow=window;function identity(n){return n}class LRUCachedFunction{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=identity):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class CachedFunction{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=identity):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}class Lazy{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function isFalsyOrWhitespace(n){return!n||typeof n!="string"?!0:n.trim().length===0}const _formatRegexp=/{(\d+)}/g;function format$1(n,...e){return e.length===0?n:n.replace(_formatRegexp,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function htmlAttributeEncodeValue(n){return n.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function escape$1(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function escapeRegExpCharacters(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function trim(n,e=" "){const t=ltrim(n,e);return rtrim(t,e)}function ltrim(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function rtrim(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,r=-1;for(;r=n.lastIndexOf(e,s-1),!(r===-1||r+t!==s);){if(r===0)return"";s=r}return n.substring(0,s)}function convertSimple2RegExpPattern(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function stripWildcards(n){return n.replace(/\*/g,"")}function createRegExp(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=escapeRegExpCharacters(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function regExpLeadsToEndlessLoop(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function splitLines(n){return n.split(/\r\n|\r|\n/)}function splitLinesIncludeSeparators(n){const e=[],t=n.split(/(\r\n|\r|\n)/);for(let i=0;i=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function compare(n,e){return ne?1:0}function compareSubstring(n,e,t=0,i=n.length,s=0,r=e.length){for(;tc)return 1}const o=i-t,a=r-s;return oa?1:0}function compareIgnoreCase(n,e){return compareSubstringIgnoreCase(n,e,0,n.length,0,e.length)}function compareSubstringIgnoreCase(n,e,t=0,i=n.length,s=0,r=e.length){for(;t=128||c>=128)return compareSubstring(n.toLowerCase(),e.toLowerCase(),t,i,s,r);isLowerAsciiLetter(l)&&(l-=32),isLowerAsciiLetter(c)&&(c-=32);const d=l-c;if(d!==0)return d}const o=i-t,a=r-s;return oa?1:0}function isAsciiDigit(n){return n>=48&&n<=57}function isLowerAsciiLetter(n){return n>=97&&n<=122}function isUpperAsciiLetter(n){return n>=65&&n<=90}function equalsIgnoreCase(n,e){return n.length===e.length&&compareSubstringIgnoreCase(n,e)===0}function startsWithIgnoreCase(n,e){const t=e.length;return e.length>n.length?!1:compareSubstringIgnoreCase(n,e,0,t)===0}function commonPrefixLength(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(isHighSurrogate(i))return computeCodePoint(i,t)}return t}class CodePointIterator{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=getPrevCodePoint(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=getNextCodePoint(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class GraphemeIterator{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new CodePointIterator(e,t)}nextGraphemeLength(){const e=GraphemeBreakTree.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(breakBetweenGraphemeBreakType(s,o)){t.setOffset(r);break}s=o}return t.offset-i}prevGraphemeLength(){const e=GraphemeBreakTree.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(breakBetweenGraphemeBreakType(o,s)){t.setOffset(r);break}s=o}return i-t.offset}eol(){return this._iterator.eol()}}function nextCharLength(n,e){return new GraphemeIterator(n,e).nextGraphemeLength()}function prevCharLength(n,e){return new GraphemeIterator(n,e).prevGraphemeLength()}function getCharContainingOffset(n,e){e>0&&isLowSurrogate(n.charCodeAt(e))&&e--;const t=e+nextCharLength(n,e);return[t-prevCharLength(n,t),t]}let CONTAINS_RTL;function makeContainsRtl(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function containsRTL(n){return CONTAINS_RTL||(CONTAINS_RTL=makeContainsRtl()),CONTAINS_RTL.test(n)}const IS_BASIC_ASCII=/^[\t\n\r\x20-\x7E]*$/;function isBasicASCII(n){return IS_BASIC_ASCII.test(n)}const UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function containsUnusualLineTerminators(n){return UNUSUAL_LINE_TERMINATORS.test(n)}function isFullWidthCharacter(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function isEmojiImprecise(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const UTF8_BOM_CHARACTER=String.fromCharCode(65279);function startsWithUTF8BOM(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function containsUppercaseCharacter(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function singleLetterHash(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function breakBetweenGraphemeBreakType(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}const ea=class ea{static getInstance(){return ea._INSTANCE||(ea._INSTANCE=new ea),ea._INSTANCE}constructor(){this._data=getGraphemeBreakRawData()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}};ea._INSTANCE=null;let GraphemeBreakTree=ea;function getGraphemeBreakRawData(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function getLeftDeleteOffset(n,e){if(n===0)return 0;const t=getOffsetBeforeLastEmojiComponent(n,e);if(t!==void 0)return t;const i=new CodePointIterator(e,n);return i.prevCodePoint(),i.offset}function getOffsetBeforeLastEmojiComponent(n,e){const t=new CodePointIterator(e,n);let i=t.prevCodePoint();for(;isEmojiModifier(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!isEmojiImprecise(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function isEmojiModifier(n){return 127995<=n&&n<=127999}const noBreakWhitespace=" ",rs=class rs{static getInstance(e){return rs.cache.get(Array.from(e))}static getLocales(){return rs._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}};rs.ambiguousCharacterData=new Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}')),rs.cache=new LRUCachedFunction({getCacheKey:JSON.stringify},e=>{function t(d){const u=new Map;for(let f=0;f!d.startsWith("_")&&d in r);o.length===0&&(o=["_default"]);let a;for(const d of o){const u=t(r[d]);a=s(a,u)}const l=t(r._common),c=i(l,a);return new rs(c)}),rs._locales=new Lazy(()=>Object.keys(rs.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));let AmbiguousCharacters=rs;const rl=class rl{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(rl.getRawData())),this._data}static isInvisibleCharacter(e){return rl.getData().has(e)}static get codePoints(){return rl.getData()}};rl._data=void 0;let InvisibleCharacters=rl;const standaloneTokens="",Lh=class Lh{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};Lh.INSTANCE=new Lh;let WindowManager=Lh;function addMatchMediaChangeListener(n,e,t){typeof e=="string"&&(e=n.matchMedia(e)),e.addEventListener("change",t)}function getZoomFactor(n){return WindowManager.INSTANCE.getZoomFactor(n)}const userAgent=navigator.userAgent,isFirefox=userAgent.indexOf("Firefox")>=0,isWebKit=userAgent.indexOf("AppleWebKit")>=0,isChrome=userAgent.indexOf("Chrome")>=0,isSafari=!isChrome&&userAgent.indexOf("Safari")>=0,isWebkitWebView=!isChrome&&!isSafari&&isWebKit;userAgent.indexOf("Electron/")>=0;const isAndroid=userAgent.indexOf("Android")>=0;let standalone=!1;if(typeof mainWindow.matchMedia=="function"){const n=mainWindow.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=mainWindow.matchMedia("(display-mode: fullscreen)");standalone=n.matches,addMatchMediaChangeListener(mainWindow,n,({matches:t})=>{standalone&&e.matches||(standalone=t)})}function isStandalone(){return standalone}const BrowserFeatures={clipboard:{writeText:isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:isNative||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>isNative||isStandalone()?0:navigator.keyboard||isSafari?1:2)(),touch:"ontouchstart"in mainWindow||navigator.maxTouchPoints>0,pointerEvents:mainWindow.PointerEvent&&("ontouchstart"in mainWindow||navigator.maxTouchPoints>0)};function decodeKeybinding(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new Keybinding([createSimpleKeybinding(t,e),createSimpleKeybinding(i,e)]):new Keybinding([createSimpleKeybinding(t,e)])}else{const t=[];for(let i=0;i{const o=e.token.onCancellationRequested(()=>{o.dispose(),r(new CancellationError)});Promise.resolve(t).then(a=>{o.dispose(),e.dispose(),s(a)},a=>{o.dispose(),e.dispose(),r(a)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,r){return i.then(s,r)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function raceCancellation(n,e,t){return new Promise((i,s)=>{const r=e.onCancellationRequested(()=>{r.dispose(),i(t)});n.then(i,s).finally(()=>r.dispose())})}class Throttler{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}const timeoutDeferred=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},microtaskDeferred=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Delayer{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,r)=>{this.doResolve=s,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{var s;this.deferred=null,(s=this.doResolve)==null||s.call(this,null)};return this.deferred=t===MicrotaskDelay?microtaskDeferred(i):timeoutDeferred(t,i),this.completionPromise}isTriggered(){var e;return!!((e=this.deferred)!=null&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)==null||e.call(this,new CancellationError),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)==null||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class ThrottledDelayer{constructor(e){this.delayer=new Delayer(e),this.throttler=new Throttler}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function timeout(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{r.dispose(),t()},n),r=e.onCancellationRequested(()=>{clearTimeout(s),r.dispose(),i(new CancellationError)})}):createCancelablePromise(t=>timeout(n,t))}function disposableTimeout(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=toDisposable(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}function first(n,e=i=>!!i,t=null){let i=0;const s=n.length,r=()=>{if(i>=s)return Promise.resolve(t);const o=n[i++];return Promise.resolve(o()).then(l=>e(l)?Promise.resolve(l):r())};return r()}class TimeoutTimer{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class IntervalTimer{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const s=i.setInterval(()=>{e()},t);this.disposable=toDisposable(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class RunOnceScheduler{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)==null||e.call(this)}}let runWhenGlobalIdle,_runWhenIdle;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?_runWhenIdle=(n,e)=>{setTimeout0(()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,i-Date.now())}}))});let t=!1;return{dispose(){t||(t=!0)}}}:_runWhenIdle=(n,e,t)=>{const i=n.requestIdleCallback(e,typeof t=="number"?{timeout:t}:void 0);let s=!1;return{dispose(){s||(s=!0,n.cancelIdleCallback(i))}}},runWhenGlobalIdle=n=>_runWhenIdle(globalThis,n)})();class AbstractIdleValue{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(i){this._error=i}finally{this._didRun=!0}},this._handle=_runWhenIdle(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class GlobalIdleValue extends AbstractIdleValue{constructor(e){super(globalThis,e)}}class DeferredPromise{get isRejected(){var e;return((e=this.outcome)==null?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new CancellationError)}}var Promises;(function(n){async function e(i){let s;const r=await Promise.all(i.map(o=>o.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return r}n.settled=e;function t(i){return new Promise(async(s,r)=>{try{await i(s,r)}catch(o){r(o)}})}n.withAsyncBody=t})(Promises||(Promises={}));const ln=class ln{static fromArray(e){return new ln(t=>{t.emitMany(e)})}static fromPromise(e){return new ln(async t=>{t.emitMany(await e)})}static fromPromises(e){return new ln(async t=>{await Promise.all(e.map(async i=>t.emitOne(await i)))})}static merge(e){return new ln(async t=>{await Promise.all(e.map(async i=>{for await(const s of i)t.emitOne(s)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Emitter$1,queueMicrotask(async()=>{const i={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(i)),this.resolve()}catch(s){this.reject(s)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e{var t;return(t=this._onReturn)==null||t.call(this),{done:!0,value:void 0}}}}static map(e,t){return new ln(async i=>{for await(const s of e)i.emitOne(t(s))})}map(e){return ln.map(this,e)}static filter(e,t){return new ln(async i=>{for await(const s of e)t(s)&&i.emitOne(s)})}filter(e){return ln.filter(this,e)}static coalesce(e){return ln.filter(e,t=>!!t)}coalesce(){return ln.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return ln.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};ln.EMPTY=ln.fromArray([]);let AsyncIterableObject=ln;class CancelableAsyncIterableObject extends AsyncIterableObject{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function createCancelableAsyncIterable(n){const e=new CancellationTokenSource$1,t=n(e.token);return new CancelableAsyncIterableObject(e,async i=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),i.reject(new CancellationError)});try{for await(const r of t){if(e.token.isCancellationRequested)return;i.emitOne(r)}s.dispose(),e.dispose()}catch(r){s.dispose(),e.dispose(),i.reject(r)}})}/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze:freeze$1,seal,create:create$1}=Object,{apply,construct}=typeof Reflect<"u"&&Reflect;freeze$1||(freeze$1=function(e){return e});seal||(seal=function(e){return e});apply||(apply=function(e,t,i){return e.apply(t,i)});construct||(construct=function(e,t){return new e(...t)});const arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(isFrozen(e)||(e[i]=r),s=r)}n[s]=!0}return n}function cleanArray(n){for(let e=0;e/gm),TMPLIT_EXPR=seal(/\${[\w\W]*}/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR,DATA_ATTR,ARIA_ATTR,IS_ALLOWED_URI,IS_SCRIPT_OR_DATA,ATTR_WHITESPACE,DOCTYPE_NAME,CUSTOM_ELEMENT});const NODE_TYPE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},getGlobal=function(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}};function createDOMPurify(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const e=gt=>createDOMPurify(gt);if(e.version="3.1.7",e.removed=[],!n||!n.document||n.document.nodeType!==NODE_TYPE.document)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:g}=n,m=l.prototype,_=lookupGetter(m,"cloneNode"),v=lookupGetter(m,"remove"),C=lookupGetter(m,"nextSibling"),S=lookupGetter(m,"childNodes"),w=lookupGetter(m,"parentNode");if(typeof o=="function"){const gt=t.createElement("template");gt.content&>.content.ownerDocument&&(t=gt.content.ownerDocument)}let L,I="";const{implementation:N,createNodeIterator:R,createDocumentFragment:T,getElementsByTagName:A}=t,{importNode:F}=i;let B={};e.isSupported=typeof entries=="function"&&typeof w=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:G,TMPLIT_EXPR:j,DATA_ATTR:K,ARIA_ATTR:ee,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:Q}=EXPRESSIONS;let{IS_ALLOWED_URI:ce}=EXPRESSIONS,ie=null;const Ce=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ae=null;const be=addToSet({},[...html,...svg,...mathMl,...xml]);let De=Object.seal(create$1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,xe=null,ze=!0,Qe=!0,qe=!1,Le=!0,je=!1,le=!0,pe=!1,Ie=!1,$e=!1,ye=!1,Re=!1,Ue=!1,He=!0,Ve=!1;const Oe="user-content-";let ot=!0,et=!1,nt={},lt=null;const Ct=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Nt=null;const kt=addToSet({},["audio","video","img","source","image","track"]);let hi=null;const Vt=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_i="http://www.w3.org/1998/Math/MathML",Xt="http://www.w3.org/2000/svg",At="http://www.w3.org/1999/xhtml";let Si=At,bi=!1,vi=null;const Ot=addToSet({},[_i,Xt,At],stringToString);let Hn=null;const Cr=["application/xhtml+xml","text/html"],ps="text/html";let Li=null,mn=null;const xo=t.createElement("form"),xr=function(ve){return ve instanceof RegExp||ve instanceof Function},ms=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mn&&mn===ve)){if((!ve||typeof ve!="object")&&(ve={}),ve=clone(ve),Hn=Cr.indexOf(ve.PARSER_MEDIA_TYPE)===-1?ps:ve.PARSER_MEDIA_TYPE,Li=Hn==="application/xhtml+xml"?stringToString:stringToLowerCase,ie=objectHasOwnProperty(ve,"ALLOWED_TAGS")?addToSet({},ve.ALLOWED_TAGS,Li):Ce,ae=objectHasOwnProperty(ve,"ALLOWED_ATTR")?addToSet({},ve.ALLOWED_ATTR,Li):be,vi=objectHasOwnProperty(ve,"ALLOWED_NAMESPACES")?addToSet({},ve.ALLOWED_NAMESPACES,stringToString):Ot,hi=objectHasOwnProperty(ve,"ADD_URI_SAFE_ATTR")?addToSet(clone(Vt),ve.ADD_URI_SAFE_ATTR,Li):Vt,Nt=objectHasOwnProperty(ve,"ADD_DATA_URI_TAGS")?addToSet(clone(kt),ve.ADD_DATA_URI_TAGS,Li):kt,lt=objectHasOwnProperty(ve,"FORBID_CONTENTS")?addToSet({},ve.FORBID_CONTENTS,Li):Ct,Te=objectHasOwnProperty(ve,"FORBID_TAGS")?addToSet({},ve.FORBID_TAGS,Li):{},xe=objectHasOwnProperty(ve,"FORBID_ATTR")?addToSet({},ve.FORBID_ATTR,Li):{},nt=objectHasOwnProperty(ve,"USE_PROFILES")?ve.USE_PROFILES:!1,ze=ve.ALLOW_ARIA_ATTR!==!1,Qe=ve.ALLOW_DATA_ATTR!==!1,qe=ve.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=ve.SAFE_FOR_TEMPLATES||!1,le=ve.SAFE_FOR_XML!==!1,pe=ve.WHOLE_DOCUMENT||!1,ye=ve.RETURN_DOM||!1,Re=ve.RETURN_DOM_FRAGMENT||!1,Ue=ve.RETURN_TRUSTED_TYPE||!1,$e=ve.FORCE_BODY||!1,He=ve.SANITIZE_DOM!==!1,Ve=ve.SANITIZE_NAMED_PROPS||!1,ot=ve.KEEP_CONTENT!==!1,et=ve.IN_PLACE||!1,ce=ve.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,Si=ve.NAMESPACE||At,De=ve.CUSTOM_ELEMENT_HANDLING||{},ve.CUSTOM_ELEMENT_HANDLING&&xr(ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ve.CUSTOM_ELEMENT_HANDLING&&xr(ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ve.CUSTOM_ELEMENT_HANDLING&&typeof ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(De.allowCustomizedBuiltInElements=ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(Qe=!1),Re&&(ye=!0),nt&&(ie=addToSet({},text),ae=[],nt.html===!0&&(addToSet(ie,html$1),addToSet(ae,html)),nt.svg===!0&&(addToSet(ie,svg$1),addToSet(ae,svg),addToSet(ae,xml)),nt.svgFilters===!0&&(addToSet(ie,svgFilters),addToSet(ae,svg),addToSet(ae,xml)),nt.mathMl===!0&&(addToSet(ie,mathMl$1),addToSet(ae,mathMl),addToSet(ae,xml))),ve.ADD_TAGS&&(ie===Ce&&(ie=clone(ie)),addToSet(ie,ve.ADD_TAGS,Li)),ve.ADD_ATTR&&(ae===be&&(ae=clone(ae)),addToSet(ae,ve.ADD_ATTR,Li)),ve.ADD_URI_SAFE_ATTR&&addToSet(hi,ve.ADD_URI_SAFE_ATTR,Li),ve.FORBID_CONTENTS&&(lt===Ct&&(lt=clone(lt)),addToSet(lt,ve.FORBID_CONTENTS,Li)),ot&&(ie["#text"]=!0),pe&&addToSet(ie,["html","head","body"]),ie.table&&(addToSet(ie,["tbody"]),delete Te.tbody),ve.TRUSTED_TYPES_POLICY){if(typeof ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=ve.TRUSTED_TYPES_POLICY,I=L.createHTML("")}else L===void 0&&(L=_createTrustedTypesPolicy(g,s)),L!==null&&typeof I=="string"&&(I=L.createHTML(""));freeze$1&&freeze$1(ve),mn=ve}},vt=addToSet({},["mi","mo","mn","ms","mtext"]),te=addToSet({},["annotation-xml"]),se=addToSet({},["title","style","font","a","script"]),oe=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),ge=addToSet({},[...mathMl$1,...mathMlDisallowed]),_e=function(ve){let Xe=w(ve);(!Xe||!Xe.tagName)&&(Xe={namespaceURI:Si,tagName:"template"});const rt=stringToLowerCase(ve.tagName),jt=stringToLowerCase(Xe.tagName);return vi[ve.namespaceURI]?ve.namespaceURI===Xt?Xe.namespaceURI===At?rt==="svg":Xe.namespaceURI===_i?rt==="svg"&&(jt==="annotation-xml"||vt[jt]):!!oe[rt]:ve.namespaceURI===_i?Xe.namespaceURI===At?rt==="math":Xe.namespaceURI===Xt?rt==="math"&&te[jt]:!!ge[rt]:ve.namespaceURI===At?Xe.namespaceURI===Xt&&!te[jt]||Xe.namespaceURI===_i&&!vt[jt]?!1:!ge[rt]&&(se[rt]||!oe[rt]):!!(Hn==="application/xhtml+xml"&&vi[ve.namespaceURI]):!1},Ee=function(ve){arrayPush(e.removed,{element:ve});try{w(ve).removeChild(ve)}catch{v(ve)}},Ae=function(ve,Xe){try{arrayPush(e.removed,{attribute:Xe.getAttributeNode(ve),from:Xe})}catch{arrayPush(e.removed,{attribute:null,from:Xe})}if(Xe.removeAttribute(ve),ve==="is"&&!ae[ve])if(ye||Re)try{Ee(Xe)}catch{}else try{Xe.setAttribute(ve,"")}catch{}},Ye=function(ve){let Xe=null,rt=null;if($e)ve=""+ve;else{const Di=stringMatch(ve,/^[\r\n\t ]+/);rt=Di&&Di[0]}Hn==="application/xhtml+xml"&&Si===At&&(ve=''+ve+"");const jt=L?L.createHTML(ve):ve;if(Si===At)try{Xe=new f().parseFromString(jt,Hn)}catch{}if(!Xe||!Xe.documentElement){Xe=N.createDocument(Si,"template",null);try{Xe.documentElement.innerHTML=bi?I:jt}catch{}}const Fi=Xe.body||Xe.documentElement;return ve&&rt&&Fi.insertBefore(t.createTextNode(rt),Fi.childNodes[0]||null),Si===At?A.call(Xe,pe?"html":"body")[0]:pe?Xe.documentElement:Fi},it=function(ve){return R.call(ve.ownerDocument||ve,ve,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(ve){return ve instanceof u&&(typeof ve.nodeName!="string"||typeof ve.textContent!="string"||typeof ve.removeChild!="function"||!(ve.attributes instanceof d)||typeof ve.removeAttribute!="function"||typeof ve.setAttribute!="function"||typeof ve.namespaceURI!="string"||typeof ve.insertBefore!="function"||typeof ve.hasChildNodes!="function")},Dt=function(ve){return typeof a=="function"&&ve instanceof a},It=function(ve,Xe,rt){B[ve]&&arrayForEach(B[ve],jt=>{jt.call(e,Xe,rt,mn)})},Wt=function(ve){let Xe=null;if(It("beforeSanitizeElements",ve,null),bt(ve))return Ee(ve),!0;const rt=Li(ve.nodeName);if(It("uponSanitizeElement",ve,{tagName:rt,allowedTags:ie}),ve.hasChildNodes()&&!Dt(ve.firstElementChild)&®ExpTest(/<[/\w]/g,ve.innerHTML)&®ExpTest(/<[/\w]/g,ve.textContent)||ve.nodeType===NODE_TYPE.progressingInstruction||le&&ve.nodeType===NODE_TYPE.comment&®ExpTest(/<[/\w]/g,ve.data))return Ee(ve),!0;if(!ie[rt]||Te[rt]){if(!Te[rt]&&Ri(rt)&&(De.tagNameCheck instanceof RegExp&®ExpTest(De.tagNameCheck,rt)||De.tagNameCheck instanceof Function&&De.tagNameCheck(rt)))return!1;if(ot&&!lt[rt]){const jt=w(ve)||ve.parentNode,Fi=S(ve)||ve.childNodes;if(Fi&&jt){const Di=Fi.length;for(let Bi=Di-1;Bi>=0;--Bi){const Ji=_(Fi[Bi],!0);Ji.__removalCount=(ve.__removalCount||0)+1,jt.insertBefore(Ji,C(ve))}}}return Ee(ve),!0}return ve instanceof l&&!_e(ve)||(rt==="noscript"||rt==="noembed"||rt==="noframes")&®ExpTest(/<\/no(script|embed|frames)/i,ve.innerHTML)?(Ee(ve),!0):(je&&ve.nodeType===NODE_TYPE.text&&(Xe=ve.textContent,arrayForEach([W,G,j],jt=>{Xe=stringReplace(Xe,jt," ")}),ve.textContent!==Xe&&(arrayPush(e.removed,{element:ve.cloneNode()}),ve.textContent=Xe)),It("afterSanitizeElements",ve,null),!1)},Yt=function(ve,Xe,rt){if(He&&(Xe==="id"||Xe==="name")&&(rt in t||rt in xo))return!1;if(!(Qe&&!xe[Xe]&®ExpTest(K,Xe))){if(!(ze&®ExpTest(ee,Xe))){if(!ae[Xe]||xe[Xe]){if(!(Ri(ve)&&(De.tagNameCheck instanceof RegExp&®ExpTest(De.tagNameCheck,ve)||De.tagNameCheck instanceof Function&&De.tagNameCheck(ve))&&(De.attributeNameCheck instanceof RegExp&®ExpTest(De.attributeNameCheck,Xe)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(Xe))||Xe==="is"&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&®ExpTest(De.tagNameCheck,rt)||De.tagNameCheck instanceof Function&&De.tagNameCheck(rt))))return!1}else if(!hi[Xe]){if(!regExpTest(ce,stringReplace(rt,q,""))){if(!((Xe==="src"||Xe==="xlink:href"||Xe==="href")&&ve!=="script"&&stringIndexOf(rt,"data:")===0&&Nt[ve])){if(!(qe&&!regExpTest(U,stringReplace(rt,q,"")))){if(rt)return!1}}}}}}return!0},Ri=function(ve){return ve!=="annotation-xml"&&stringMatch(ve,Q)},Hi=function(ve){It("beforeSanitizeAttributes",ve,null);const{attributes:Xe}=ve;if(!Xe)return;const rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae};let jt=Xe.length;for(;jt--;){const Fi=Xe[jt],{name:Di,namespaceURI:Bi,value:Ji}=Fi,Gn=Li(Di);let Ni=Di==="value"?Ji:stringTrim(Ji);if(rt.attrName=Gn,rt.attrValue=Ni,rt.keepAttr=!0,rt.forceKeepAttr=void 0,It("uponSanitizeAttribute",ve,rt),Ni=rt.attrValue,rt.forceKeepAttr||(Ae(Di,ve),!rt.keepAttr))continue;if(!Le&®ExpTest(/\/>/i,Ni)){Ae(Di,ve);continue}je&&arrayForEach([W,G,j],cn=>{Ni=stringReplace(Ni,cn," ")});const Eo=Li(ve.nodeName);if(Yt(Eo,Gn,Ni)){if(Ve&&(Gn==="id"||Gn==="name")&&(Ae(Di,ve),Ni=Oe+Ni),le&®ExpTest(/((--!?|])>)|<\/(style|title)/i,Ni)){Ae(Di,ve);continue}if(L&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Bi)switch(g.getAttributeType(Eo,Gn)){case"TrustedHTML":{Ni=L.createHTML(Ni);break}case"TrustedScriptURL":{Ni=L.createScriptURL(Ni);break}}try{Bi?ve.setAttributeNS(Bi,Di,Ni):ve.setAttribute(Di,Ni),bt(ve)?Ee(ve):arrayPop(e.removed)}catch{}}}It("afterSanitizeAttributes",ve,null)},ys=function gt(ve){let Xe=null;const rt=it(ve);for(It("beforeSanitizeShadowDOM",ve,null);Xe=rt.nextNode();)It("uponSanitizeShadowNode",Xe,null),!Wt(Xe)&&(Xe.content instanceof r&>(Xe.content),Hi(Xe));It("afterSanitizeShadowDOM",ve,null)};return e.sanitize=function(gt){let ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe=null,rt=null,jt=null,Fi=null;if(bi=!gt,bi&&(gt=""),typeof gt!="string"&&!Dt(gt))if(typeof gt.toString=="function"){if(gt=gt.toString(),typeof gt!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!e.isSupported)return gt;if(Ie||ms(ve),e.removed=[],typeof gt=="string"&&(et=!1),et){if(gt.nodeName){const Ji=Li(gt.nodeName);if(!ie[Ji]||Te[Ji])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(gt instanceof a)Xe=Ye(""),rt=Xe.ownerDocument.importNode(gt,!0),rt.nodeType===NODE_TYPE.element&&rt.nodeName==="BODY"||rt.nodeName==="HTML"?Xe=rt:Xe.appendChild(rt);else{if(!ye&&!je&&!pe&>.indexOf("<")===-1)return L&&Ue?L.createHTML(gt):gt;if(Xe=Ye(gt),!Xe)return ye?null:Ue?I:""}Xe&&$e&&Ee(Xe.firstChild);const Di=it(et?gt:Xe);for(;jt=Di.nextNode();)Wt(jt)||(jt.content instanceof r&&ys(jt.content),Hi(jt));if(et)return gt;if(ye){if(Re)for(Fi=T.call(Xe.ownerDocument);Xe.firstChild;)Fi.appendChild(Xe.firstChild);else Fi=Xe;return(ae.shadowroot||ae.shadowrootmode)&&(Fi=F.call(i,Fi,!0)),Fi}let Bi=pe?Xe.outerHTML:Xe.innerHTML;return pe&&ie["!doctype"]&&Xe.ownerDocument&&Xe.ownerDocument.doctype&&Xe.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,Xe.ownerDocument.doctype.name)&&(Bi=" +`+Bi),je&&arrayForEach([W,G,j],Ji=>{Bi=stringReplace(Bi,Ji," ")}),L&&Ue?L.createHTML(Bi):Bi},e.setConfig=function(){let gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ms(gt),Ie=!0},e.clearConfig=function(){mn=null,Ie=!1},e.isValidAttribute=function(gt,ve,Xe){mn||ms({});const rt=Li(gt),jt=Li(ve);return Yt(rt,jt,Xe)},e.addHook=function(gt,ve){typeof ve=="function"&&(B[gt]=B[gt]||[],arrayPush(B[gt],ve))},e.removeHook=function(gt){if(B[gt])return arrayPop(B[gt])},e.removeHooks=function(gt){B[gt]&&(B[gt]=[])},e.removeAllHooks=function(){B={}},e}var purify=createDOMPurify();purify.version;purify.isSupported;const sanitize$1=purify.sanitize;purify.setConfig;purify.clearConfig;purify.isValidAttribute;const addHook=purify.addHook,removeHook=purify.removeHook;purify.removeHooks;purify.removeAllHooks;var Schemas;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",n.vscodeNotebookMetadata="vscode-notebook-metadata",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatCodeBlock="vscode-chat-code-block",n.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm",n.commentsInput="comment",n.codeSetting="code-setting",n.outputChannel="output"})(Schemas||(Schemas={}));function matchesScheme(n,e){return URI.isUri(n)?equalsIgnoreCase(n.scheme,e):startsWithIgnoreCase(n,e+":")}function matchesSomeScheme(n,...e){return e.some(t=>matchesScheme(n,t))}const connectionTokenQueryName="tkn";class RemoteAuthoritiesImpl{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return posix.join(this._serverRootPath,Schemas.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return onUnexpectedError(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],r=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(o+=`&${connectionTokenQueryName}=${encodeURIComponent(r)}`),URI.from({scheme:isWeb?this._preferredWebSchema:Schemas.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:o})}}const RemoteAuthorities=new RemoteAuthoritiesImpl,VSCODE_AUTHORITY="vscode-app",Md=class Md{asBrowserUri(e){const t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===Schemas.vscodeRemote?RemoteAuthorities.rewrite(e):e.scheme===Schemas.file&&(isNative||webWorkerOrigin===`${Schemas.vscodeFileResource}://${Md.FALLBACK_AUTHORITY}`)?e.with({scheme:Schemas.vscodeFileResource,authority:e.authority||Md.FALLBACK_AUTHORITY,query:null,fragment:null}):e}toUri(e,t){if(URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){const i=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(i))return URI.joinPath(URI.parse(i,!0),e);const s=join$2(i,e);return URI.file(s)}return URI.parse(t.toUrl(e))}};Md.FALLBACK_AUTHORITY=VSCODE_AUTHORITY;let FileAccessImpl=Md;const FileAccess=new FileAccessImpl;var COI;(function(n){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(r){let o;typeof r=="string"?o=new URL(r).searchParams:r instanceof URL?o=r.searchParams:URI.isUri(r)&&(o=new URL(r.toString(!0)).searchParams);const a=o==null?void 0:o.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(r,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}n.addSearchParam=s})(COI||(COI={}));function hash(n){return doHash(n,0)}function doHash(n,e){switch(typeof n){case"object":return n===null?numberHash(349,e):Array.isArray(n)?arrayHash(n,e):objectHash(n,e);case"string":return stringHash(n,e);case"boolean":return booleanHash(n,e);case"number":return numberHash(n,e);case"undefined":return numberHash(937,e);default:return numberHash(617,e)}}function numberHash(n,e){return(e<<5)-e+n|0}function booleanHash(n,e){return numberHash(n?433:863,e)}function stringHash(n,e){e=numberHash(149417,e);for(let t=0,i=n.length;tdoHash(i,t),e)}function objectHash(n,e){return e=numberHash(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=stringHash(i,t),doHash(n[i],t)),e)}function leftRotate$2(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function fill(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):leftPad((n>>>0).toString(16),e/4)}const kh=class kh{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(isHighSurrogate(o))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),toHexString(this._h0)+toHexString(this._h1)+toHexString(this._h2)+toHexString(this._h3)+toHexString(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,fill(this._buff,this._buffLen),this._buffLen>56&&(this._step(),fill(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=kh._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,leftRotate$2(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,s=this._h1,r=this._h2,o=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=s&r|~s&o,c=1518500249):u<40?(l=s^r^o,c=1859775393):u<60?(l=s&r|s&o|r&o,c=2400959708):(l=s^r^o,c=3395469782),d=leftRotate$2(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=o,o=r,r=leftRotate$2(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};kh._bigBlock32=new DataView(new ArrayBuffer(320));let StringSHA1=kh;const{registerWindow,getWindow,getDocument,getWindows,getWindowsCount,getWindowId,getWindowById,hasWindow,onDidRegisterWindow,onWillUnregisterWindow,onDidUnregisterWindow}=function(){const n=new Map;ensureCodeWindow(mainWindow,1);const e={window:mainWindow,disposables:new DisposableStore};n.set(mainWindow.vscodeWindowId,e);const t=new Emitter$1,i=new Emitter$1,s=new Emitter$1;function r(o,a){return(typeof o=="number"?n.get(o):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(o){if(n.has(o.vscodeWindowId))return Disposable.None;const a=new DisposableStore,l={window:o,disposables:a.add(new DisposableStore)};return n.set(o.vscodeWindowId,l),a.add(toDisposable(()=>{n.delete(o.vscodeWindowId),i.fire(o)})),a.add(addDisposableListener(o,EventType$1.BEFORE_UNLOAD,()=>{s.fire(o)})),t.fire(l),a},getWindows(){return n.values()},getWindowsCount(){return n.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return n.has(o)},getWindowById:r,getWindow(o){var c;const a=o;if((c=a==null?void 0:a.ownerDocument)!=null&&c.defaultView)return a.ownerDocument.defaultView.window;const l=o;return l!=null&&l.view?l.view.window:mainWindow},getDocument(o){return getWindow(o).document}}}();function clearNode(n){for(;n.firstChild;)n.firstChild.remove()}class DomListener{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function addDisposableListener(n,e,t,i){return new DomListener(n,e,t,i)}function _wrapAsStandardMouseEvent(n,e){return function(t){return e(new StandardMouseEvent(n,t))}}function _wrapAsStandardKeyboardEvent(n){return function(e){return n(new StandardKeyboardEvent(e))}}const addStandardDisposableListener=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=_wrapAsStandardMouseEvent(getWindow(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=_wrapAsStandardKeyboardEvent(i)),addDisposableListener(e,t,r,s)},addStandardDisposableGenericMouseDownListener=function(e,t,i){const s=_wrapAsStandardMouseEvent(getWindow(e),t);return addDisposableGenericMouseDownListener(e,s,i)};function addDisposableGenericMouseDownListener(n,e,t){return addDisposableListener(n,isIOS&&BrowserFeatures.pointerEvents?EventType$1.POINTER_DOWN:EventType$1.MOUSE_DOWN,e,t)}function runWhenWindowIdle(n,e,t){return _runWhenIdle(n,e,t)}class WindowIdleValue extends AbstractIdleValue{constructor(e,t){super(e,t)}}let runAtThisOrScheduleAtNextAnimationFrame,scheduleAtNextAnimationFrame;class WindowIntervalTimer extends IntervalTimer{constructor(e){super(),this.defaultTarget=e&&getWindow(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class AnimationFrameQueueItem{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){onUnexpectedError(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const n=new Map,e=new Map,t=new Map,i=new Map,s=r=>{t.set(r,!1);const o=n.get(r)??[];for(e.set(r,o),n.set(r,[]),i.set(r,!0);o.length>0;)o.sort(AnimationFrameQueueItem.sort),o.shift().execute();i.set(r,!1)};scheduleAtNextAnimationFrame=(r,o,a=0)=>{const l=getWindowId(r),c=new AnimationFrameQueueItem(o,a);let d=n.get(l);return d||(d=[],n.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),r.requestAnimationFrame(()=>s(l))),c},runAtThisOrScheduleAtNextAnimationFrame=(r,o,a)=>{const l=getWindowId(r);if(i.get(l)){const c=new AnimationFrameQueueItem(o,a);let d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return scheduleAtNextAnimationFrame(r,o,a)}})();function getComputedStyle$1(n){return getWindow(n).getComputedStyle(n,null)}function getClientArea(n,e){const t=getWindow(n),i=t.document;if(n!==i.body)return new Dimension(n.clientWidth,n.clientHeight);if(isIOS&&(t!=null&&t.visualViewport))return new Dimension(t.visualViewport.width,t.visualViewport.height);if(t!=null&&t.innerWidth&&t.innerHeight)return new Dimension(t.innerWidth,t.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Dimension(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Dimension(i.documentElement.clientWidth,i.documentElement.clientHeight);if(e)return getClientArea(e);throw new Error("Unable to figure out browser width and height")}class SizeUtils{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=getComputedStyle$1(e),r=s?s.getPropertyValue(t):"0";return SizeUtils.convertToPixels(e,r)}static getBorderLeftWidth(e){return SizeUtils.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return SizeUtils.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return SizeUtils.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return SizeUtils.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return SizeUtils.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return SizeUtils.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return SizeUtils.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return SizeUtils.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return SizeUtils.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return SizeUtils.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return SizeUtils.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return SizeUtils.getDimension(e,"margin-bottom","marginBottom")}}const ta=class ta{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ta(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof ta?e:new ta(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};ta.None=new ta(0,0);let Dimension=ta;function getTopLeftOffset(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=isShadowRoot(n)?null:getComputedStyle$1(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=SizeUtils.getBorderLeftWidth(n),t+=SizeUtils.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function size(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function getDomNodePagePosition(n){const e=n.getBoundingClientRect(),t=getWindow(n);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function getDomNodeZoomLevel(n){let e=n,t=1;do{const i=getComputedStyle$1(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function getTotalWidth(n){const e=SizeUtils.getMarginLeft(n)+SizeUtils.getMarginRight(n);return n.offsetWidth+e}function getContentWidth(n){const e=SizeUtils.getBorderLeftWidth(n)+SizeUtils.getBorderRightWidth(n),t=SizeUtils.getPaddingLeft(n)+SizeUtils.getPaddingRight(n);return n.offsetWidth-e-t}function getContentHeight(n){const e=SizeUtils.getBorderTopWidth(n)+SizeUtils.getBorderBottomWidth(n),t=SizeUtils.getPaddingTop(n)+SizeUtils.getPaddingBottom(n);return n.offsetHeight-e-t}function getTotalHeight(n){const e=SizeUtils.getMarginTop(n)+SizeUtils.getMarginBottom(n);return n.offsetHeight+e}function isAncestor$1(n,e){return!!(e!=null&&e.contains(n))}function findParentWithClass(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function hasParentWithClass(n,e,t){return!!findParentWithClass(n,e,t)}function isShadowRoot(n){return n&&!!n.host&&!!n.mode}function isInShadowDOM(n){return!!getShadowRoot(n)}function getShadowRoot(n){var e;for(;n.parentNode;){if(n===((e=n.ownerDocument)==null?void 0:e.body))return null;n=n.parentNode}return isShadowRoot(n)?n:null}function getActiveElement(){let n=getActiveDocument().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function isActiveElement(n){return getActiveElement()===n}function isAncestorOfActiveElement(n){return isAncestor$1(getActiveElement(),n)}function getActiveDocument(){return getWindowsCount()<=1?mainWindow.document:Array.from(getWindows()).map(({window:e})=>e.document).find(e=>e.hasFocus())??mainWindow.document}function getActiveWindow(){var e;return((e=getActiveDocument().defaultView)==null?void 0:e.window)??mainWindow}const globalStylesheets=new Map;function createStyleSheet2(){return new WrappedStyleElement}class WrappedStyleElement{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=createStyleSheet(mainWindow.document.head,t=>t.innerText=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function createStyleSheet(n=mainWindow.document.head,e,t){const i=document.createElement("style");if(i.type="text/css",i.media="screen",e==null||e(i),n.appendChild(i),t&&t.add(toDisposable(()=>i.remove())),n===mainWindow.document.head){const s=new Set;globalStylesheets.set(i,s);for(const{window:r,disposables:o}of getWindows()){if(r===mainWindow)continue;const a=o.add(cloneGlobalStyleSheet(i,s,r));t==null||t.add(a)}}return i}function cloneGlobalStyleSheet(n,e,t){var r,o;const i=new DisposableStore,s=n.cloneNode(!0);t.document.head.appendChild(s),i.add(toDisposable(()=>s.remove()));for(const a of getDynamicStyleSheetRules(n))(o=s.sheet)==null||o.insertRule(a.cssText,(r=s.sheet)==null?void 0:r.cssRules.length);return i.add(sharedMutationObserver.observe(n,i,{childList:!0})(()=>{s.textContent=n.textContent})),e.add(s),i.add(toDisposable(()=>e.delete(s))),i}const sharedMutationObserver=new class{constructor(){this.mutationObservers=new Map}observe(n,e,t){let i=this.mutationObservers.get(n);i||(i=new Map,this.mutationObservers.set(n,i));const s=hash(t);let r=i.get(s);if(r)r.users+=1;else{const o=new Emitter$1,a=new MutationObserver(c=>o.fire(c));a.observe(n,t);const l=r={users:1,observer:a,onDidMutate:o.event};e.add(toDisposable(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),i==null||i.delete(s),(i==null?void 0:i.size)===0&&this.mutationObservers.delete(n))})),i.set(s,r)}return r.onDidMutate}};let _sharedStyleSheet=null;function getSharedStyleSheet(){return _sharedStyleSheet||(_sharedStyleSheet=createStyleSheet()),_sharedStyleSheet}function getDynamicStyleSheetRules(n){var e,t;return(e=n==null?void 0:n.sheet)!=null&&e.rules?n.sheet.rules:(t=n==null?void 0:n.sheet)!=null&&t.cssRules?n.sheet.cssRules:[]}function createCSSRule(n,e,t=getSharedStyleSheet()){var i;if(!(!t||!e)){(i=t.sheet)==null||i.insertRule(`${n} {${e}}`,0);for(const s of globalStylesheets.get(t)??[])createCSSRule(n,e,s)}}function removeCSSRulesContainingSelector(n,e=getSharedStyleSheet()){var s;if(!e)return;const t=getDynamicStyleSheetRules(e),i=[];for(let r=0;r=0;r--)(s=e.sheet)==null||s.deleteRule(i[r]);for(const r of globalStylesheets.get(e)??[])removeCSSRulesContainingSelector(n,r)}function isCSSStyleRule(n){return typeof n.selectorText=="string"}function isHTMLElement(n){return n instanceof HTMLElement||n instanceof getWindow(n).HTMLElement}function isHTMLAnchorElement(n){return n instanceof HTMLAnchorElement||n instanceof getWindow(n).HTMLAnchorElement}function isSVGElement(n){return n instanceof SVGElement||n instanceof getWindow(n).SVGElement}function isMouseEvent(n){return n instanceof MouseEvent||n instanceof getWindow(n).MouseEvent}function isKeyboardEvent$1(n){return n instanceof KeyboardEvent||n instanceof getWindow(n).KeyboardEvent}const EventType$1={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:isWebKit?"webkitAnimationIteration":"animationiteration"};function isEventLike(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const EventHelper={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function saveParentsScrollTop(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function restoreParentsScrollTop(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class FocusTracker extends Disposable{static hasFocusWithin(e){if(isHTMLElement(e)){const t=getShadowRoot(e),i=t?t.activeElement:e.ownerDocument.activeElement;return isAncestor$1(i,e)}else{const t=e;return isAncestor$1(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new Emitter$1),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Emitter$1),this.onDidBlur=this._onDidBlur.event;let t=FocusTracker.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(i=!0,(isHTMLElement(e)?getWindow(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{FocusTracker.hasFocusWithin(e)!==t&&(t?r():s())},this._register(addDisposableListener(e,EventType$1.FOCUS,s,!0)),this._register(addDisposableListener(e,EventType$1.BLUR,r,!0)),isHTMLElement(e)&&(this._register(addDisposableListener(e,EventType$1.FOCUS_IN,()=>this._refreshStateHandler())),this._register(addDisposableListener(e,EventType$1.FOCUS_OUT,()=>this._refreshStateHandler())))}}function trackFocus(n){return new FocusTracker(n)}function after(n,e){return n.after(e),e}function append$1(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function prepend$1(n,e){return n.insertBefore(e,n.firstChild),e}function reset$1(n,...e){n.innerText="",append$1(n,...e)}const SELECTOR_REGEX=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Namespace;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(Namespace||(Namespace={}));function _$$1(n,e,t,...i){const s=SELECTOR_REGEX.exec(e);if(!s)throw new Error("Bad use of emmet");const r=s[1]||"div";let o;return n!==Namespace.HTML?o=document.createElementNS(n,r):o=document.createElement(r),s[3]&&(o.id=s[3]),s[4]&&(o.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...i),o}function $$e(n,e,...t){return _$$1(Namespace.HTML,n,e,...t)}$$e.SVG=function(n,e,...t){return _$$1(Namespace.SVG,n,e,...t)};function setVisibility(n,...e){n?show(...e):hide(...e)}function show(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function hide(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function computeScreenAwareSize(n,e){const t=n.devicePixelRatio*e;return Math.max(1,Math.floor(t))/n.devicePixelRatio}function windowOpenNoOpener(n){mainWindow.open(n,"_blank","noopener")}function animate(n,e){const t=()=>{e(),i=scheduleAtNextAnimationFrame(n,t)};let i=scheduleAtNextAnimationFrame(n,t);return toDisposable(()=>i.dispose())}RemoteAuthorities.setPreferredWebSchema(/^https:/.test(mainWindow.location.href)?"https":"http");function asCSSUrl(n){return n?`url('${FileAccess.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function asCSSPropertyValue(n){return`'${n.replace(/'/g,"%27")}'`}function asCssValueWithDefault(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=asCssValueWithDefault(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function hookDomPurifyHrefAndSrcSanitizer(n,e=!1){const t=document.createElement("a");return addHook("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const r=i.getAttribute(s);if(s==="href"&&r.startsWith("#"))continue;if(t.href=r,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),toDisposable(()=>{removeHook("afterSanitizeAttributes")})}const basicMarkupHtmlTags=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class ModifierKeyEmitter extends Emitter$1{constructor(){super(),this._subscriptions=new DisposableStore,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Event$1.runAndSubscribe(onDidRegisterWindow,({window:e,disposables:t})=>this.registerListeners(e,t),{window:mainWindow,disposables:this._subscriptions}))}registerListeners(e,t){t.add(addDisposableListener(e,"keydown",i=>{if(i.defaultPrevented)return;const s=new StandardKeyboardEvent(i);if(!(s.keyCode===6&&i.repeat)){if(i.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(i.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(i.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(i.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(s.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=i,this.fire(this._keyStatus))}},!0)),t.add(addDisposableListener(e,"keyup",i=>{i.defaultPrevented||(!i.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!i.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!i.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!i.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=i.altKey,this._keyStatus.ctrlKey=i.ctrlKey,this._keyStatus.metaKey=i.metaKey,this._keyStatus.shiftKey=i.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=i,this.fire(this._keyStatus)))},!0)),t.add(addDisposableListener(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(addDisposableListener(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(addDisposableListener(e.document.body,"mousemove",i=>{i.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(addDisposableListener(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return ModifierKeyEmitter.instance||(ModifierKeyEmitter.instance=new ModifierKeyEmitter),ModifierKeyEmitter.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class DragAndDropObserver extends Disposable{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(addDisposableListener(this.element,EventType$1.DRAG_START,e=>{var t,i;(i=(t=this.callbacks).onDragStart)==null||i.call(t,e)})),this.callbacks.onDrag&&this._register(addDisposableListener(this.element,EventType$1.DRAG,e=>{var t,i;(i=(t=this.callbacks).onDrag)==null||i.call(t,e)})),this._register(addDisposableListener(this.element,EventType$1.DRAG_ENTER,e=>{var t,i;this.counter++,this.dragStartTime=e.timeStamp,(i=(t=this.callbacks).onDragEnter)==null||i.call(t,e)})),this._register(addDisposableListener(this.element,EventType$1.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)==null||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(addDisposableListener(this.element,EventType$1.DRAG_LEAVE,e=>{var t,i;this.counter--,this.counter===0&&(this.dragStartTime=0,(i=(t=this.callbacks).onDragLeave)==null||i.call(t,e))})),this._register(addDisposableListener(this.element,EventType$1.DRAG_END,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDragEnd)==null||i.call(t,e)})),this._register(addDisposableListener(this.element,EventType$1.DROP,e=>{var t,i;this.counter=0,this.dragStartTime=0,(i=(t=this.callbacks).onDrop)==null||i.call(t,e)}))}}const H_REGEX=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function h(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=H_REGEX.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const r=s.groups.tag||"div",o=document.createElement(r);s.groups.id&&(o.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(o.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=o),i)for(const c of i)isHTMLElement(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,f]of Object.entries(d))o.style.setProperty(camelCaseToHyphenCase(u),typeof f=="number"?f+"px":""+f);else c==="tabIndex"?o.tabIndex=d:o.setAttribute(camelCaseToHyphenCase(c),d.toString());return l.root=o,l}function svgElem(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=H_REGEX.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const r=s.groups.tag||"div",o=document.createElementNS("http://www.w3.org/2000/svg",r);s.groups.id&&(o.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(o.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=o),i)for(const c of i)isHTMLElement(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,f]of Object.entries(d))o.style.setProperty(camelCaseToHyphenCase(u),typeof f=="number"?f+"px":""+f);else c==="tabIndex"?o.tabIndex=d:o.setAttribute(camelCaseToHyphenCase(c),d.toString());return l.root=o,l}function camelCaseToHyphenCase(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class DevicePixelRatioMonitor extends Disposable{constructor(e){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){var i;(i=this._mediaQueryList)==null||i.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class PixelRatioMonitorImpl extends Disposable{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new DevicePixelRatioMonitor(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),i=e.devicePixelRatio||1,s=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return i/s}}class PixelRatioMonitorFacade{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=getWindowId(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new PixelRatioMonitorImpl(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),Event$1.once(onDidUnregisterWindow)(({vscodeWindowId:s})=>{s===t&&(i==null||i.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const PixelRatio=new PixelRatioMonitorFacade;class FastDomNode{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=numberAsPixels(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=numberAsPixels(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=numberAsPixels(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=numberAsPixels(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=numberAsPixels(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=numberAsPixels(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=numberAsPixels(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=numberAsPixels(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=numberAsPixels(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=numberAsPixels(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=numberAsPixels(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function numberAsPixels(n){return typeof n=="number"?`${n}px`:n}function createFastDomNode(n){return new FastDomNode(n)}function applyFontInfo(n,e){n instanceof FastDomNode?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class CharWidthRequest{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class DomCharWidthReader{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){var t;this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),(t=this._container)==null||t.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");applyFontInfo(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");applyFontInfo(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");applyFontInfo(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const r=[];for(const o of this._requests){let a;o.type===0&&(a=t),o.type===2&&(a=i),o.type===1&&(a=s),a.appendChild(document.createElement("br"));const l=document.createElement("span");DomCharWidthReader._render(l,o),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let s=!1;for(const r of i)r.isTrusted||(s=!0,t.remove(r));s&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let s=this._actualReadFontInfo(e,t);(s.typicalHalfwidthCharacterWidth<=2||s.typicalFullwidthCharacterWidth<=2||s.spaceWidth<=2||s.maxDigitWidth<=2)&&(s=new FontInfo({pixelRatio:PixelRatio.getInstance(e).value,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontSize:s.fontSize,fontFeatureSettings:s.fontFeatureSettings,fontVariationSettings:s.fontVariationSettings,lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,isMonospace:s.isMonospace,typicalHalfwidthCharacterWidth:Math.max(s.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(s.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:s.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(s.spaceWidth,5),middotWidth:Math.max(s.middotWidth,5),wsmiddotWidth:Math.max(s.wsmiddotWidth,5),maxDigitWidth:Math.max(s.maxDigitWidth,5)},!1)),this._writeToCache(e,t,s)}return i.get(t)}_createRequest(e,t,i,s){const r=new CharWidthRequest(e,t);return i.push(r),s==null||s.push(r),r}_actualReadFontInfo(e,t){const i=[],s=[],r=this._createRequest("n",0,i,s),o=this._createRequest("m",0,i,null),a=this._createRequest(" ",0,i,s),l=this._createRequest("0",0,i,s),c=this._createRequest("1",0,i,s),d=this._createRequest("2",0,i,s),u=this._createRequest("3",0,i,s),f=this._createRequest("4",0,i,s),g=this._createRequest("5",0,i,s),m=this._createRequest("6",0,i,s),_=this._createRequest("7",0,i,s),v=this._createRequest("8",0,i,s),C=this._createRequest("9",0,i,s),S=this._createRequest("→",0,i,s),w=this._createRequest("→",0,i,null),L=this._createRequest("·",0,i,s),I=this._createRequest(String.fromCharCode(11825),0,i,null),N="|/-_ilm%";for(let B=0,W=N.length;B.001){T=!1;break}}let F=!0;return T&&w.width!==A&&(F=!1),w.width>S.width&&(F=!1),new FontInfo({pixelRatio:PixelRatio.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:T,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:F,spaceWidth:a.width,middotWidth:L.width,wsmiddotWidth:I.width,maxDigitWidth:R},!0)}}class FontMeasurementsCache{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const FontMeasurements=new FontMeasurementsImpl;var _util;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(_util||(_util={}));const IInstantiationService=createDecorator("instantiationService");function storeServiceDependency(n,e,t){e[_util.DI_TARGET]===e?e[_util.DI_DEPENDENCIES].push({id:n,index:t}):(e[_util.DI_DEPENDENCIES]=[{id:n,index:t}],e[_util.DI_TARGET]=e)}function createDecorator(n){if(_util.serviceIds.has(n))return _util.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");storeServiceDependency(e,t,s)};return e.toString=()=>n,_util.serviceIds.set(n,e),e}const ICodeEditorService=createDecorator("codeEditorService"),IModelService=createDecorator("modelService"),ITextModelService=createDecorator("textModelService");class Action extends Disposable{constructor(e,t="",i="",s=!0,r){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=r}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class ActionRunner extends Disposable{constructor(){super(...arguments),this._onWillRun=this._register(new Emitter$1),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new Emitter$1),this.onDidRun=this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{await this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}}const Od=class Od{constructor(){this.id=Od.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Od,...i]:t=i);return t}async run(){}};Od.ID="vs.actions.separator";let Separator=Od;class SubmenuAction{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}async run(){}}const Ih=class Ih extends Action{constructor(){super(Ih.ID,localize("submenu.empty","(empty)"),void 0,!1)}};Ih.ID="vs.actions.empty";let EmptySubmenuAction=Ih;function toAction(n){return{id:n.id,label:n.label,tooltip:n.tooltip??n.label,class:n.class,enabled:n.enabled??!0,checked:n.checked,run:async(...e)=>n.run(...e)}}var ThemeColor;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(ThemeColor||(ThemeColor={}));var ThemeIcon;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(f){const g=e.exec(f.id);if(!g)return t(Codicon.error);const[,m,_]=g,v=["codicon","codicon-"+m];return _&&v.push("codicon-modifier-"+_.substring(1)),v}n.asClassNameArray=t;function i(f){return t(f).join(" ")}n.asClassName=i;function s(f){return"."+t(f).join(".")}n.asCSSSelector=s;function r(f){return f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||ThemeColor.isThemeColor(f.color))}n.isThemeIcon=r;const o=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(f){const g=o.exec(f);if(!g)return;const[,m]=g;return{id:m}}n.fromString=a;function l(f){return{id:f}}n.fromId=l;function c(f,g){let m=f.id;const _=m.lastIndexOf("~");return _!==-1&&(m=m.substring(0,_)),g&&(m=`${m}~${g}`),{id:m}}n.modify=c;function d(f){const g=f.id.lastIndexOf("~");if(g!==-1)return f.id.substring(g+1)}n.getModifier=d;function u(f,g){var m,_;return f.id===g.id&&((m=f.color)==null?void 0:m.id)===((_=g.color)==null?void 0:_.id)}n.isEqual=u})(ThemeIcon||(ThemeIcon={}));const ICommandService=createDecorator("commandService"),CommandsRegistry=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Emitter$1,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const o=[];for(const l of n.metadata.args)o.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return validateConstraints(c,o),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new LinkedList,this._commands.set(t,i));const s=i.unshift(n),r=toDisposable(()=>{s();const o=this._commands.get(t);o!=null&&o.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(n,e){return CommandsRegistry.registerCommand(n,(t,...i)=>t.get(ICommandService).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return Iterable.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};CommandsRegistry.registerCommand("noop",()=>{});function hintDidYouMean(...n){switch(n.length){case 1:return localize("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return localize("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return localize("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const hintDidYouForgetToOpenOrCloseQuote=localize("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),hintDidYouForgetToEscapeSlash=localize("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");var Co;let Scanner$1=(Co=class{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw illegalState(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(hintDidYouMean("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(hintDidYouMean("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(hintDidYouMean("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Co._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(hintDidYouForgetToOpenOrCloseQuote);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(hintDidYouForgetToEscapeSlash);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!i){e++;break}else r===91?i=!0:r===92?t=!0:r===93&&(i=!1);e++}for(;e=this._input.length}},Co._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),Co._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]),Co);const CONSTANT_VALUES=new Map;CONSTANT_VALUES.set("false",!1);CONSTANT_VALUES.set("true",!0);CONSTANT_VALUES.set("isMac",isMacintosh);CONSTANT_VALUES.set("isLinux",isLinux);CONSTANT_VALUES.set("isWindows",isWindows);CONSTANT_VALUES.set("isWeb",isWeb);CONSTANT_VALUES.set("isMacNative",isMacintosh&&!isWeb);CONSTANT_VALUES.set("isEdge",isEdge);CONSTANT_VALUES.set("isFirefox",isFirefox$1);CONSTANT_VALUES.set("isChrome",isChrome$1);CONSTANT_VALUES.set("isSafari",isSafari$1);const hasOwnProperty$5=Object.prototype.hasOwnProperty,defaultConfig={regexParsingWithErrorRecovery:!0},errorEmptyString=localize("contextkey.parser.error.emptyString","Empty context key expression"),hintEmptyString=localize("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),errorNoInAfterNot=localize("contextkey.parser.error.noInAfterNot","'in' after 'not'."),errorClosingParenthesis=localize("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),errorUnexpectedToken=localize("contextkey.parser.error.unexpectedToken","Unexpected token"),hintUnexpectedToken=localize("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),errorUnexpectedEOF=localize("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),hintUnexpectedEOF=localize("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");var mr;let Parser$1=(mr=class{constructor(e=defaultConfig){this._config=e,this._scanner=new Scanner$1,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:errorEmptyString,offset:0,lexeme:"",additionalInfo:hintEmptyString});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),s=i.type===17?hintUnexpectedToken:void 0;throw this._parsingErrors.push({message:errorUnexpectedToken,offset:i.offset,lexeme:Scanner$1.getLexeme(i),additionalInfo:s}),mr._parseError}return t}catch(t){if(t!==mr._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:ContextKeyExpr.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:ContextKeyExpr.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ContextKeyFalseExpr.INSTANCE;case 12:return this._advance(),ContextKeyTrueExpr.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,errorClosingParenthesis),t==null?void 0:t.negate()}case 17:return this._advance(),ContextKeyNotExpr.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),ContextKeyExpr.true();case 12:return this._advance(),ContextKeyExpr.false();case 0:{this._advance();const t=this._expr();return this._consume(1,errorClosingParenthesis),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const r=s.lexeme,o=r.lastIndexOf("/"),a=o===r.length-1?void 0:this._removeFlagsGY(r.substring(o+1));let l;try{l=new RegExp(r.substring(1,o),a)}catch{throw this._errExpectedButGot("REGEX",s)}return ContextKeyRegexExpr.create(t,l)}switch(s.type){case 10:case 19:{const r=[s.lexeme];this._advance();let o=this._peek(),a=0;for(let f=0;f=0){const c=r.slice(a+1,l),d=r[l+1]==="i"?"i":"";try{o=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(o===null)throw this._errExpectedButGot("REGEX",s);return ContextKeyRegexExpr.create(t,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,errorNoInAfterNot);const s=this._value();return ContextKeyExpr.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return ContextKeyExpr.equals(t,s);switch(s){case"true":return ContextKeyExpr.has(t);case"false":return ContextKeyExpr.not(t);default:return ContextKeyExpr.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return ContextKeyExpr.notEquals(t,s);switch(s){case"true":return ContextKeyExpr.not(t);case"false":return ContextKeyExpr.has(t);default:return ContextKeyExpr.notEquals(t,s)}}case 5:return this._advance(),ContextKeySmallerExpr.create(t,this._value());case 6:return this._advance(),ContextKeySmallerEqualsExpr.create(t,this._value());case 7:return this._advance(),ContextKeyGreaterExpr.create(t,this._value());case 8:return this._advance(),ContextKeyGreaterEqualsExpr.create(t,this._value());case 13:return this._advance(),ContextKeyExpr.in(t,this._value());default:return ContextKeyExpr.has(t)}}case 20:throw this._parsingErrors.push({message:errorUnexpectedEOF,offset:e.offset,lexeme:"",additionalInfo:hintUnexpectedEOF}),mr._parseError;default:throw this._errExpectedButGot(`true | false | KEY + | KEY '=~' REGEX + | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const s=localize("contextkey.parser.error.expectedButGot",`Expected: {0} +Received: '{1}'.`,e,Scanner$1.getLexeme(t)),r=t.offset,o=Scanner$1.getLexeme(t);return this._parsingErrors.push({message:s,offset:r,lexeme:o,additionalInfo:i}),mr._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},mr._parseError=new Error,mr);const vm=class vm{static false(){return ContextKeyFalseExpr.INSTANCE}static true(){return ContextKeyTrueExpr.INSTANCE}static has(e){return ContextKeyDefinedExpr.create(e)}static equals(e,t){return ContextKeyEqualsExpr.create(e,t)}static notEquals(e,t){return ContextKeyNotEqualsExpr.create(e,t)}static regex(e,t){return ContextKeyRegexExpr.create(e,t)}static in(e,t){return ContextKeyInExpr.create(e,t)}static notIn(e,t){return ContextKeyNotInExpr.create(e,t)}static not(e){return ContextKeyNotExpr.create(e)}static and(...e){return ContextKeyAndExpr.create(e,null,!0)}static or(...e){return ContextKeyOrExpr.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};vm._parser=new Parser$1({regexParsingWithErrorRecovery:!1});let ContextKeyExpr=vm;function expressionsAreEqualWithConstantSubstitution(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function cmp(n,e){return n.cmp(e)}const Th=class Th{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return ContextKeyTrueExpr.INSTANCE}};Th.INSTANCE=new Th;let ContextKeyFalseExpr=Th;const Dh=class Dh{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ContextKeyFalseExpr.INSTANCE}};Dh.INSTANCE=new Dh;let ContextKeyTrueExpr=Dh;class ContextKeyDefinedExpr{static create(e,t=null){const i=CONSTANT_VALUES.get(e);return typeof i=="boolean"?i?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE:new ContextKeyDefinedExpr(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:cmp1(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);return typeof e=="boolean"?e?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotExpr.create(this.key,this)),this.negated}}class ContextKeyEqualsExpr{static create(e,t,i=null){if(typeof t=="boolean")return t?ContextKeyDefinedExpr.create(e,i):ContextKeyNotExpr.create(e,i);const s=CONSTANT_VALUES.get(e);return typeof s=="boolean"?t===(s?"true":"false")?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE:new ContextKeyEqualsExpr(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ContextKeyTrueExpr.INSTANCE:ContextKeyFalseExpr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyInExpr{static create(e,t){return new ContextKeyInExpr(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?hasOwnProperty$5.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=ContextKeyNotInExpr.create(this.key,this.valueKey)),this.negated}}class ContextKeyNotInExpr{static create(e,t){return new ContextKeyNotInExpr(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=ContextKeyInExpr.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class ContextKeyNotEqualsExpr{static create(e,t,i=null){if(typeof t=="boolean")return t?ContextKeyNotExpr.create(e,i):ContextKeyDefinedExpr.create(e,i);const s=CONSTANT_VALUES.get(e);return typeof s=="boolean"?t===(s?"true":"false")?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE:new ContextKeyNotEqualsExpr(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyNotExpr{static create(e,t=null){const i=CONSTANT_VALUES.get(e);return typeof i=="boolean"?i?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE:new ContextKeyNotExpr(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:cmp1(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=CONSTANT_VALUES.get(this.key);return typeof e=="boolean"?e?ContextKeyFalseExpr.INSTANCE:ContextKeyTrueExpr.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyDefinedExpr.create(this.key,this)),this.negated}}function withFloatOrStr(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):ContextKeyFalseExpr.INSTANCE}class ContextKeyGreaterExpr{static create(e,t,i=null){return withFloatOrStr(t,s=>new ContextKeyGreaterExpr(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeySmallerEqualsExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyGreaterEqualsExpr{static create(e,t,i=null){return withFloatOrStr(t,s=>new ContextKeyGreaterEqualsExpr(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeySmallerExpr.create(this.key,this.value,this)),this.negated}}class ContextKeySmallerExpr{static create(e,t,i=null){return withFloatOrStr(t,s=>new ContextKeySmallerExpr(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new ContextKeySmallerEqualsExpr(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:cmp2(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyGreaterExpr.create(this.key,this.value,this)),this.negated}}class ContextKeyRegexExpr{static create(e,t){return new ContextKeyRegexExpr(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ContextKeyNotRegexExpr.create(this)),this.negated}}class ContextKeyNotRegexExpr{static create(e){return new ContextKeyNotRegexExpr(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function eliminateConstantsInArray(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const o=s[s.length-1];if(o.type!==9)break;s.pop();const a=s.pop(),l=s.length===0,c=ContextKeyOrExpr.create(o.expr.map(d=>ContextKeyAndExpr.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(cmp))}if(s.length===1)return s[0];if(i){for(let o=0;oe.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=ContextKeyOrExpr.create(e,this,!0)}return this.negated}}class ContextKeyOrExpr{static create(e,t,i){return ContextKeyOrExpr._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const r of getTerminals(t))for(const o of getTerminals(i))s.push(ContextKeyAndExpr.create([r,o],null,!1));e.unshift(ContextKeyOrExpr.create(s,null,!1))}this.negated=ContextKeyOrExpr.create(e,this,!0)}return this.negated}}const ol=class ol extends ContextKeyDefinedExpr{static all(){return ol._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?ol._info.push({...i,key:e}):i!==!0&&ol._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return ContextKeyEqualsExpr.create(this.key,e)}};ol._info=[];let RawContextKey=ol;const IContextKeyService=createDecorator("contextKeyService");function cmp1(n,e){return ne?1:0}function cmp2(n,e,t,i){return nt?1:ei?1:0}function implies(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?allElementsIncluded(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(implies(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return allElementsIncluded(e.expr,n.expr);for(const t of n.expr)if(implies(t,e))return!0;return!1}return n.equals(e)}function allElementsIncluded(n,e){let t=0,i=0;for(;t{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(sorter)),this._cachedMergedKeybindings.slice(0)}}const KeybindingsRegistry=new KeybindingsRegistryImpl,Extensions$9={EditorModes:"platform.keybindingsRegistry"};Registry.add(Extensions$9.EditorModes,KeybindingsRegistry);function sorter(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var __decorate$2B=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2v=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MenuItemAction_1;function isIMenuItem(n){return n.command!==void 0}function isISubmenuItem(n){return n.submenu!==void 0}const Z=class Z{constructor(e){if(Z._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);Z._instances.set(e,this),this.id=e}};Z._instances=new Map,Z.CommandPalette=new Z("CommandPalette"),Z.DebugBreakpointsContext=new Z("DebugBreakpointsContext"),Z.DebugCallStackContext=new Z("DebugCallStackContext"),Z.DebugConsoleContext=new Z("DebugConsoleContext"),Z.DebugVariablesContext=new Z("DebugVariablesContext"),Z.NotebookVariablesContext=new Z("NotebookVariablesContext"),Z.DebugHoverContext=new Z("DebugHoverContext"),Z.DebugWatchContext=new Z("DebugWatchContext"),Z.DebugToolBar=new Z("DebugToolBar"),Z.DebugToolBarStop=new Z("DebugToolBarStop"),Z.DebugCallStackToolbar=new Z("DebugCallStackToolbar"),Z.DebugCreateConfiguration=new Z("DebugCreateConfiguration"),Z.EditorContext=new Z("EditorContext"),Z.SimpleEditorContext=new Z("SimpleEditorContext"),Z.EditorContent=new Z("EditorContent"),Z.EditorLineNumberContext=new Z("EditorLineNumberContext"),Z.EditorContextCopy=new Z("EditorContextCopy"),Z.EditorContextPeek=new Z("EditorContextPeek"),Z.EditorContextShare=new Z("EditorContextShare"),Z.EditorTitle=new Z("EditorTitle"),Z.EditorTitleRun=new Z("EditorTitleRun"),Z.EditorTitleContext=new Z("EditorTitleContext"),Z.EditorTitleContextShare=new Z("EditorTitleContextShare"),Z.EmptyEditorGroup=new Z("EmptyEditorGroup"),Z.EmptyEditorGroupContext=new Z("EmptyEditorGroupContext"),Z.EditorTabsBarContext=new Z("EditorTabsBarContext"),Z.EditorTabsBarShowTabsSubmenu=new Z("EditorTabsBarShowTabsSubmenu"),Z.EditorTabsBarShowTabsZenModeSubmenu=new Z("EditorTabsBarShowTabsZenModeSubmenu"),Z.EditorActionsPositionSubmenu=new Z("EditorActionsPositionSubmenu"),Z.ExplorerContext=new Z("ExplorerContext"),Z.ExplorerContextShare=new Z("ExplorerContextShare"),Z.ExtensionContext=new Z("ExtensionContext"),Z.GlobalActivity=new Z("GlobalActivity"),Z.CommandCenter=new Z("CommandCenter"),Z.CommandCenterCenter=new Z("CommandCenterCenter"),Z.LayoutControlMenuSubmenu=new Z("LayoutControlMenuSubmenu"),Z.LayoutControlMenu=new Z("LayoutControlMenu"),Z.MenubarMainMenu=new Z("MenubarMainMenu"),Z.MenubarAppearanceMenu=new Z("MenubarAppearanceMenu"),Z.MenubarDebugMenu=new Z("MenubarDebugMenu"),Z.MenubarEditMenu=new Z("MenubarEditMenu"),Z.MenubarCopy=new Z("MenubarCopy"),Z.MenubarFileMenu=new Z("MenubarFileMenu"),Z.MenubarGoMenu=new Z("MenubarGoMenu"),Z.MenubarHelpMenu=new Z("MenubarHelpMenu"),Z.MenubarLayoutMenu=new Z("MenubarLayoutMenu"),Z.MenubarNewBreakpointMenu=new Z("MenubarNewBreakpointMenu"),Z.PanelAlignmentMenu=new Z("PanelAlignmentMenu"),Z.PanelPositionMenu=new Z("PanelPositionMenu"),Z.ActivityBarPositionMenu=new Z("ActivityBarPositionMenu"),Z.MenubarPreferencesMenu=new Z("MenubarPreferencesMenu"),Z.MenubarRecentMenu=new Z("MenubarRecentMenu"),Z.MenubarSelectionMenu=new Z("MenubarSelectionMenu"),Z.MenubarShare=new Z("MenubarShare"),Z.MenubarSwitchEditorMenu=new Z("MenubarSwitchEditorMenu"),Z.MenubarSwitchGroupMenu=new Z("MenubarSwitchGroupMenu"),Z.MenubarTerminalMenu=new Z("MenubarTerminalMenu"),Z.MenubarViewMenu=new Z("MenubarViewMenu"),Z.MenubarHomeMenu=new Z("MenubarHomeMenu"),Z.OpenEditorsContext=new Z("OpenEditorsContext"),Z.OpenEditorsContextShare=new Z("OpenEditorsContextShare"),Z.ProblemsPanelContext=new Z("ProblemsPanelContext"),Z.SCMInputBox=new Z("SCMInputBox"),Z.SCMChangesSeparator=new Z("SCMChangesSeparator"),Z.SCMChangesContext=new Z("SCMChangesContext"),Z.SCMIncomingChanges=new Z("SCMIncomingChanges"),Z.SCMIncomingChangesContext=new Z("SCMIncomingChangesContext"),Z.SCMIncomingChangesSetting=new Z("SCMIncomingChangesSetting"),Z.SCMOutgoingChanges=new Z("SCMOutgoingChanges"),Z.SCMOutgoingChangesContext=new Z("SCMOutgoingChangesContext"),Z.SCMOutgoingChangesSetting=new Z("SCMOutgoingChangesSetting"),Z.SCMIncomingChangesAllChangesContext=new Z("SCMIncomingChangesAllChangesContext"),Z.SCMIncomingChangesHistoryItemContext=new Z("SCMIncomingChangesHistoryItemContext"),Z.SCMOutgoingChangesAllChangesContext=new Z("SCMOutgoingChangesAllChangesContext"),Z.SCMOutgoingChangesHistoryItemContext=new Z("SCMOutgoingChangesHistoryItemContext"),Z.SCMChangeContext=new Z("SCMChangeContext"),Z.SCMResourceContext=new Z("SCMResourceContext"),Z.SCMResourceContextShare=new Z("SCMResourceContextShare"),Z.SCMResourceFolderContext=new Z("SCMResourceFolderContext"),Z.SCMResourceGroupContext=new Z("SCMResourceGroupContext"),Z.SCMSourceControl=new Z("SCMSourceControl"),Z.SCMSourceControlInline=new Z("SCMSourceControlInline"),Z.SCMSourceControlTitle=new Z("SCMSourceControlTitle"),Z.SCMHistoryTitle=new Z("SCMHistoryTitle"),Z.SCMTitle=new Z("SCMTitle"),Z.SearchContext=new Z("SearchContext"),Z.SearchActionMenu=new Z("SearchActionContext"),Z.StatusBarWindowIndicatorMenu=new Z("StatusBarWindowIndicatorMenu"),Z.StatusBarRemoteIndicatorMenu=new Z("StatusBarRemoteIndicatorMenu"),Z.StickyScrollContext=new Z("StickyScrollContext"),Z.TestItem=new Z("TestItem"),Z.TestItemGutter=new Z("TestItemGutter"),Z.TestProfilesContext=new Z("TestProfilesContext"),Z.TestMessageContext=new Z("TestMessageContext"),Z.TestMessageContent=new Z("TestMessageContent"),Z.TestPeekElement=new Z("TestPeekElement"),Z.TestPeekTitle=new Z("TestPeekTitle"),Z.TestCallStack=new Z("TestCallStack"),Z.TouchBarContext=new Z("TouchBarContext"),Z.TitleBarContext=new Z("TitleBarContext"),Z.TitleBarTitleContext=new Z("TitleBarTitleContext"),Z.TunnelContext=new Z("TunnelContext"),Z.TunnelPrivacy=new Z("TunnelPrivacy"),Z.TunnelProtocol=new Z("TunnelProtocol"),Z.TunnelPortInline=new Z("TunnelInline"),Z.TunnelTitle=new Z("TunnelTitle"),Z.TunnelLocalAddressInline=new Z("TunnelLocalAddressInline"),Z.TunnelOriginInline=new Z("TunnelOriginInline"),Z.ViewItemContext=new Z("ViewItemContext"),Z.ViewContainerTitle=new Z("ViewContainerTitle"),Z.ViewContainerTitleContext=new Z("ViewContainerTitleContext"),Z.ViewTitle=new Z("ViewTitle"),Z.ViewTitleContext=new Z("ViewTitleContext"),Z.CommentEditorActions=new Z("CommentEditorActions"),Z.CommentThreadTitle=new Z("CommentThreadTitle"),Z.CommentThreadActions=new Z("CommentThreadActions"),Z.CommentThreadAdditionalActions=new Z("CommentThreadAdditionalActions"),Z.CommentThreadTitleContext=new Z("CommentThreadTitleContext"),Z.CommentThreadCommentContext=new Z("CommentThreadCommentContext"),Z.CommentTitle=new Z("CommentTitle"),Z.CommentActions=new Z("CommentActions"),Z.CommentsViewThreadActions=new Z("CommentsViewThreadActions"),Z.InteractiveToolbar=new Z("InteractiveToolbar"),Z.InteractiveCellTitle=new Z("InteractiveCellTitle"),Z.InteractiveCellDelete=new Z("InteractiveCellDelete"),Z.InteractiveCellExecute=new Z("InteractiveCellExecute"),Z.InteractiveInputExecute=new Z("InteractiveInputExecute"),Z.InteractiveInputConfig=new Z("InteractiveInputConfig"),Z.ReplInputExecute=new Z("ReplInputExecute"),Z.IssueReporter=new Z("IssueReporter"),Z.NotebookToolbar=new Z("NotebookToolbar"),Z.NotebookStickyScrollContext=new Z("NotebookStickyScrollContext"),Z.NotebookCellTitle=new Z("NotebookCellTitle"),Z.NotebookCellDelete=new Z("NotebookCellDelete"),Z.NotebookCellInsert=new Z("NotebookCellInsert"),Z.NotebookCellBetween=new Z("NotebookCellBetween"),Z.NotebookCellListTop=new Z("NotebookCellTop"),Z.NotebookCellExecute=new Z("NotebookCellExecute"),Z.NotebookCellExecuteGoTo=new Z("NotebookCellExecuteGoTo"),Z.NotebookCellExecutePrimary=new Z("NotebookCellExecutePrimary"),Z.NotebookDiffCellInputTitle=new Z("NotebookDiffCellInputTitle"),Z.NotebookDiffCellMetadataTitle=new Z("NotebookDiffCellMetadataTitle"),Z.NotebookDiffCellOutputsTitle=new Z("NotebookDiffCellOutputsTitle"),Z.NotebookOutputToolbar=new Z("NotebookOutputToolbar"),Z.NotebookOutlineFilter=new Z("NotebookOutlineFilter"),Z.NotebookOutlineActionMenu=new Z("NotebookOutlineActionMenu"),Z.NotebookEditorLayoutConfigure=new Z("NotebookEditorLayoutConfigure"),Z.NotebookKernelSource=new Z("NotebookKernelSource"),Z.BulkEditTitle=new Z("BulkEditTitle"),Z.BulkEditContext=new Z("BulkEditContext"),Z.TimelineItemContext=new Z("TimelineItemContext"),Z.TimelineTitle=new Z("TimelineTitle"),Z.TimelineTitleContext=new Z("TimelineTitleContext"),Z.TimelineFilterSubMenu=new Z("TimelineFilterSubMenu"),Z.AccountsContext=new Z("AccountsContext"),Z.SidebarTitle=new Z("SidebarTitle"),Z.PanelTitle=new Z("PanelTitle"),Z.AuxiliaryBarTitle=new Z("AuxiliaryBarTitle"),Z.AuxiliaryBarHeader=new Z("AuxiliaryBarHeader"),Z.TerminalInstanceContext=new Z("TerminalInstanceContext"),Z.TerminalEditorInstanceContext=new Z("TerminalEditorInstanceContext"),Z.TerminalNewDropdownContext=new Z("TerminalNewDropdownContext"),Z.TerminalTabContext=new Z("TerminalTabContext"),Z.TerminalTabEmptyAreaContext=new Z("TerminalTabEmptyAreaContext"),Z.TerminalStickyScrollContext=new Z("TerminalStickyScrollContext"),Z.WebviewContext=new Z("WebviewContext"),Z.InlineCompletionsActions=new Z("InlineCompletionsActions"),Z.InlineEditsActions=new Z("InlineEditsActions"),Z.InlineEditActions=new Z("InlineEditActions"),Z.NewFile=new Z("NewFile"),Z.MergeInput1Toolbar=new Z("MergeToolbar1Toolbar"),Z.MergeInput2Toolbar=new Z("MergeToolbar2Toolbar"),Z.MergeBaseToolbar=new Z("MergeBaseToolbar"),Z.MergeInputResultToolbar=new Z("MergeToolbarResultToolbar"),Z.InlineSuggestionToolbar=new Z("InlineSuggestionToolbar"),Z.InlineEditToolbar=new Z("InlineEditToolbar"),Z.ChatContext=new Z("ChatContext"),Z.ChatCodeBlock=new Z("ChatCodeblock"),Z.ChatCompareBlock=new Z("ChatCompareBlock"),Z.ChatMessageTitle=new Z("ChatMessageTitle"),Z.ChatExecute=new Z("ChatExecute"),Z.ChatExecuteSecondary=new Z("ChatExecuteSecondary"),Z.ChatInputSide=new Z("ChatInputSide"),Z.AccessibleView=new Z("AccessibleView"),Z.MultiDiffEditorFileToolbar=new Z("MultiDiffEditorFileToolbar"),Z.DiffEditorHunkToolbar=new Z("DiffEditorHunkToolbar"),Z.DiffEditorSelectionToolbar=new Z("DiffEditorSelectionToolbar");let MenuId=Z;const IMenuService=createDecorator("menuService"),$d=class $d{static for(e){let t=this._all.get(e);return t||(t=new $d(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof $d&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};$d._all=new Map;let MenuRegistryChangeEvent=$d;const MenuRegistry=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new MicrotaskEmitter({merge:MenuRegistryChangeEvent.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette)),toDisposable(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(MenuId.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new LinkedList,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(n)),toDisposable(()=>{i(),this._onDidChangeMenu.fire(MenuRegistryChangeEvent.for(n))})}appendMenuItems(n){const e=new DisposableStore;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===MenuId.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)isIMenuItem(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class SubmenuItemAction extends SubmenuAction{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let MenuItemAction=MenuItemAction_1=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,r,o,a){var c;this.hideActions=s,this.menuKeybinding=r,this._commandService=a,this.id=e.id,this.label=MenuItemAction_1.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:(c=e.tooltip)==null?void 0:c.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&ThemeIcon.isThemeIcon(d.icon)&&(l=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}l||(l=ThemeIcon.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new MenuItemAction_1(t,void 0,i,s,void 0,o,a):void 0,this._options=i,this.class=l&&ThemeIcon.asClassName(l)}run(...e){var i,s;let t=[];return(i=this._options)!=null&&i.arg&&(t=[...t,this._options.arg]),(s=this._options)!=null&&s.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};MenuItemAction=MenuItemAction_1=__decorate$2B([__param$2v(5,IContextKeyService),__param$2v(6,ICommandService)],MenuItemAction);class Action2{constructor(e){this.desc=e}}function registerAction2(n){const e=[],t=new n,{f1:i,menu:s,keybinding:r,...o}=t.desc;if(CommandsRegistry.getCommand(o.id))throw new Error(`Cannot register two commands with the same id: ${o.id}`);if(e.push(CommandsRegistry.registerCommand({id:o.id,handler:(a,...l)=>t.run(a,...l),metadata:o.metadata})),Array.isArray(s))for(const a of s)e.push(MenuRegistry.appendMenuItem(a.id,{command:{...o,precondition:a.precondition===null?void 0:o.precondition},...a}));else s&&e.push(MenuRegistry.appendMenuItem(s.id,{command:{...o,precondition:s.precondition===null?void 0:o.precondition},...s}));if(i&&(e.push(MenuRegistry.appendMenuItem(MenuId.CommandPalette,{command:o,when:o.precondition})),e.push(MenuRegistry.addCommand(o))),Array.isArray(r))for(const a of r)e.push(KeybindingsRegistry.registerKeybindingRule({...a,id:o.id,when:o.precondition?ContextKeyExpr.and(o.precondition,a.when):a.when}));else r&&e.push(KeybindingsRegistry.registerKeybindingRule({...r,id:o.id,when:o.precondition?ContextKeyExpr.and(o.precondition,r.when):r.when}));return{dispose(){dispose(e)}}}const ITelemetryService=createDecorator("telemetryService"),ILogService=createDecorator("logService");var LogLevel;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(LogLevel||(LogLevel={}));const DEFAULT_LOG_LEVEL=LogLevel.Info;class AbstractLogger extends Disposable{constructor(){super(...arguments),this.level=DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new Emitter$1),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==LogLevel.Off&&this.level<=e}}class ConsoleLogger extends AbstractLogger{constructor(e=DEFAULT_LOG_LEVEL,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(LogLevel.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(LogLevel.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(LogLevel.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(LogLevel.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(LogLevel.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}}class MultiplexLogger extends AbstractLogger{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}}function LogLevelToString(n){switch(n){case LogLevel.Trace:return"trace";case LogLevel.Debug:return"debug";case LogLevel.Info:return"info";case LogLevel.Warning:return"warn";case LogLevel.Error:return"error";case LogLevel.Off:return"off"}}new RawContextKey("logLevel",LogLevelToString(LogLevel.Info));class Command{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=ContextKeyExpr.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};KeybindingsRegistry.registerKeybindingRule(s)}}CommandsRegistry.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata})}_registerMenuItem(e){MenuRegistry.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class MultiCommand extends Command{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((r,o)=>o.priority-r.priority),{dispose:()=>{for(let r=0;r{if(a.get(IContextKeyService).contextMatchesRules(i??void 0))return s(a,o,t)})}runCommand(e,t){return EditorCommand.runEditorCommand(e,t,this.precondition,(i,s,r)=>this.runEditorCommand(i,s,r))}}class EditorAction extends EditorCommand{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=MenuId.EditorContext),s.title||(s.title=e.label),s.when=ContextKeyExpr.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(EditorAction.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(ITelemetryService).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class MultiEditorAction extends EditorAction{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{var c;const o=r.get(IContextKeyService),a=r.get(ILogService);if(!o.contextMatchesRules(this.desc.precondition??void 0)){a.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(c=this.desc.precondition)==null?void 0:c.serialize());return}return this.runEditorCommand(r,s,...t)})}}function registerModelAndPositionCommand(n,e){CommandsRegistry.registerCommand(n,function(t,...i){const s=t.get(IInstantiationService),[r,o]=i;assertType(URI.isUri(r)),assertType(Position$1.isIPosition(o));const a=t.get(IModelService).getModel(r);if(a){const l=Position$1.lift(o);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(ITextModelService).createModelReference(r).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,Position$1.lift(o),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function registerEditorCommand(n){return EditorContributionRegistry.INSTANCE.registerEditorCommand(n),n}function registerEditorAction(n){const e=new n;return EditorContributionRegistry.INSTANCE.registerEditorAction(e),e}function registerMultiEditorAction(n){return EditorContributionRegistry.INSTANCE.registerEditorAction(n),n}function registerInstantiatedEditorAction(n){EditorContributionRegistry.INSTANCE.registerEditorAction(n)}function registerEditorContribution(n,e,t){EditorContributionRegistry.INSTANCE.registerEditorContribution(n,e,t)}var EditorExtensionsRegistry;(function(n){function e(o){return EditorContributionRegistry.INSTANCE.getEditorCommand(o)}n.getEditorCommand=e;function t(){return EditorContributionRegistry.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return EditorContributionRegistry.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(o){return EditorContributionRegistry.INSTANCE.getEditorContributions().filter(a=>o.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function r(){return EditorContributionRegistry.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=r})(EditorExtensionsRegistry||(EditorExtensionsRegistry={}));const Extensions$8={EditorCommonContributions:"editor.contributions"},Nh=class Nh{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}};Nh.INSTANCE=new Nh;let EditorContributionRegistry=Nh;Registry.add(Extensions$8.EditorCommonContributions,EditorContributionRegistry.INSTANCE);function registerCommand$3(n){return n.register(),n}const UndoCommand=registerCommand$3(new MultiCommand({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"1_do",title:localize({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("undo","Undo"),order:1}]}));registerCommand$3(new ProxyCommand(UndoCommand,{id:"default:undo",precondition:void 0}));const RedoCommand=registerCommand$3(new MultiCommand({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"1_do",title:localize({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:MenuId.CommandPalette,group:"",title:localize("redo","Redo"),order:1}]}));registerCommand$3(new ProxyCommand(RedoCommand,{id:"default:redo",precondition:void 0}));const SelectAllCommand=registerCommand$3(new MultiCommand({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("selectAll","Select All"),order:1}]})),DEFAULT_CHANNEL="default",INITIALIZE="$initialize";let webWorkerWarningLogged=!1;function logOnceWebWorkerWarning(n){isWeb&&(webWorkerWarningLogged||(webWorkerWarningLogged=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class RequestMessage{constructor(e,t,i,s,r){this.vsWorker=e,this.req=t,this.channel=i,this.method=s,this.args=r,this.type=0}}class ReplyMessage{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class SubscribeEventMessage{constructor(e,t,i,s,r){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=s,this.arg=r,this.type=2}}class EventMessage{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class UnsubscribeEventMessage{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class SimpleWorkerProtocol{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t,i){const s=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[s]={resolve:r,reject:o},this._send(new RequestMessage(this._workerId,s,e,t,i))})}listen(e,t,i){let s=null;const r=new Emitter$1({onWillAddFirstListener:()=>{s=String(++this._lastSentReq),this._pendingEmitters.set(s,r),this._send(new SubscribeEventMessage(this._workerId,s,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(s),this._send(new UnsubscribeEventMessage(this._workerId,s)),s=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}createProxyToRemoteChannel(e,t){const i={get:(s,r)=>(typeof r=="string"&&!s[r]&&(propertyIsDynamicEvent(r)?s[r]=o=>this.listen(e,r,o):propertyIsEvent(r)?s[r]=this.listen(e,r,void 0):r.charCodeAt(0)===36&&(s[r]=async(...o)=>(await(t==null?void 0:t()),this.sendMessage(e,r,o)))),s[r])};return new Proxy(Object.create(null),i)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(s=>{this._send(new ReplyMessage(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=transformErrorForSerialization(s.detail)),this._send(new ReplyMessage(this._workerId,t,void 0,transformErrorForSerialization(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(s=>{this._send(new EventMessage(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(r)},r=>{onUnexpectedError(r)})),this._protocol=new SimpleWorkerProtocol({sendMessage:(r,o)=>{this._worker.postMessage(r,o)},handleMessage:(r,o,a)=>this._handleMessage(r,o,a),handleEvent:(r,o,a)=>this._handleEvent(r,o,a)}),this._protocol.setWorkerId(this._worker.getId());let i=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?i=s.getConfig():typeof globalThis.requirejs<"u"&&(i=globalThis.requirejs.s.contexts._.config),this._onModuleLoaded=this._protocol.sendMessage(DEFAULT_CHANNEL,INITIALIZE,[this._worker.getId(),JSON.parse(JSON.stringify(i)),t.amdModuleId]),this.proxy=this._protocol.createProxyToRemoteChannel(DEFAULT_CHANNEL,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(r=>{this._onError("Worker failed to load "+t.amdModuleId,r)})}_handleMessage(e,t,i){const s=this._localChannels.get(e);if(!s)return Promise.reject(new Error(`Missing channel ${e} on main thread`));if(typeof s[t]!="function")return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(s[t].apply(s,i))}catch(r){return Promise.reject(r)}}_handleEvent(e,t,i){const s=this._localChannels.get(e);if(!s)throw new Error(`Missing channel ${e} on main thread`);if(propertyIsDynamicEvent(t)){const r=s[t].call(s,i);if(typeof r!="function")throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return r}if(propertyIsEvent(t)){const r=s[t];if(typeof r!="function")throw new Error(`Missing event ${t} on main thread channel ${e}.`);return r}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function propertyIsEvent(n){return n[0]==="o"&&n[1]==="n"&&isUpperAsciiLetter(n.charCodeAt(2))}function propertyIsDynamicEvent(n){return/^onDynamic/.test(n)&&isUpperAsciiLetter(n.charCodeAt(9))}function createTrustedTypesPolicy(n,e){var i;const t=globalThis.MonacoEnvironment;if(t!=null&&t.createTrustedTypesPolicy)try{return t.createTrustedTypesPolicy(n,e)}catch(s){onUnexpectedError(s);return}try{return(i=globalThis.trustedTypes)==null?void 0:i.createPolicy(n,e)}catch(s){onUnexpectedError(s);return}}let ttPolicy$4;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?ttPolicy$4=globalThis.workerttPolicy:ttPolicy$4=createTrustedTypesPolicy("defaultWorkerFactory",{createScriptURL:n=>n});function getWorker$1(n,e){const t=globalThis.MonacoEnvironment;if(t){if(typeof t.getWorker=="function")return t.getWorker("workerMain.js",e);if(typeof t.getWorkerUrl=="function"){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(ttPolicy$4?ttPolicy$4.createScriptURL(i):i,{name:e,type:"module"})}}if(n){const i=getWorkerBootstrapUrl(e,n.toString(!0)),s=new Worker(ttPolicy$4?ttPolicy$4.createScriptURL(i):i,{name:e,type:"module"});return whenESMWorkerReady(s)}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function getWorkerBootstrapUrl(n,e,t){if(!(/^((http:)|(https:)|(file:)|(vscode-file:))/.test(e)&&e.substring(0,globalThis.origin.length)!==globalThis.origin)){const r=e.lastIndexOf("?"),o=e.lastIndexOf("#",r),a=r>0?new URLSearchParams(e.substring(r+1,~o?o:void 0)):new URLSearchParams;COI.addSearchParam(a,!0,!0),a.toString()?e=`${e}?${a.toString()}#${n}`:e=`${e}#${n}`}const s=new Blob([coalesce([`/*${n}*/`,t?`globalThis.MonacoEnvironment = { baseUrl: '${t}' };`:void 0,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(getNLSMessages())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(getNLSLanguage())};`,`globalThis._VSCODE_FILE_ROOT = '${globalThis._VSCODE_FILE_ROOT}';`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL('${e}') ?? '${e}');`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${n}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(s)}function whenESMWorkerReady(n){return new Promise((e,t)=>{n.onmessage=function(i){i.data.type==="vscode-worker-ready"&&(n.onmessage=null,e(n))},n.onerror=t})}function isPromiseLike(n){return typeof n.then=="function"}class WebWorker extends Disposable{constructor(e,t,i,s,r,o){super(),this.id=i,this.label=s;const a=getWorker$1(e,s);isPromiseLike(a)?this.worker=a:this.worker=Promise.resolve(a),this.postMessage(t,[]),this.worker.then(l=>{l.onmessage=function(c){r(c.data)},l.onmessageerror=o,typeof l.addEventListener=="function"&&l.addEventListener("error",o)}),this._register(toDisposable(()=>{var l;(l=this.worker)==null||l.then(c=>{c.onmessage=null,c.onmessageerror=null,c.removeEventListener("error",o),c.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)==null||i.then(s=>{try{s.postMessage(e,t)}catch(r){onUnexpectedError(r),onUnexpectedError(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:r}))}})}}class WorkerDescriptor{constructor(e,t){this.amdModuleId=e,this.label=t,this.esmModuleLocation=FileAccess.asBrowserUri(`${e}.esm.js`)}}const Ah=class Ah{constructor(){this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++Ah.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new WebWorker(e.esmModuleLocation,e.amdModuleId,s,e.label||"anonymous"+s,t,r=>{logOnceWebWorkerWarning(r),this._webWorkerFailedBeforeError=r,i(r)})}};Ah.LAST_WORKER_ID=0;let DefaultWorkerFactory=Ah;function createWebWorker$2(n,e){const t=typeof n=="string"?new WorkerDescriptor(n,e):n;return new SimpleWorkerClient(new DefaultWorkerFactory,t)}var IndentAction;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(IndentAction||(IndentAction={}));class StandardAutoClosingPairConditional{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;tnew StandardAutoClosingPairConditional(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new StandardAutoClosingPairConditional({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new StandardAutoClosingPairConditional({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:al.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:al.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}};al.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `,al.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `;let CharacterPairSupport=al;function createScopedLineTokens(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),s=n.getLanguageId(i);let r=i;for(;r+10&&n.getLanguageId(o-1)===s;)o--;return new ScopedLineTokens(n,s,o,r+1,n.getStartOffset(o),n.getEndOffset(r))}class ScopedLineTokens{constructor(e,t,i,s,r,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=r,this._lastCharOffset=o,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function ignoreBracketsInToken(n){return(n&3)!==0}const hasBuffer=typeof Buffer<"u";let textDecoder;class VSBuffer{static wrap(e){return hasBuffer&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new VSBuffer(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return hasBuffer?this.buffer.toString():(textDecoder||(textDecoder=new TextDecoder),textDecoder.decode(this.buffer))}}function readUInt16LE(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function writeUInt16LE(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function readUInt32BE(n,e){return n[e]*2**24+n[e+1]*2**16+n[e+2]*2**8+n[e+3]}function writeUInt32BE(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function readUInt8(n,e){return n[e]}function writeUInt8(n,e,t){n[t]=e}let _utf16LE_TextDecoder;function getUTF16LE_TextDecoder(){return _utf16LE_TextDecoder||(_utf16LE_TextDecoder=new TextDecoder("UTF-16LE")),_utf16LE_TextDecoder}let _utf16BE_TextDecoder;function getUTF16BE_TextDecoder(){return _utf16BE_TextDecoder||(_utf16BE_TextDecoder=new TextDecoder("UTF-16BE")),_utf16BE_TextDecoder}let _platformTextDecoder;function getPlatformTextDecoder(){return _platformTextDecoder||(_platformTextDecoder=isLittleEndian()?getUTF16LE_TextDecoder():getUTF16BE_TextDecoder()),_platformTextDecoder}function decodeUTF16LE(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?compatDecodeUTF16LE(n,e,t):getUTF16LE_TextDecoder().decode(i)}function compatDecodeUTF16LE(n,e,t){const i=[];let s=0;for(let r=0;r=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o{const[l,c]=o,[d,u]=a;return l===d||l===u||c===d||c===u},s=(o,a)=>{const l=Math.min(o,a),c=Math.max(o,a);for(let d=0;d0&&r.push({open:a,close:l})}return r}class RichEditBrackets{constructor(e,t){this._richEditBracketsBrand=void 0;const i=groupFuzzyBrackets(t);this.brackets=i.map((s,r)=>new RichEditBracket(e,r,s.open,s.close,getRegexForBracketPair(s.open,s.close,i,r),getReversedRegexForBracketPair(s.open,s.close,i,r))),this.forwardRegex=getRegexForBrackets(this.brackets),this.reversedRegex=getReversedRegexForBrackets(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const r of s.open)this.textIsBracket[r]=s,this.textIsOpenBracket[r]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,r.length);for(const r of s.close)this.textIsBracket[r]=s,this.textIsOpenBracket[r]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,r.length)}}}function collectSuperstrings(n,e,t,i){for(let s=0,r=e.length;s=0&&i.push(a);for(const a of o.close)a.indexOf(n)>=0&&i.push(a)}}function lengthcmp(n,e){return n.length-e.length}function unique(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function getRegexForBracketPair(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let r=0,o=s.length;r=0;o--)s[r++]=i.charCodeAt(o);return getPlatformTextDecoder().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class BracketsUtils{static _findPrevBracketInText(e,t,i,s){const r=i.match(e);if(!r)return null;const o=i.length-(r.index||0),a=r[0].length,l=s+o;return new Range$2(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,r){const a=toReversedString(i).substring(i.length-r,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const r=i.match(e);if(!r)return null;const o=r.index||0,a=r[0].length;if(a===0)return null;const l=s+o;return new Range$2(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,r){const o=i.substring(s,r);return this.findNextBracketInText(e,t,o,s)}}class BracketElectricCharacterSupport{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return distinct(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(ignoreBracketsInToken(t.getStandardTokenType(s)))return null;const r=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,a=BracketsUtils.findPrevBracketInRange(r,1,o,0,o.length);if(!a)return null;const l=o.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function resetGlobalRegex(n){return n.global&&(n.lastIndex=0),!0}class IndentRulesSupport{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&resetGlobalRegex(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&resetGlobalRegex(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&resetGlobalRegex(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&resetGlobalRegex(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class OnEnterSupport{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=OnEnterSupport._createOpenBracketRegExp(t[0]),s=OnEnterSupport._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let r=0,o=this._regExpRules.length;rc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let r=0,o=this._brackets.length;r=2&&i.length>0){for(let r=0,o=this._brackets.length;r"u"?t:r}function getLanguageTagSettingPlainKey(n){return n.replace(/[\[\]]/g,"")}const ILanguageService=createDecorator("languageService");class SyncDescriptor{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const _registry=[];function registerSingleton(n,e,t){e instanceof SyncDescriptor||(e=new SyncDescriptor(e,[],!!t)),_registry.push([n,e])}function getSingletonServiceDescriptors(){return _registry}const Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),Extensions$7={JSONContribution:"base.contributions.json"};function normalizeId(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class JSONContributionRegistry{constructor(){this._onDidChangeSchema=new Emitter$1,this.schemasById={}}registerSchema(e,t){this.schemasById[normalizeId(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const jsonContributionRegistry=new JSONContributionRegistry;Registry.add(Extensions$7.JSONContribution,jsonContributionRegistry);const Extensions$6={Configuration:"base.contributions.configuration"},resourceLanguageSettingsSchemaId="vscode://schemas/settings/resourceLanguage",contributionRegistry=Registry.as(Extensions$7.JSONContribution);class ConfigurationRegistry{constructor(){this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Emitter$1,this._onDidUpdateConfiguration=new Emitter$1,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:localize("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),contributionRegistry.registerSchema(resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:s,source:r}of e)for(const o in s){t.add(o);const a=this.configurationDefaultsOverrides.get(o)??this.configurationDefaultsOverrides.set(o,{configurationDefaultOverrides:[]}).get(o),l=s[o];if(a.configurationDefaultOverrides.push({value:l,source:r}),OVERRIDE_PROPERTY_REGEX.test(o)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,r),i.push(...overrideIdentifiersFromKey(o))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(o,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;const d=this.configurationProperties[o];d&&(this.updatePropertyDefaultValue(o,d),this.updateSchema(o,d))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const s={type:"object",default:t.value,description:localize("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",getLanguageTagSettingPlainKey(e)),$ref:resourceLanguageSettingsSchemaId,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=s,this.defaultLanguageConfigurationOverridesNode.properties[e]=s}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,s){const r=(s==null?void 0:s.value)||{},o=(s==null?void 0:s.source)??new Map;if(!(o instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const l=t[a];if(isObject(l)&&(isUndefined$1(r[a])||isObject(r[a]))){if(r[a]={...r[a]??{},...l},i)for(const d in l)o.set(`${a}.${d}`,i)}else r[a]=l,i?o.set(a,i):o.delete(a)}return{value:r,source:o}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,s){const r=this.configurationProperties[e],o=(s==null?void 0:s.value)??(r==null?void 0:r.defaultDefaultValue);let a=i;if(isObject(t)&&(r!==void 0&&r.type==="object"||r===void 0&&(isUndefined$1(o)||isObject(o)))){if(a=(s==null?void 0:s.source)??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in t)i&&a.set(`${e}.${c}`,i);t={...isObject(o)?o:{},...t}}return{value:t,source:a}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,t=!0,i,s,r=3,o){var c;r=isUndefinedOrNull(e.scope)?r:e.scope;const a=e.properties;if(a)for(const d in a){const u=a[d];if(t&&validateProperty(d,u)){delete a[d];continue}if(u.source=i,u.defaultDefaultValue=a[d].default,this.updatePropertyDefaultValue(d,u),OVERRIDE_PROPERTY_REGEX.test(d)?u.scope=void 0:(u.scope=isUndefinedOrNull(u.scope)?r:u.scope,u.restricted=isUndefinedOrNull(u.restricted)?!!(s!=null&&s.includes(d)):u.restricted),a[d].hasOwnProperty("included")&&!a[d].included){this.excludedConfigurationProperties[d]=a[d],delete a[d];continue}else this.configurationProperties[d]=a[d],(c=a[d].policy)!=null&&c.name&&this.policyConfigurations.set(a[d].policy.name,d);!a[d].deprecationMessage&&a[d].markdownDeprecationMessage&&(a[d].deprecationMessage=a[d].markdownDeprecationMessage),o.add(d)}const l=e.allOf;if(l)for(const d of l)this.validateAndRegisterProperties(d,t,i,s,r,o)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const o in s)this.updateSchema(o,s[o]);const r=i.allOf;r==null||r.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:localize("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:localize("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:resourceLanguageSettingsSchemaId};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){localize("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),localize("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){var o;const i=(o=this.configurationDefaultsOverrides.get(e))==null?void 0:o.configurationDefaultOverrideValue;let s,r;i&&(!t.disallowConfigurationDefault||!i.source)&&(s=i.value,r=i.source),isUndefined$1(s)&&(s=t.defaultDefaultValue,r=void 0),isUndefined$1(s)&&(s=getDefaultValue(t.type)),t.default=s,t.defaultValueSource=r}}const OVERRIDE_IDENTIFIER_PATTERN="\\[([^\\]]+)\\]",OVERRIDE_IDENTIFIER_REGEX=new RegExp(OVERRIDE_IDENTIFIER_PATTERN,"g"),OVERRIDE_PROPERTY_PATTERN=`^(${OVERRIDE_IDENTIFIER_PATTERN})+$`,OVERRIDE_PROPERTY_REGEX=new RegExp(OVERRIDE_PROPERTY_PATTERN);function overrideIdentifiersFromKey(n){const e=[];if(OVERRIDE_PROPERTY_REGEX.test(n)){let t=OVERRIDE_IDENTIFIER_REGEX.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=OVERRIDE_IDENTIFIER_REGEX.exec(n)}}return distinct(e)}function getDefaultValue(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const configurationRegistry$2=new ConfigurationRegistry;Registry.add(Extensions$6.Configuration,configurationRegistry$2);function validateProperty(n,e){var t,i,s,r;return n.trim()?OVERRIDE_PROPERTY_REGEX.test(n)?localize("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):configurationRegistry$2.getConfigurationProperties()[n]!==void 0?localize("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):(t=e.policy)!=null&&t.name&&configurationRegistry$2.getPolicyConfigurations().get((i=e.policy)==null?void 0:i.name)!==void 0?localize("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(s=e.policy)==null?void 0:s.name,configurationRegistry$2.getPolicyConfigurations().get((r=e.policy)==null?void 0:r.name)):null:localize("config.property.empty","Cannot register an empty property")}const Extensions$5={ModesRegistry:"editor.modesRegistry"};class EditorModesRegistry{constructor(){this._onDidChangeLanguages=new Emitter$1,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new OpeningBracketKind(this,a,l),closing:l}}),r=new CachedFunction(a=>{const l=new Set,c=new Set;return{info:new ClosingBracketKind(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=s.get(a),d=r.get(l);c.closing.add(d.info),d.opening.add(c.info)}const o=t.colorizedBracketPairs?filterValidBrackets(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of o){const c=s.get(a),d=r.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){const t=Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]);return createBracketOrRegExp(t,e)}}function filterValidBrackets(n){return n.filter(([e,t])=>e!==""&&t!=="")}class BracketKindBase{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class OpeningBracketKind extends BracketKindBase{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class ClosingBracketKind extends BracketKindBase{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var __decorate$2A=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2u=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class LanguageConfigurationServiceChangeEvent{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const ILanguageConfigurationService=createDecorator("languageConfigurationService");let LanguageConfigurationService=class extends Disposable{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new LanguageConfigurationRegistry),this.onDidChangeEmitter=this._register(new Emitter$1),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(customizedLanguageConfigKeys));this._register(this.configurationService.onDidChangeConfiguration(s=>{const r=s.change.keys.some(a=>i.has(a)),o=s.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(r)this.configurations.clear(),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(void 0));else for(const a of o)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new LanguageConfigurationServiceChangeEvent(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=computeConfig(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};LanguageConfigurationService=__decorate$2A([__param$2u(0,IConfigurationService),__param$2u(1,ILanguageService)],LanguageConfigurationService);function computeConfig(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new ResolvedLanguageConfiguration(n,{});s=new ResolvedLanguageConfiguration(n,{})}const r=getCustomizedLanguageConfig(s.languageId,t),o=combineLanguageConfigurations([s.underlyingConfig,r]);return new ResolvedLanguageConfiguration(s.languageId,o)}const customizedLanguageConfigKeys={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function getCustomizedLanguageConfig(n,e){const t=e.getValue(customizedLanguageConfigKeys.brackets,{overrideIdentifier:n}),i=e.getValue(customizedLanguageConfigKeys.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:validateBracketPairs(t),colorizedBracketPairs:validateBracketPairs(i)}}function validateBracketPairs(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function getIndentationAtPosition(n,e,t){const i=n.getLineContent(e);let s=getLeadingWhitespace(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}class ComposedLanguageConfiguration{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new LanguageConfigurationContribution(e,t,++this._order);return this._entries.push(i),this._resolved=null,toDisposable(()=>{for(let s=0;se.configuration)))}}function combineLanguageConfigurations(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class LanguageConfigurationContribution{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class LanguageConfigurationChangeEvent{constructor(e){this.languageId=e}}class LanguageConfigurationRegistry extends Disposable{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._register(this.register(PLAINTEXT_LANGUAGE_ID,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new ComposedLanguageConfiguration(e),this._entries.set(e,s));const r=s.register(t,i);return this._onDidChange.fire(new LanguageConfigurationChangeEvent(e)),toDisposable(()=>{r.dispose(),this._onDidChange.fire(new LanguageConfigurationChangeEvent(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class ResolvedLanguageConfiguration{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new OnEnterSupport(this.underlyingConfig):null,this.comments=ResolvedLanguageConfiguration._handleComments(this.underlyingConfig),this.characterPair=new CharacterPairSupport(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||DEFAULT_WORD_REGEXP,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new IndentRulesSupport(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new LanguageBracketsConfiguration(e,this.underlyingConfig)}getWordDefinition(){return ensureValidWordDefinition(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new RichEditBrackets(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new BracketElectricCharacterSupport(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new AutoClosingPairs(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,r]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=r}return i}}registerSingleton(ILanguageConfigurationService,LanguageConfigurationService,1);class DiffChange{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class StringDiffSequence{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class LcsDiff{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,r,o]=LcsDiff._getElements(e),[a,l,c]=LcsDiff._getElements(t);this._hasStrings=o&&c,this._originalStringElements=s,this._originalElementsOrHash=r,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(LcsDiff._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,r=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let u;return i<=s?(Debug.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new DiffChange(e,0,i,s-i+1)]):e<=t?(Debug.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new DiffChange(e,t-e+1,i,0)]):(Debug.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Debug.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const o=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,o,a,r),c=o[0],d=a[0];if(l!==null)return l;if(!r[0]){const u=this.ComputeDiffRecursive(e,c,i,d,r);let f=[];return r[0]?f=[new DiffChange(c+1,t-(c+1)+1,d+1,s-(d+1)+1)]:f=this.ComputeDiffRecursive(c+1,t,d+1,s,r),this.ConcatenateChanges(u,f)}return[new DiffChange(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,r,o,a,l,c,d,u,f,g,m,_,v,C,S){let w=null,L=null,I=new DiffChangeHelper,N=t,R=i,T=g[0]-v[0]-s,A=-1073741824,F=this.m_forwardHistory.length-1;do{const B=T+e;B===N||B=0&&(c=this.m_forwardHistory[F],e=c[0],N=1,R=c.length-1)}while(--F>=-1);if(w=I.getReverseChanges(),S[0]){let B=g[0]+1,W=v[0]+1;if(w!==null&&w.length>0){const G=w[w.length-1];B=Math.max(B,G.getOriginalEnd()),W=Math.max(W,G.getModifiedEnd())}L=[new DiffChange(B,f-B+1,W,_-W+1)]}else{I=new DiffChangeHelper,N=o,R=a,T=g[0]-v[0]-l,A=1073741824,F=C?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const B=T+r;B===N||B=d[B+1]?(u=d[B+1]-1,m=u-T-l,u>A&&I.MarkNextChange(),A=u+1,I.AddOriginalElement(u+1,m+1),T=B+1-r):(u=d[B-1],m=u-T-l,u>A&&I.MarkNextChange(),A=u,I.AddModifiedElement(u+1,m+1),T=B-1-r),F>=0&&(d=this.m_reverseHistory[F],r=d[0],N=1,R=d.length-1)}while(--F>=-1);L=I.getChanges()}return this.ConcatenateChanges(w,L)}ComputeRecursionPoint(e,t,i,s,r,o,a){let l=0,c=0,d=0,u=0,f=0,g=0;e--,i--,r[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=t-e+(s-i),_=m+1,v=new Int32Array(_),C=new Int32Array(_),S=s-i,w=t-e,L=e-i,I=t-s,R=(w-S)%2===0;v[S]=e,C[w]=t,a[0]=!1;for(let T=1;T<=m/2+1;T++){let A=0,F=0;d=this.ClipDiagonalBound(S-T,T,S,_),u=this.ClipDiagonalBound(S+T,T,S,_);for(let W=d;W<=u;W+=2){W===d||WA+F&&(A=l,F=c),!R&&Math.abs(W-w)<=T-1&&l>=C[W])return r[0]=l,o[0]=c,G<=C[W]&&1447>0&&T<=1447+1?this.WALKTRACE(S,d,u,L,w,f,g,I,v,C,l,t,r,c,s,o,R,a):null}const B=(A-e+(F-i)-T)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(A,B))return a[0]=!0,r[0]=A,o[0]=F,B>0&&1447>0&&T<=1447+1?this.WALKTRACE(S,d,u,L,w,f,g,I,v,C,l,t,r,c,s,o,R,a):(e++,i++,[new DiffChange(e,t-e+1,i,s-i+1)]);f=this.ClipDiagonalBound(w-T,T,w,_),g=this.ClipDiagonalBound(w+T,T,w,_);for(let W=f;W<=g;W+=2){W===f||W=C[W+1]?l=C[W+1]-1:l=C[W-1],c=l-(W-w)-I;const G=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(C[W]=l,R&&Math.abs(W-S)<=T&&l<=v[W])return r[0]=l,o[0]=c,G>=v[W]&&1447>0&&T<=1447+1?this.WALKTRACE(S,d,u,L,w,f,g,I,v,C,l,t,r,c,s,o,R,a):null}if(T<=1447){let W=new Int32Array(u-d+2);W[0]=S-d+1,MyArray.Copy2(v,d,W,1,u-d+1),this.m_forwardHistory.push(W),W=new Int32Array(g-f+2),W[0]=w-f+1,MyArray.Copy2(C,f,W,1,g-f+1),this.m_reverseHistory.push(W)}}return this.WALKTRACE(S,d,u,L,w,f,g,I,v,C,l,t,r,c,s,o,R,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,r=0;if(t>0){const u=e[t-1];s=u.originalStart+u.originalLength,r=u.modifiedStart+u.modifiedLength}const o=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const f=i.originalStart-u,g=i.modifiedStart-u;if(fc&&(c=_,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&g>l&&(l=g,c=u,d=f)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let r=0;r=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const r=this._OriginalRegionIsBoundary(e,t)?1:0,o=this._ModifiedRegionIsBoundary(i,s)?1:0;return r+o}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return MyArray.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],MyArray.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return MyArray.Copy(e,0,s,0,e.length),MyArray.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(Debug.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Debug.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let r=e.originalLength;const o=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(r=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new DiffChange(s,r,o,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function toUint32(n){return n<0?0:n>4294967295?4294967295:n|0}class CharacterClassifier{constructor(e){const t=toUint8(e);this._defaultValue=t,this._asciiMap=CharacterClassifier._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=toUint8(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class CharacterSet{constructor(){this._actual=new CharacterClassifier(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class Uint8Matrix{constructor(e,t,i){const s=new Uint8Array(e*t);for(let r=0,o=e*t;rt&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new Uint8Matrix(i,t,0);for(let r=0,o=e.length;r=this._maxCharCode?0:this._states.get(e,t)}}let _stateMachine=null;function getStateMachine(){return _stateMachine===null&&(_stateMachine=new StateMachine([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),_stateMachine}let _classifier=null;function getClassifier(){if(_classifier===null){_classifier=new CharacterClassifier(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(o);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&o--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:o+2},url:t.substring(s,o+1)}}static computeLinks(e,t=getStateMachine()){const i=getClassifier(),s=[];for(let r=1,o=e.getLineCount();r<=o;r++){const a=e.getLineContent(r),l=a.length;let c=0,d=0,u=0,f=1,g=!1,m=!1,_=!1,v=!1;for(;c=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}};Rh.INSTANCE=new Rh;let BasicInplaceReplace=Rh;const Fd=class Fd{static getChannel(e){return e.getChannel(Fd.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(Fd.CHANNEL_NAME,t)}};Fd.CHANNEL_NAME="editorWorkerHost";let EditorWorkerHost=Fd;var _a$2,_b$1;class ResourceMapEntry{constructor(e,t){this.uri=e,this.value=t}}function isEntries(n){return Array.isArray(n)}const ia=class ia{constructor(e,t){if(this[_a$2]="ResourceMap",e instanceof ia)this.map=new Map(e.map),this.toKey=t??ia.defaultToKey;else if(isEntries(e)){this.map=new Map,this.toKey=t??ia.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e??ia.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new ResourceMapEntry(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))==null?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(_a$2=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}};ia.defaultToKey=e=>e.toString();let ResourceMap=ia;class LinkedMap{constructor(){this[_b$1]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)==null?void 0:e.value}get last(){var e;return(e=this._tail)==null?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.key,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.value,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:[i.key,i.value],done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}[(_b$1=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class Cache extends LinkedMap{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class LRUCache extends Cache{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class BidirectionalMap{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class SetMap{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class WordCharacterClassifier extends CharacterClassifier{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,s=e.length;it)break;i=s}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index=0;let t=null;try{t=createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new SearchData(t,this.wordSeparators?getMapForWordSeparators(this.wordSeparators,[]):null,i?this.searchString:null)}}function isMultilineRegexSource(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function createFindMatch(n,e,t){if(!t)return new FindMatch(n,null);const i=[];for(let s=0,r=e.length;s>0);t[r]>=e?s=r-1:t[r+1]>=e?(i=r,s=r):i=r+1}return i+1}}class TextModelSearch{static findMatches(e,t,i,s,r){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new Searcher(o.wordSeparators,o.regex),s,r):this._doFindMatchesLineByLine(e,i,o,s,r):[]}static _getMultilineMatchRange(e,t,i,s,r,o){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(r),a=t+r+l):a=t+r;let c;if(s){const g=s.findLineFeedCountBeforeOffset(r+o.length)-l;c=a+o.length+g}else c=a+o.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new Range$2(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,s,r){const o=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new LineFeedCounter(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=createFindMatch(this._getMultilineMatchRange(e,o,a,l,u.index,u[0]),u,s),d>=r)return c;return c}static _doFindMatchesLineByLine(e,t,i,s,r){const o=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,o,s,r),o}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,o,s,r);for(let c=t.startLineNumber+1;c=l))return r;return r}const d=new Searcher(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(o[r++]=createFindMatch(new Range$2(i,u.index+1+s,i,u.index+1+u[0].length+s),u,a),r>=l))return r;while(u);return r}static findNextMatch(e,t,i,s){const r=t.parseSearchRequest();if(!r)return null;const o=new Searcher(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindNextMatchMultiline(e,i,o,s):this._doFindNextMatchLineByLine(e,i,o,s)}static _doFindNextMatchMultiline(e,t,i,s){const r=new Position$1(t.lineNumber,1),o=e.getOffsetAt(r),a=e.getLineCount(),l=e.getValueInRange(new Range$2(r.lineNumber,r.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new LineFeedCounter(l):null;i.reset(t.column-1);const d=i.next(l);return d?createFindMatch(this._getMultilineMatchRange(e,o,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new Position$1(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o),l=this._findFirstMatchInLine(i,a,o,t.column,s);if(l)return l;for(let c=1;c<=r;c++){const d=(o+c-1)%r,u=e.getLineContent(d+1),f=this._findFirstMatchInLine(i,u,d+1,1,s);if(f)return f}return null}static _findFirstMatchInLine(e,t,i,s,r){e.reset(s-1);const o=e.next(t);return o?createFindMatch(new Range$2(i,o.index+1,i,o.index+1+o[0].length),o,r):null}static findPreviousMatch(e,t,i,s){const r=t.parseSearchRequest();if(!r)return null;const o=new Searcher(r.wordSeparators,r.regex);return r.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,s):this._doFindPreviousMatchLineByLine(e,i,o,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const r=this._doFindMatchesMultiline(e,new Range$2(1,1,t.lineNumber,t.column),i,s,10*LIMIT_FIND_COUNT$1);if(r.length>0)return r[r.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new Position$1(o,e.getLineMaxColumn(o)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const r=e.getLineCount(),o=t.lineNumber,a=e.getLineContent(o).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,o,s);if(l)return l;for(let c=1;c<=r;c++){const d=(r+o-c-1)%r,u=e.getLineContent(d+1),f=this._findLastMatchInLine(i,u,d+1,s);if(f)return f}return null}static _findLastMatchInLine(e,t,i,s){let r=null,o;for(e.reset(0);o=e.next(t);)r=createFindMatch(new Range$2(i,o.index+1,i,o.index+1+o[0].length),o,s);return r}}function leftIsWordBounday(n,e,t,i,s){if(i===0)return!0;const r=e.charCodeAt(i-1);if(n.get(r)!==0||r===13||r===10)return!0;if(s>0){const o=e.charCodeAt(i);if(n.get(o)!==0)return!0}return!1}function rightIsWordBounday(n,e,t,i,s){if(i+s===t)return!0;const r=e.charCodeAt(i+s);if(n.get(r)!==0||r===13||r===10)return!0;if(s>0){const o=e.charCodeAt(i+s-1);if(n.get(o)!==0)return!0}return!1}function isValidMatch(n,e,t,i,s){return leftIsWordBounday(n,e,t,i,s)&&rightIsWordBounday(n,e,t,i,s)}class Searcher{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,r=i[0].length;if(s===this._prevMatchStartIndex&&r===this._prevMatchLength){if(r===0){getNextCodePoint(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=r,!this._wordSeparators||isValidMatch(this._wordSeparators,e,t,s,r))return i}while(i);return null}}class UnicodeTextModelHighlighter{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,r=i?i.endLineNumber:e.getLineCount(),o=new CodePointHighlighter(t),a=o.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${buildRegExpCharClassExpr(Array.from(a))}`,"g");const c=new Searcher(null,l),d=[];let u=!1,f,g=0,m=0,_=0;e:for(let v=s,C=r;v<=C;v++){const S=e.getLineContent(v),w=S.length;c.reset(0);do if(f=c.next(S),f){let L=f.index,I=f.index+f[0].length;if(L>0){const A=S.charCodeAt(L-1);isHighSurrogate(A)&&L--}if(I+1=A){u=!0;break e}d.push(new Range$2(v,L+1,v,I+1))}}while(f)}return{ranges:d,hasMore:u,ambiguousCharacterCount:g,invisibleCharacterCount:m,nonBasicAsciiCharacterCount:_}}static computeUnicodeHighlightReason(e,t){const i=new CodePointHighlighter(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const r=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(r),a=AmbiguousCharacters.getLocales().filter(l=>!AmbiguousCharacters.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(r));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function buildRegExpCharClassExpr(n,e){return`[${escapeRegExpCharacters(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class CodePointHighlighter{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=AmbiguousCharacters.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of InvisibleCharacters.codePoints)isAllowedInvisibleCharacter(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,r=!1;if(t)for(const o of t){const a=o.codePointAt(0),l=isBasicASCII(o);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!InvisibleCharacters.isInvisibleCharacter(a)&&(r=!0)}return!s&&r?0:this.options.invisibleCharacters&&!isAllowedInvisibleCharacter(e)&&InvisibleCharacters.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function isAllowedInvisibleCharacter(n){return n===" "||n===` +`||n===" "}class LinesDiff{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class MovedText{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class OffsetRange{static addRange(e,t){let i=0;for(;it))return new OffsetRange(e,t)}static ofLength(e){return new OffsetRange(0,e)}static ofStartAndLength(e,t){return new OffsetRange(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new OffsetRange(this.start+e,this.endExclusive+e)}deltaStart(e){return new OffsetRange(this.start+e,this.endExclusive)}deltaEnd(e){return new OffsetRange(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function findLast(n,e){const t=findLastIdx(n,e);if(t!==-1)return n[t]}function findLastIdx(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function findLastMonotonous(n,e){const t=findLastIdxMonotonous(n,e);return t===-1?void 0:n[t]}function findLastIdxMonotonous(n,e,t=0,i=n.length){let s=t,r=i;for(;s0&&(t=s)}return t}function findLastMax(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function findFirstMin(n,e){return findFirstMax(n,(t,i)=>-e(t,i))}function findMaxIdx(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}function mapFindFirst(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let LineRange$1=class dr{static fromRangeInclusive(e){return new dr(e.startLineNumber,e.endLineNumber+1)}static joinMany(e){if(e.length===0)return[];let t=new LineRangeSet(e[0].slice());for(let i=1;it)throw new BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=findLastIdxMonotonous(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=findLastMonotonous(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=findLastMonotonous(this._normalizedRanges,i=>i.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,r=null;for(;i=o.startLineNumber?r=new LineRange$1(r.startLineNumber,Math.max(r.endLineNumberExclusive,o.endLineNumberExclusive)):(t.push(r),r=o)}return r!==null&&t.push(r),new LineRangeSet(t)}subtractFrom(e){const t=findFirstIdxMonotonousOrArrLen(this._normalizedRanges,o=>o.endLineNumberExclusive>=e.startLineNumber),i=findLastIdxMonotonous(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new LineRangeSet([e]);const s=[];let r=e.startLineNumber;for(let o=t;or&&s.push(new LineRange$1(r,a.startLineNumber)),r=a.endLineNumberExclusive}return re.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}const so=class so{static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new so(0,t.column-e.column):new so(t.lineNumber-e.lineNumber,t.column-1)}static ofRange(e){return so.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(const s of e)s===` +`?(t++,i=0):i++;return new so(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new Range$2(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Range$2(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new Position$1(e.lineNumber,e.column+this.columnCount):new Position$1(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};so.zero=new so(0,0);let TextLength=so;class PositionOffsetTransformer{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;tcheckAdjacentItems(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new Position$1(1,1);for(const r of this.edits){const o=r.range,a=o.getStartPosition(),l=o.getEndPosition(),c=rangeFromPositions(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=r.text,i=l}const s=rangeFromPositions(i,e.endPositionExclusive);return s.isEmpty()||(t+=e.getValueOfRange(s)),t}applyToString(e){const t=new StringText(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,s=0;for(const r of this.edits){const o=TextLength.ofText(r.text),a=Position$1.lift({lineNumber:r.range.startLineNumber+i,column:r.range.startColumn+(r.range.startLineNumber===t?s:0)}),l=o.createRange(a);e.push(l),i=l.endLineNumber-r.range.endLineNumber,s=l.endColumn-r.range.endColumn,t=r.range.endLineNumber}return e}}class SingleTextEdit{constructor(e,t){this.range=e,this.text=t}toSingleEditOperation(){return{range:this.range,text:this.text}}}function rangeFromPositions(n,e){if(n.lineNumber===e.lineNumber&&n.column===Number.MAX_SAFE_INTEGER)return Range$2.fromPositions(e,e);if(!n.isBeforeOrEqual(e))throw new BugIndicatingError("start must be before end");return new Range$2(n.lineNumber,n.column,e.lineNumber,e.column)}class AbstractText{get endPositionExclusive(){return this.length.addToPosition(new Position$1(1,1))}}class StringText extends AbstractText{constructor(e){super(),this.value=e,this._t=new PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class LineRangeMapping{static inverse(e,t,i){const s=[];let r=1,o=1;for(const l of e){const c=new LineRangeMapping(new LineRange$1(r,l.original.startLineNumber),new LineRange$1(o,l.modified.startLineNumber));c.modified.isEmpty||s.push(c),r=l.original.endLineNumberExclusive,o=l.modified.endLineNumberExclusive}const a=new LineRangeMapping(new LineRange$1(r,t+1),new LineRange$1(o,i+1));return a.modified.isEmpty||s.push(a),s}static clip(e,t,i){const s=[];for(const r of e){const o=r.original.intersect(t),a=r.modified.intersect(i);o&&!o.isEmpty&&a&&!a.isEmpty&&s.push(new LineRangeMapping(o,a))}return s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new LineRangeMapping(this.modified,this.original)}join(e){return new LineRangeMapping(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new RangeMapping(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new BugIndicatingError("not a valid diff");return new RangeMapping(new Range$2(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Range$2(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new RangeMapping(new Range$2(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Range$2(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(isValidLineNumber(this.original.endLineNumberExclusive,e)&&isValidLineNumber(this.modified.endLineNumberExclusive,t))return new RangeMapping(new Range$2(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Range$2(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new RangeMapping(Range$2.fromPositions(new Position$1(this.original.startLineNumber,1),normalizePosition(new Position$1(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Range$2.fromPositions(new Position$1(this.modified.startLineNumber,1),normalizePosition(new Position$1(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new RangeMapping(Range$2.fromPositions(normalizePosition(new Position$1(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),normalizePosition(new Position$1(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Range$2.fromPositions(normalizePosition(new Position$1(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),normalizePosition(new Position$1(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new BugIndicatingError}}function normalizePosition(n,e){if(n.lineNumber<1)return new Position$1(1,1);if(n.lineNumber>e.length)return new Position$1(e.length,e[e.length-1].length+1);const t=e[n.lineNumber-1];return n.column>t.length+1?new Position$1(n.lineNumber,t.length+1):n}function isValidLineNumber(n,e){return n>=1&&n<=e.length}class DetailedLineRangeMapping extends LineRangeMapping{static fromRangeMappings(e){const t=LineRange$1.join(e.map(s=>LineRange$1.fromRangeInclusive(s.originalRange))),i=LineRange$1.join(e.map(s=>LineRange$1.fromRangeInclusive(s.modifiedRange)));return new DetailedLineRangeMapping(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new DetailedLineRangeMapping(this.modified,this.original,(e=this.innerChanges)==null?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new DetailedLineRangeMapping(this.original,this.modified,[this.toRangeMapping()])}}class RangeMapping{static assertSorted(e){for(let t=1;t${this.modifiedRange.toString()}}`}flip(){return new RangeMapping(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new SingleTextEdit(this.originalRange,t)}}const MINIMUM_MATCHING_CHARACTER_LENGTH=3;class LegacyLinesDiffComputer{computeDiff(e,t,i){var l;const r=new DiffComputer(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let a=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new LineRange$1(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new LineRange$1(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new LineRange$1(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new LineRange$1(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let f=new DetailedLineRangeMapping(d,u,(l=c.charChanges)==null?void 0:l.map(g=>new RangeMapping(new Range$2(g.originalStartLineNumber,g.originalStartColumn,g.originalEndLineNumber,g.originalEndColumn),new Range$2(g.modifiedStartLineNumber,g.modifiedStartColumn,g.modifiedEndLineNumber,g.modifiedEndColumn))));a&&(a.modified.endLineNumberExclusive===f.modified.startLineNumber||a.original.endLineNumberExclusive===f.original.startLineNumber)&&(f=new DetailedLineRangeMapping(a.original.join(f.original),a.modified.join(f.modified),a.innerChanges&&f.innerChanges?a.innerChanges.concat(f.innerChanges):void 0),o.pop()),o.push(f),a=f}return assertFn(()=>checkAdjacentItems(o,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class CharChange{constructor(e,t,i,s,r,o,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=r,this.modifiedStartColumn=o,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),r=t.getStartColumn(e.originalStart),o=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new CharChange(s,r,o,a,l,c,d,u)}}function postProcessCharChanges(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&r()){const g=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),m=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(g.getElements().length>0&&m.getElements().length>0){let _=computeDiff(g,m,r,!0).changes;a&&(_=postProcessCharChanges(_)),f=[];for(let v=0,C=_.length;v1&&_>1;){const v=f.charCodeAt(m-2),C=g.charCodeAt(_-2);if(v!==C)break;m--,_--}(m>1||_>1)&&this._pushTrimWhitespaceCharChange(s,r+1,1,m,o+1,1,_)}{let m=getLastNonBlankColumn(f,1),_=getLastNonBlankColumn(g,1);const v=f.length+1,C=g.length+1;for(;m!0;const e=Date.now();return()=>Date.now()-e{i.push(SequenceDiff.fromOffsetPairs(s?s.getEndExclusives():OffsetPair.zero,r?r.getStarts():new OffsetPair(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new SequenceDiff(new OffsetRange(e.offset1,t.offset1),new OffsetRange(e.offset2,t.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new BugIndicatingError("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new SequenceDiff(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new SequenceDiff(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new SequenceDiff(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new SequenceDiff(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new SequenceDiff(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new SequenceDiff(t,i)}getStarts(){return new OffsetPair(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new OffsetPair(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const na=class na{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new na(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};na.zero=new na(0,0),na.max=new na(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let OffsetPair=na;const Mh=class Mh{isValid(){return!0}};Mh.instance=new Mh;let InfiniteTimeout=Mh;class DateTimeout{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new BugIndicatingError("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&_>0&&o.get(m-1,_-1)===3&&(S+=a.get(m-1,_-1)),S+=s?s(m,_):1):S=-1;const w=Math.max(v,C,S);if(w===S){const L=m>0&&_>0?a.get(m-1,_-1):0;a.set(m,_,L+1),o.set(m,_,3)}else w===v?(a.set(m,_,0),o.set(m,_,1)):w===C&&(a.set(m,_,0),o.set(m,_,2));r.set(m,_,w)}const l=[];let c=e.length,d=t.length;function u(m,_){(m+1!==c||_+1!==d)&&l.push(new SequenceDiff(new OffsetRange(m+1,c),new OffsetRange(_+1,d))),c=m,d=_}let f=e.length-1,g=t.length-1;for(;f>=0&&g>=0;)o.get(f,g)===3?(u(f,g),f--,g--):o.get(f,g)===1?f--:g--;return u(-1,-1),l.reverse(),new DiffAlgorithmResult(l,!1)}}class MyersDiffAlgorithm{compute(e,t,i=InfiniteTimeout.instance){if(e.length===0||t.length===0)return DiffAlgorithmResult.trivial(e,t);const s=e,r=t;function o(_,v){for(;_s.length||L>r.length)continue;const I=o(w,L);l.set(d,I);const N=w===C?c.get(d+1):c.get(d-1);if(c.set(d,I!==w?new SnakePath(N,w,L,I-w):N),l.get(d)===s.length&&l.get(d)-d===r.length)break e}}let u=c.get(d);const f=[];let g=s.length,m=r.length;for(;;){const _=u?u.x+u.length:0,v=u?u.y+u.length:0;if((_!==g||v!==m)&&f.push(new SequenceDiff(new OffsetRange(_,g),new OffsetRange(v,m))),!u)break;g=u.x,m=u.y,u=u.prev}return f.reverse(),new DiffAlgorithmResult(f,!1)}}class SnakePath{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class FastInt32Array{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class FastArrayNegativeIndices{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class LinesSliceCharSequence{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let s=this.range.startLineNumber;s<=this.range.endLineNumber;s++){let r=e[s-1],o=0;s===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,r=r.substring(o)),this.lineStartOffsets.push(o);let a=0;if(!i){const c=r.trimStart();a=r.length-c.length,r=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=s===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-a,r.length):r.length;for(let c=0;cString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=getCategory(e>0?this.elements[e-1]:-1),i=getCategory(er<=e),s=e-this.firstElementOffsetByLineIdx[i];return new Position$1(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+s+(s===0&&t==="left"?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?Range$2.fromPositions(i,i):Range$2.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!isWordChar(this.elements[e]))return;let t=e;for(;t>0&&isWordChar(this.elements[t-1]);)t--;let i=e;for(;is<=e.start)??0,i=findFirstMonotonous(this.firstElementOffsetByLineIdx,s=>e.endExclusive<=s)??this.elements.length;return new OffsetRange(t,i)}}function isWordChar(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const score$1={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function getCategoryBoundaryScore(n){return score$1[n]}function getCategory(n){return n===10?8:n===13?7:isSpace(n)?6:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:n===44||n===59?5:4}function computeMovedLines(n,e,t,i,s,r){let{moves:o,excludedChanges:a}=computeMovesFromSimpleDeletionsToSimpleInsertions(n,e,t,r);if(!r.isValid())return[];const l=n.filter(d=>!a.has(d)),c=computeUnchangedMoves(l,i,s,e,t,r);return pushMany(o,c),o=joinCloseConsecutiveMoves(o),o=o.filter(d=>{const u=d.original.toOffsetRange().slice(e).map(g=>g.trim());return u.join(` +`).length>=15&&countWhere(u,g=>g.length>=2)>=2}),o=removeMovesInSameDiff(n,o),o}function countWhere(n,e){let t=0;for(const i of n)e(i)&&t++;return t}function computeMovesFromSimpleDeletionsToSimpleInsertions(n,e,t,i){const s=[],r=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new LineRangeFragment(l.original,e,l)),o=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new LineRangeFragment(l.modified,t,l))),a=new Set;for(const l of r){let c=-1,d;for(const u of o){const f=l.computeSimilarity(u);f>c&&(c=f,d=u)}if(c>.9&&d&&(o.delete(d),s.push(new LineRangeMapping(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function computeUnchangedMoves(n,e,t,i,s,r){const o=[],a=new SetMap;for(const f of n)for(let g=f.original.startLineNumber;gf.modified.startLineNumber,numberComparator));for(const f of n){let g=[];for(let m=f.modified.startLineNumber;m{for(const L of g)if(L.originalLineRange.endLineNumberExclusive+1===S.endLineNumberExclusive&&L.modifiedLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive){L.originalLineRange=new LineRange$1(L.originalLineRange.startLineNumber,S.endLineNumberExclusive),L.modifiedLineRange=new LineRange$1(L.modifiedLineRange.startLineNumber,v.endLineNumberExclusive),C.push(L);return}const w={modifiedLineRange:v,originalLineRange:S};l.push(w),C.push(w)}),g=C}if(!r.isValid())return[]}l.sort(reverseOrder(compareBy(f=>f.modifiedLineRange.length,numberComparator)));const c=new LineRangeSet,d=new LineRangeSet;for(const f of l){const g=f.modifiedLineRange.startLineNumber-f.originalLineRange.startLineNumber,m=c.subtractFrom(f.modifiedLineRange),_=d.subtractFrom(f.originalLineRange).getWithDelta(g),v=m.getIntersection(_);for(const C of v.ranges){if(C.length<3)continue;const S=C,w=C.delta(-g);o.push(new LineRangeMapping(w,S)),c.addRange(S),d.addRange(w)}}o.sort(compareBy(f=>f.original.startLineNumber,numberComparator));const u=new MonotonousArray(n);for(let f=0;fN.original.startLineNumber<=g.original.startLineNumber),_=findLastMonotonous(n,N=>N.modified.startLineNumber<=g.modified.startLineNumber),v=Math.max(g.original.startLineNumber-m.original.startLineNumber,g.modified.startLineNumber-_.modified.startLineNumber),C=u.findLastMonotonous(N=>N.original.startLineNumberN.modified.startLineNumberi.length||R>s.length||c.contains(R)||d.contains(N)||!areLinesSimilar(i[N-1],s[R-1],r))break}L>0&&(d.addRange(new LineRange$1(g.original.startLineNumber-L,g.original.startLineNumber)),c.addRange(new LineRange$1(g.modified.startLineNumber-L,g.modified.startLineNumber)));let I;for(I=0;Ii.length||R>s.length||c.contains(R)||d.contains(N)||!areLinesSimilar(i[N-1],s[R-1],r))break}I>0&&(d.addRange(new LineRange$1(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+I)),c.addRange(new LineRange$1(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+I))),(L>0||I>0)&&(o[f]=new LineRangeMapping(new LineRange$1(g.original.startLineNumber-L,g.original.endLineNumberExclusive+I),new LineRange$1(g.modified.startLineNumber-L,g.modified.endLineNumberExclusive+I)))}return o}function areLinesSimilar(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new MyersDiffAlgorithm().compute(new LinesSliceCharSequence([n],new Range$2(1,1,1,n.length),!1),new LinesSliceCharSequence([e],new Range$2(1,1,1,e.length),!1),t);let r=0;const o=SequenceDiff.invert(s.diffs,n.length);for(const d of o)d.seq1Range.forEach(u=>{isSpace(n.charCodeAt(u))||r++});function a(d){let u=0;for(let f=0;fe.length?n:e);return r/l>.6&&l>10}function joinCloseConsecutiveMoves(n){if(n.length===0)return n;n.sort(compareBy(t=>t.original.startLineNumber,numberComparator));const e=[n[0]];for(let t=1;t=0&&o>=0&&r+o<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function removeMovesInSameDiff(n,e){const t=new MonotonousArray(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.startLineNumbera.modified.startLineNumber0&&(a=a.delta(c))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function shiftSequenceDiffs(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,r=t[i],o=i+1=i.start&&n.seq2Range.start-o>=s.start&&t.isStronglyEqual(n.seq2Range.start-o,n.seq2Range.endExclusive-o)&&o<100;)o++;o--;let a=0;for(;n.seq1Range.start+ac&&(c=m,l=d)}return n.delta(l)}function removeShortMatches(n,e,t){const i=[];for(const s of t){const r=i[i.length-1];if(!r){i.push(s);continue}s.seq1Range.start-r.seq1Range.endExclusive<=2||s.seq2Range.start-r.seq2Range.endExclusive<=2?i[i.length-1]=new SequenceDiff(r.seq1Range.join(s.seq1Range),r.seq2Range.join(s.seq2Range)):i.push(s)}return i}function extendDiffsToEntireWordIfAppropriate(n,e,t){const i=SequenceDiff.invert(t,n.length),s=[];let r=new OffsetPair(0,0);function o(l,c){if(l.offset10;){const v=i[0];if(!(v.seq1Range.intersects(f.seq1Range)||v.seq2Range.intersects(f.seq2Range)))break;const S=n.findWordContaining(v.seq1Range.start),w=e.findWordContaining(v.seq2Range.start),L=new SequenceDiff(S,w),I=L.intersect(v);if(m+=I.seq1Range.length,_+=I.seq2Range.length,f=f.join(L),f.seq1Range.endExclusive>=v.seq1Range.endExclusive)i.shift();else break}m+_<(f.seq1Range.length+f.seq2Range.length)*2/3&&s.push(f),r=f.getEndExclusives()}for(;i.length>0;){const l=i.shift();l.seq1Range.isEmpty||(o(l.getStarts(),l),o(l.getEndExclusives().delta(-1),l))}return mergeSequenceDiffs(t,s)}function mergeSequenceDiffs(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],s=e[0];let r;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=r.seq1Range.start?t[t.length-1]=t[t.length-1].join(r):t.push(r)}return t}function removeVeryShortMatchingLinesBetweenDiffs(n,e,t){let i=t;if(i.length===0)return i;let s=0,r;do{r=!1;const o=[i[0]];for(let a=1;a5||g.seq1Range.length+g.seq2Range.length>5)};const l=i[a],c=o[o.length-1];d(c,l)?(r=!0,o[o.length-1]=o[o.length-1].join(l)):o.push(l)}i=o}while(s++<10&&r);return i}function removeVeryShortMatchingTextBetweenLongDiffs(n,e,t){let i=t;if(i.length===0)return i;let s=0,r;do{r=!1;const a=[i[0]];for(let l=1;l5||_.length>500)return!1;const C=n.getText(_).trim();if(C.length>20||C.split(/\r\n|\r|\n/).length>1)return!1;const S=n.countLinesIn(g.seq1Range),w=g.seq1Range.length,L=e.countLinesIn(g.seq2Range),I=g.seq2Range.length,N=n.countLinesIn(m.seq1Range),R=m.seq1Range.length,T=e.countLinesIn(m.seq2Range),A=m.seq2Range.length,F=2*40+50;function B(W){return Math.min(W,F)}return Math.pow(Math.pow(B(S*40+w),1.5)+Math.pow(B(L*40+I),1.5),1.5)+Math.pow(Math.pow(B(N*40+R),1.5)+Math.pow(B(T*40+A),1.5),1.5)>(F**1.5)**1.5*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(r=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(s++<10&&r);const o=[];return forEachWithNeighbors(i,(a,l,c)=>{let d=l;function u(C){return C.length>0&&C.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const f=n.extendToFullLines(l.seq1Range),g=n.getText(new OffsetRange(f.start,l.seq1Range.start));u(g)&&(d=d.deltaStart(-g.length));const m=n.getText(new OffsetRange(l.seq1Range.endExclusive,f.endExclusive));u(m)&&(d=d.deltaEnd(m.length));const _=SequenceDiff.fromOffsetPairs(a?a.getEndExclusives():OffsetPair.zero,c?c.getStarts():OffsetPair.max),v=d.intersect(_);o.length>0&&v.getStarts().equals(o[o.length-1].getEndExclusives())?o[o.length-1]=o[o.length-1].join(v):o.push(v)}),o}class LineSequence{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:getIndentation(this.lines[e-1]),i=e===this.lines.length?0:getIndentation(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function getIndentation(n){let e=0;for(;eI===N))return new LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new LinesDiff([new DetailedLineRangeMapping(new LineRange$1(1,e.length+1),new LineRange$1(1,t.length+1),[new RangeMapping(new Range$2(1,1,e.length,e[e.length-1].length+1),new Range$2(1,1,t.length,t[t.length-1].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?InfiniteTimeout.instance:new DateTimeout(i.maxComputationTimeMs),r=!i.ignoreTrimWhitespace,o=new Map;function a(I){let N=o.get(I);return N===void 0&&(N=o.size,o.set(I,N)),N}const l=e.map(I=>a(I.trim())),c=t.map(I=>a(I.trim())),d=new LineSequence(l,e),u=new LineSequence(c,t),f=(()=>d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(I,N)=>e[I]===t[N]?t[N].length===0?.1:1+Math.log(1+t[N].length):.99):this.myersDiffingAlgorithm.compute(d,u,s))();let g=f.diffs,m=f.hitTimeout;g=optimizeSequenceDiffs(d,u,g),g=removeVeryShortMatchingLinesBetweenDiffs(d,u,g);const _=[],v=I=>{if(r)for(let N=0;NI.seq1Range.start-C===I.seq2Range.start-S);const N=I.seq1Range.start-C;v(N),C=I.seq1Range.endExclusive,S=I.seq2Range.endExclusive;const R=this.refineDiff(e,t,I,s,r);R.hitTimeout&&(m=!0);for(const T of R.mappings)_.push(T)}v(e.length-C);const w=lineRangeMappingFromRangeMappings(_,e,t);let L=[];return i.computeMoves&&(L=this.computeMoves(w,e,t,l,c,s,r)),assertFn(()=>{function I(R,T){if(R.lineNumber<1||R.lineNumber>T.length)return!1;const A=T[R.lineNumber-1];return!(R.column<1||R.column>A.length+1)}function N(R,T){return!(R.startLineNumber<1||R.startLineNumber>T.length+1||R.endLineNumberExclusive<1||R.endLineNumberExclusive>T.length+1)}for(const R of w){if(!R.innerChanges)return!1;for(const T of R.innerChanges)if(!(I(T.modifiedRange.getStartPosition(),t)&&I(T.modifiedRange.getEndPosition(),t)&&I(T.originalRange.getStartPosition(),e)&&I(T.originalRange.getEndPosition(),e)))return!1;if(!N(R.modified,t)||!N(R.original,e))return!1}return!0}),new LinesDiff(w,L,m)}computeMoves(e,t,i,s,r,o,a){return computeMovedLines(e,t,i,s,r,o).map(d=>{const u=this.refineDiff(t,i,new SequenceDiff(d.original.toOffsetRange(),d.modified.toOffsetRange()),o,a),f=lineRangeMappingFromRangeMappings(u.mappings,t,i,!0);return new MovedText(d,f)})}refineDiff(e,t,i,s,r){const a=toLineRangeMapping(i).toRangeMapping2(e,t),l=new LinesSliceCharSequence(e,a.originalRange,r),c=new LinesSliceCharSequence(t,a.modifiedRange,r),d=l.length+c.length<500?this.dynamicProgrammingDiffing.compute(l,c,s):this.myersDiffingAlgorithm.compute(l,c,s);let u=d.diffs;return u=optimizeSequenceDiffs(l,c,u),u=extendDiffsToEntireWordIfAppropriate(l,c,u),u=removeShortMatches(l,c,u),u=removeVeryShortMatchingTextBetweenLongDiffs(l,c,u),{mappings:u.map(g=>new RangeMapping(l.translateRange(g.seq1Range),c.translateRange(g.seq2Range))),hitTimeout:d.hitTimeout}}}function lineRangeMappingFromRangeMappings(n,e,t,i=!1){const s=[];for(const r of groupAdjacentBy(n.map(o=>getLineRangeMapping(o,e,t)),(o,a)=>o.original.overlapOrTouch(a.original)||o.modified.overlapOrTouch(a.modified))){const o=r[0],a=r[r.length-1];s.push(new DetailedLineRangeMapping(o.original.join(a.original),o.modified.join(a.modified),r.map(l=>l.innerChanges[0])))}return assertFn(()=>!i&&s.length>0&&(s[0].modified.startLineNumber!==s[0].original.startLineNumber||t.length-s[s.length-1].modified.endLineNumberExclusive!==e.length-s[s.length-1].original.endLineNumberExclusive)?!1:checkAdjacentItems(s,(r,o)=>o.original.startLineNumber-r.original.endLineNumberExclusive===o.modified.startLineNumber-r.modified.endLineNumberExclusive&&r.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const r=new LineRange$1(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),o=new LineRange$1(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new DetailedLineRangeMapping(r,o,[n])}function toLineRangeMapping(n){return new LineRangeMapping(new LineRange$1(n.seq1Range.start+1,n.seq1Range.endExclusive+1),new LineRange$1(n.seq2Range.start+1,n.seq2Range.endExclusive+1))}const linesDiffComputers={getLegacy:()=>new LegacyLinesDiffComputer,getDefault:()=>new DefaultLinesDiffComputer};function roundFloat(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class RGBA{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=roundFloat(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class HSLA{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=roundFloat(Math.max(Math.min(1,t),0),3),this.l=roundFloat(Math.max(Math.min(1,i),0),3),this.a=roundFloat(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,r=e.a,o=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,c=0;const d=(a+o)/2,u=o-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),o){case t:l=(i-s)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:r}=e;let o,a,l;if(i===0)o=a=l=s;else{const c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;o=HSLA._hue2rgb(d,c,t+1/3),a=HSLA._hue2rgb(d,c,t),l=HSLA._hue2rgb(d,c,t-1/3)}return new RGBA(Math.round(o*255),Math.round(a*255),Math.round(l*255),r)}}class HSVA{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=roundFloat(Math.max(Math.min(1,t),0),3),this.v=roundFloat(Math.max(Math.min(1,i),0),3),this.a=roundFloat(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s),a=r-o,l=r===0?0:a/r;let c;return a===0?c=0:r===t?c=((i-s)/a%6+6)%6:r===i?c=(s-t)/a+2:c=(t-i)/a+4,new HSVA(Math.round(c*60),l,r,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:r}=e,o=s*i,a=o*(1-Math.abs(t/60%2-1)),l=s-o;let[c,d,u]=[0,0,0];return t<60?(c=o,d=a):t<120?(c=a,d=o):t<180?(d=o,u=a):t<240?(d=a,u=o):t<300?(c=a,u=o):t<=360&&(c=o,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new RGBA(c,d,u,r)}}const mi=class mi{static fromHex(e){return mi.Format.CSS.parseHex(e)||mi.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:HSLA.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:HSVA.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof RGBA)this.rgba=e;else if(e instanceof HSLA)this._hsla=e,this.rgba=HSLA.toRGBA(e);else if(e instanceof HSVA)this._hsva=e,this.rgba=HSVA.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&RGBA.equals(this.rgba,e.rgba)&&HSLA.equals(this.hsla,e.hsla)&&HSVA.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=mi._relativeLuminanceForComponent(this.rgba.r),t=mi._relativeLuminanceForComponent(this.rgba.g),i=mi._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return roundFloat(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const s of i){const r=s.filter(c=>c!==void 0),o=r[1],a=r[2];if(!a)continue;let l;if(o==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=_findRGBColorInformation(_findRange(n,s),_findMatches(a,c),!1)}else if(o==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=_findRGBColorInformation(_findRange(n,s),_findMatches(a,c),!0)}else if(o==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=_findHSLColorInformation(_findRange(n,s),_findMatches(a,c),!1)}else if(o==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=_findHSLColorInformation(_findRange(n,s),_findMatches(a,c),!0)}else o==="#"&&(l=_findHexColorInformation(_findRange(n,s),o+a));l&&e.push(l)}return e}function computeDefaultDocumentColors(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:computeColors(n)}const markRegex=new RegExp("\\bMARK:\\s*(.*)$","d"),trimDashesRegex=/^-+|-+$/g;function findSectionHeaders(n,e){var i;let t=[];if(e.findRegionSectionHeaders&&((i=e.foldingRules)!=null&&i.markers)){const s=collectRegionHeaders(n,e);t=t.concat(s)}if(e.findMarkSectionHeaders){const s=collectMarkHeaders(n);t=t.concat(s)}return t}function collectRegionHeaders(n,e){const t=[],i=n.getLineCount();for(let s=1;s<=i;s++){const r=n.getLineContent(s),o=r.match(e.foldingRules.markers.start);if(o){const a={startLineNumber:s,startColumn:o[0].length+1,endLineNumber:s,endColumn:r.length+1};if(a.endColumn>a.startColumn){const l={range:a,...getHeaderText(r.substring(o[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&t.push(l)}}}return t}function collectMarkHeaders(n){const e=[],t=n.getLineCount();for(let i=1;i<=t;i++){const s=n.getLineContent(i);addMarkHeaderIfFound(s,i,e)}return e}function addMarkHeaderIfFound(n,e,t){markRegex.lastIndex=0;const i=markRegex.exec(n);if(i){const s=i.indices[1][0]+1,r=i.indices[1][1]+1,o={startLineNumber:e,startColumn:s,endLineNumber:e,endColumn:r};if(o.endColumn>o.startColumn){const a={range:o,...getHeaderText(i[1]),shouldBeInComments:!0};(a.text||a.hasSeparatorLine)&&t.push(a)}}}function getHeaderText(n){n=n.trim();const e=n.startsWith("-");return n=n.replace(trimDashesRegex,""),{text:n,hasSeparatorLine:e}}class PrefixSumComputer{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=toUint32(e);const i=this.values,s=this.prefixSum,r=t.length;return r===0?!1:(this.values=new Uint32Array(i.length+r),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+r),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=toUint32(e),t=toUint32(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const r=i.length-e;return t>=r&&(t=r),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=toUint32(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,r=0,o=0;for(;t<=i;)if(s=t+(i-t)/2|0,r=this.prefixSum[s],o=r-this.values[s],e=r)t=s+1;else break;return new PrefixSumIndexOfResult(s,e-o)}}class ConstantTimePrefixSumComputer{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new PrefixSumIndexOfResult(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=arrayInsert(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let r=0;rthis._checkStopModelSync(),Math.round(STOP_SYNC_MODEL_DELTA_TIME_MS/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)dispose(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>STOP_SYNC_MODEL_DELTA_TIME_MS&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const r=new DisposableStore;r.add(i.onDidChangeContent(o=>{this._proxy.$acceptModelChanged(s.toString(),o)})),r.add(i.onWillDispose(()=>{this._stopModelSync(s)})),r.add(toDisposable(()=>{this._proxy.$acceptRemovedModel(s)})),this._syncedModels[s]=r}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],dispose(t)}}class WorkerTextModelSyncServer{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}$acceptNewModel(e){this._models[e.url]=new MirrorModel(URI.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class MirrorModel extends MirrorTextModel{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const r=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>r&&(i=r,s=!0)}return s?{lineNumber:t,column:i}:e}}const Oh=class Oh{constructor(){this._workerTextModelSyncServer=new WorkerTextModelSyncServer}dispose(){}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}_getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const s=this._getModel(e);return s?UnicodeTextModelHighlighter.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?findSectionHeaders(i,t):[]}async $computeDiff(e,t,i,s){const r=this._getModel(e),o=this._getModel(t);return!r||!o?null:EditorSimpleWorker.computeDiff(r,o,i,s)}static computeDiff(e,t,i,s){const r=s==="advanced"?linesDiffComputers.getDefault():linesDiffComputers.getLegacy(),o=e.getLinesContent(),a=t.getLinesContent(),l=r.computeDiff(o,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(f=>{var g;return[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,(g=f.innerChanges)==null?void 0:g.map(m=>[m.originalRange.startLineNumber,m.originalRange.startColumn,m.originalRange.endLineNumber,m.originalRange.endColumn,m.modifiedRange.startLineNumber,m.modifiedRange.startColumn,m.modifiedRange.endLineNumber,m.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let r=1;r<=i;r++){const o=e.getLineContent(r),a=t.getLineContent(r);if(o!==a)return!1}return!0}async $computeMoreMinimalEdits(e,t,i){const s=this._getModel(e);if(!s)return t;const r=[];let o;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return Range$2.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lEditorSimpleWorker._diffLimit){r.push({range:l,text:c});continue}const f=stringDiff(u,c,i),g=s.offsetAt(Range$2.lift(l).getStartPosition());for(const m of f){const _=s.positionAt(g+m.originalStart),v=s.positionAt(g+m.originalStart+m.originalLength),C={text:c.substr(m.modifiedStart,m.modifiedLength),range:{startLineNumber:_.lineNumber,startColumn:_.column,endLineNumber:v.lineNumber,endColumn:v.column}};s.getValueInRange(C.range)!==C.text&&r.push(C)}}return typeof o=="number"&&r.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async $computeLinks(e){const t=this._getModel(e);return t?computeLinks(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?computeDefaultDocumentColors(t):null}async $textualSuggest(e,t,i,s){const r=new StopWatch,o=new RegExp(i,s),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(o))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>EditorSimpleWorker._suggestionsLimit))break e}}return{words:Array.from(a),duration:r.elapsed()}}async $computeWordRanges(e,t,i,s){const r=this._getModel(e);if(!r)return Object.create(null);const o=new RegExp(i,s),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.$fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(o,t),Promise.resolve(getAllMethodNames(this._foreignModule))):new Promise((a,l)=>{const c=d=>{this._foreignModule=d.create(o,t),a(getAllMethodNames(this._foreignModule))};{const d=FileAccess.asBrowserUri(`${e}.js`).toString(!0);__vitePreload(()=>import(`${d}`),[]).then(c).catch(l)}})}$fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}typeof importScripts=="function"&&(globalThis.monaco=createMonacoBaseAPI());const ITextResourceConfigurationService=createDecorator("textResourceConfigurationService"),ITextResourcePropertiesService=createDecorator("textResourcePropertiesService"),ILanguageFeaturesService=createDecorator("ILanguageFeaturesService");var __decorate$2z=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const STOP_WORKER_DELTA_TIME_MS=5*60*1e3;function canSyncModel(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let EditorWorkerService=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._languageConfigurationService=r,this._modelService=t,this._workerManager=this._register(new WorkerManager(e,this._modelService)),this._logService=s,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(a,l)=>{if(!canSyncModel(this._modelService,a.uri))return Promise.resolve({links:[]});const d=await(await this._workerWithResources([a.uri])).$computeLinks(a.uri.toString());return d&&{links:d}}})),this._register(o.completionProvider.register("*",new WordBasedCompletionItemProvider(this._workerManager,i,this._modelService,this._languageConfigurationService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return canSyncModel(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,s){const o=await(await this._workerWithResources([e,t],!0)).$computeDiff(e.toString(),t.toString(),i,s);if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:l(o.changes),moves:o.moves.map(c=>new MovedText(new LineRangeMapping(new LineRange$1(c[0],c[1]),new LineRange$1(c[2],c[3])),l(c[4])))};function l(c){return c.map(d=>{var u;return new DetailedLineRangeMapping(new LineRange$1(d[0],d[1]),new LineRange$1(d[2],d[3]),(u=d[4])==null?void 0:u.map(f=>new RangeMapping(new Range$2(f[0],f[1],f[2],f[3]),new Range$2(f[4],f[5],f[6],f[7]))))})}}async computeMoreMinimalEdits(e,t,i=!1){if(isNonEmptyArray(t)){if(!canSyncModel(this._modelService,e))return Promise.resolve(t);const s=StopWatch.create(),r=this._workerWithResources([e]).then(o=>o.$computeMoreMinimalEdits(e.toString(),t,i));return r.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([r,timeout(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return canSyncModel(this._modelService,e)}async navigateValueSet(e,t,i){const s=this._modelService.getModel(e);if(!s)return null;const r=this._languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),o=r.source,a=r.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,o,a)}canComputeWordRanges(e){return canSyncModel(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const s=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),r=s.source,o=s.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,r,o)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(e,t)}};EditorWorkerService=__decorate$2z([__param$2t(1,IModelService),__param$2t(2,ITextResourceConfigurationService),__param$2t(3,ILogService),__param$2t(4,ILanguageConfigurationService),__param$2t(5,ILanguageFeaturesService)],EditorWorkerService);class WordBasedCompletionItemProvider{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if(i.wordBasedSuggestions==="off")return;const s=[];if(i.wordBasedSuggestions==="currentDocument")canSyncModel(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())canSyncModel(this._modelService,u.uri)&&(u===e?s.unshift(u.uri):(i.wordBasedSuggestions==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&s.push(u.uri));if(s.length===0)return;const r=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),a=o?new Range$2(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):Range$2.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=await(await this._workerManager.withWorker()).textualSuggest(s,o==null?void 0:o.word,r);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}}}let WorkerManager=class extends Disposable{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new WindowIntervalTimer).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(STOP_WORKER_DELTA_TIME_MS/2),mainWindow),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>STOP_WORKER_DELTA_TIME_MS&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new EditorWorkerClient(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};WorkerManager=__decorate$2z([__param$2t(1,IModelService)],WorkerManager);class SynchronousWorkerClient{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}}let EditorWorkerClient=class extends Disposable{constructor(e,t,i){super(),this._workerDescriptor=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(createWebWorker$2(this._workerDescriptor)),EditorWorkerHost.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){logOnceWebWorkerWarning(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return logOnceWebWorkerWarning(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new SynchronousWorkerClient(new EditorSimpleWorker(this._createEditorWorkerHost(),null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new WorkerTextModelSyncClient(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(canceled());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const s=await this.workerWithSyncedResources(e),r=i.source,o=i.flags;return s.$textualSuggest(e.map(a=>a.toString()),t,r,o)}dispose(){super.dispose(),this._disposed=!0}};EditorWorkerClient=__decorate$2z([__param$2t(2,IModelService)],EditorWorkerClient);var ColorScheme;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(ColorScheme||(ColorScheme={}));function isHighContrast(n){return n===ColorScheme.HIGH_CONTRAST_DARK||n===ColorScheme.HIGH_CONTRAST_LIGHT}function isDark(n){return n===ColorScheme.DARK||n===ColorScheme.HIGH_CONTRAST_DARK}const IThemeService=createDecorator("themeService");function themeColorFromId(n){return{id:n}}function getThemeTypeSelector(n){switch(n){case ColorScheme.DARK:return"vs-dark";case ColorScheme.HIGH_CONTRAST_DARK:return"hc-black";case ColorScheme.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Extensions$4={ThemingContribution:"base.contributions.theming"};class ThemingRegistry{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Emitter$1}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),toDisposable(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const themingRegistry$1=new ThemingRegistry;Registry.add(Extensions$4.ThemingContribution,themingRegistry$1);function registerThemingParticipant(n){return themingRegistry$1.onColorThemeChange(n)}class Themable extends Disposable{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}var __decorate$2y=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2s=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let AbstractCodeEditorService=class extends Disposable{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new Emitter$1),this._onCodeEditorAdd=this._register(new Emitter$1),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Emitter$1),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new Emitter$1),this._onDiffEditorAdd=this._register(new Emitter$1),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new Emitter$1),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new LinkedList,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let r;this._modelProperties.has(s)?r=this._modelProperties.get(s):(r=new Map,this._modelProperties.set(s,r)),r.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const s of this._codeEditorOpenHandlers){const r=await s(e,t,i);if(r!==null)return r}return null}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return toDisposable(t)}};AbstractCodeEditorService=__decorate$2y([__param$2s(0,IThemeService)],AbstractCodeEditorService);var __decorate$2x=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2r=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneCodeEditorService=class extends AbstractCodeEditorService{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(i,s,r)=>s?this.doOpenEditor(s,i):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const r=t.resource.scheme;if(r===Schemas.http||r===Schemas.https)return windowOpenNoOpener(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const r={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(r),e.revealPositionInCenter(r,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};StandaloneCodeEditorService=__decorate$2x([__param$2r(0,IContextKeyService),__param$2r(1,IThemeService)],StandaloneCodeEditorService);registerSingleton(ICodeEditorService,StandaloneCodeEditorService,0);const ILayoutService=createDecorator("layoutService");var __decorate$2w=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2q=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneLayoutService=class{get mainContainer(){var e;return((e=firstOrDefault(this._codeEditorService.listCodeEditors()))==null?void 0:e.getContainerDomNode())??mainWindow.document.body}get activeContainer(){const e=this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor();return(e==null?void 0:e.getContainerDomNode())??this.mainContainer}get mainContainerDimension(){return getClientArea(this.mainContainer)}get activeContainerDimension(){return getClientArea(this.activeContainer)}get containers(){return coalesce(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())==null||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=Event$1.None,this.onDidLayoutActiveContainer=Event$1.None,this.onDidLayoutContainer=Event$1.None,this.onDidChangeActiveContainer=Event$1.None,this.onDidAddContainer=Event$1.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};StandaloneLayoutService=__decorate$2w([__param$2q(0,ICodeEditorService)],StandaloneLayoutService);let EditorScopedLayoutService=class extends StandaloneLayoutService{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};EditorScopedLayoutService=__decorate$2w([__param$2q(1,ICodeEditorService)],EditorScopedLayoutService);registerSingleton(ILayoutService,StandaloneLayoutService,1);var Severity$1;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(Severity$1||(Severity$1={}));(function(n){const e="error",t="warning",i="warn",s="info",r="ignore";function o(l){return l?equalsIgnoreCase(e,l)?n.Error:equalsIgnoreCase(t,l)||equalsIgnoreCase(i,l)?n.Warning:equalsIgnoreCase(s,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=o;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return s;default:return r}}n.toString=a})(Severity$1||(Severity$1={}));const Severity$2=Severity$1,IDialogService=createDecorator("dialogService");var Severity=Severity$2;const INotificationService=createDecorator("notificationService");class NoOpNotification{}const IUndoRedoService=createDecorator("undoRedoService");class ResourceEditStackSnapshot{constructor(e,t){this.resource=e,this.elements=t}}const ll=class ll{constructor(){this.id=ll._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};ll._ID=0,ll.None=new ll;let UndoRedoGroup=ll;const cl=class cl{constructor(){this.id=cl._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}};cl._ID=0,cl.None=new cl;let UndoRedoSource=cl;var __decorate$2v=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2p=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function getResourceLabel(n){return n.scheme===Schemas.file?n.fsPath:n.path}let stackElementCounter=0;class ResourceStackElement{constructor(e,t,i,s,r,o,a){this.id=++stackElementCounter,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=r,this.sourceId=o,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ResourceReasonPair{constructor(e,t){this.resourceLabel=e,this.reason=t}}class RemovedResources{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(localize({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(localize({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class WorkspaceStackElement{constructor(e,t,i,s,r,o,a){this.id=++stackElementCounter,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=r,this.sourceId=o,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new RemovedResources),this.removedResources.has(t)||this.removedResources.set(t,new ResourceReasonPair(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new RemovedResources),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new ResourceReasonPair(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ResourceEditStack{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new ResourceEditStackSnapshot(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,r=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,r=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let a=this._future.length-1;a>=0;a--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,o=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}r!==-1&&(this._past=this._past.slice(0,r)),o!==-1&&(this._future=this._future.slice(o+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class EditStackSnapshot{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=o,i=s)}return[t,i]}canUndo(e){if(e instanceof UndoRedoSource){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){onUnexpectedError(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,r){const o=this._acquireLocks(i);let a;try{a=t()}catch(l){return o(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(o(),s.dispose(),r()),l=>(o(),s.dispose(),this._onError(l,e))):(o(),s.dispose(),r())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return Disposable.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Disposable.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Disposable.None);const i=e.actual.prepareUndoRedo();return i?isDisposable(i)?t(i):i.then(s=>t(s)):t(Disposable.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||missingEditStack);return new EditStackSnapshot(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new WorkspaceVerificationError(this._undo(e,0,!0));for(const r of t.strResources)this.removeElements(r);return this._notificationService.warn(s),new WorkspaceVerificationError}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,localize({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,localize({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const r=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&r.push(a.resourceLabel);if(r.length>0)return this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,localize({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),r=this._checkWorkspaceUndo(e,t,s,!1);return r?r.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,s){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=await this._dialogService.prompt({type:Severity$2.Info,message:localize("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:localize({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:localize({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let r;try{r=await this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,r,()=>this._continueUndoInGroup(t.groupId,s))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=localize({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new EditStackSnapshot([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,r]of this._editStacks){const o=r.getClosestPastElement();o&&o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof UndoRedoSource){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),r=s.getClosestPastElement();if(!r)return;if(r.groupId){const[a,l]=this._findClosestUndoElementInGroup(r.groupId);if(r!==a&&l)return this._undo(l,t,i)}if((r.sourceId!==t||r.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,r);try{return r.type===1?this._workspaceUndo(e,r,i):this._resourceUndo(s,r,i)}finally{}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:localize("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:localize({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:localize("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.sourceId===e&&(!t||o.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,r.join(", ")));const o=[];for(const a of i.editStacks)a.locked&&o.push(a.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,localize({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let s;try{s=await this._invokeWorkspacePrepare(t)}catch(o){return this._onError(o,t)}const r=this._checkWorkspaceRedo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(const o of i.editStacks)o.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=localize({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new EditStackSnapshot([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,r]of this._editStacks){const o=r.getClosestFutureElement();o&&o.groupId===e&&(!t||o.groupOrder=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2o=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ILanguageFeatureDebounceService=createDecorator("ILanguageFeatureDebounceService");var IdentityHash;(function(n){const e=new WeakMap;let t=0;function i(s){let r=e.get(s);return r===void 0&&(r=++t,e.set(s,r)),r}n.of=i})(IdentityHash||(IdentityHash={}));class NullDebounceInformation{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class FeatureDebounceInformation{constructor(e,t,i,s,r,o){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=r,this._max=o,this._cache=new LRUCache(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>doHash(IdentityHash.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?clamp(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new SlidingWindowAverage(6),this._cache.set(i,s));const r=clamp(s.update(t),this._min,this._max);return matchesScheme(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${r}ms`),r}_overall(){const e=new MovingAverage;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return clamp(e,this._min,this._max)}}let LanguageFeatureDebounceService=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const s=(i==null?void 0:i.min)??50,r=(i==null?void 0:i.max)??s**2,o=(i==null?void 0:i.key)??void 0,a=`${IdentityHash.of(e)},${s}${o?","+o:""}`;let l=this._data.get(a);return l||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),l=new NullDebounceInformation(s*1.5)):l=new FeatureDebounceInformation(this._logService,t,e,this._overallAverage()|0||s*1.5,s,r),this._data.set(a,l)),l}_overallAverage(){const e=new MovingAverage;for(const t of this._data.values())e.update(t.default());return e.value}};LanguageFeatureDebounceService=__decorate$2u([__param$2o(0,ILogService),__param$2o(1,IEnvironmentService)],LanguageFeatureDebounceService);registerSingleton(ILanguageFeatureDebounceService,LanguageFeatureDebounceService,1);class TokenMetadata{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),s&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let r=`color: ${t[i]};`;s&1&&(r+="font-style: italic;"),s&2&&(r+="font-weight: bold;");let o="";return s&4&&(o+=" underline"),s&8&&(o+=" line-through"),o&&(r+=`text-decoration:${o};`),r}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}function countEOL(n){let e=0,t=0,i=0,s=0;for(let r=0,o=n.length;r0?t.charCodeAt(0):0)}acceptEdit(e,t,i,s,r){this._acceptDeleteRange(e),this._acceptInsertText(new Position$1(e.startLineNumber,e.startColumn),t,i,s,r),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const r=i-t;this._startLineNumber-=r;return}const s=this._tokens.getMaxDeltaLine();if(!(t>=s+1)){if(t<0&&i>=s+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const r=-t;this._startLineNumber-=r,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,s,r){if(t===0&&i===0)return;const o=e.lineNumber-this._startLineNumber;if(o<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();o>=a+1||this._tokens.acceptInsertText(o,e.column-1,t,i,s,r)}}class SparseMultilineTokensStorage{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)i=s-1;else{let o=s;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let a=s;for(;ae||f===e&&m>=t)&&(fe||m===e&&v>=t){if(mr?_-=r-i:_=i;else if(g===t&&m===i)if(g===s&&_>r)_-=r-i;else{d=!0;continue}else if(gr)g=t,m=i,_=m+(_-r);else{d=!0;continue}else if(g>s){if(l===0&&!d){c=a;break}g-=l}else if(g===s&&m>=r)e&&g===0&&(m+=e,_+=e),g-=l,m-=r-i,_-=r-i;else throw new Error("Not possible!");const C=4*c;o[C]=g,o[C+1]=m,o[C+2]=_,o[C+3]=v,c++}this._tokenCount=c}acceptInsertText(e,t,i,s,r,o){const a=i===0&&s===1&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),l=this._tokens,c=this._tokenCount;for(let d=0;d=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2n=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let SemanticTokensProviderStyling=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new HashTable}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),r=this._hashTable.get(e,t,s);let o;if(r)o=r.metadata;else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")o=2147483647;else{if(o=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;o|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;o|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;o|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;o|=u|8}if(d.foreground){const u=d.foreground<<15;o|=u|16}o===0&&(o=2147483647)}}else o=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,o)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,r){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${r}).`))}};SemanticTokensProviderStyling=__decorate$2t([__param$2n(1,IThemeService),__param$2n(2,ILanguageService),__param$2n(3,ILogService)],SemanticTokensProviderStyling);function toMultilineTokens2(n,e,t){const i=n.data,s=n.data.length/5|0,r=Math.max(Math.ceil(s/1024),400),o=[];let a=0,l=1,c=0;for(;ad&&i[5*S]===0;)S--;if(S-1===d){let w=u;for(;w+1N)e.warnOverlappingSemanticTokens(I,N+1);else{const B=e.getMetadata(A,F,t);B!==2147483647&&(m===0&&(m=I),f[g]=I-m,f[g+1]=N,f[g+2]=T,f[g+3]=B,g+=4,_=I,v=T)}l=I,c=N,a++}g!==f.length&&(f=f.subarray(0,g));const C=SparseMultilineTokens.create(m,f);o.push(C)}return o}class HashTableEntry{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}const fr=class fr{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=fr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const r=this._elements;this._currentLengthIndex++,this._currentLength=fr._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2m=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let SemanticTokensStylingService=class extends Disposable{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new SemanticTokensProviderStyling(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};SemanticTokensStylingService=__decorate$2s([__param$2m(0,IThemeService),__param$2m(1,ILogService),__param$2m(2,ILanguageService)],SemanticTokensStylingService);registerSingleton(ISemanticTokensStylingService,SemanticTokensStylingService,1);function isPathSeparator(n){return n===47||n===92}function toSlashes(n){return n.replace(/[\\/]/g,posix.sep)}function toPosixPath(n){return n.indexOf("/")===-1&&(n=toSlashes(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function getRoot(n,e=posix.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(isPathSeparator(i)){if(isPathSeparator(n.charCodeAt(1))&&!isPathSeparator(n.charCodeAt(2))){let r=3;const o=r;for(;rn.length)return!1;if(t){if(!startsWithIgnoreCase(n,e))return!1;if(e.length===n.length)return!0;let r=e.length;return e.charAt(e.length-1)===i&&r--,n.charAt(r)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function isWindowsDriveLetter(n){return n>=65&&n<=90||n>=97&&n<=122}function hasDriveLetter(n,e=isWindows){return e?isWindowsDriveLetter(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}const GLOBSTAR="**",GLOB_SPLIT="/",PATH_REGEX="[/\\\\]",NO_PATH_REGEX="[^/\\\\]",ALL_FORWARD_SLASHES=/\//g;function starsToRegExp(n,e){switch(n){case 0:return"";case 1:return`${NO_PATH_REGEX}*?`;default:return`(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}${e?`|${PATH_REGEX}${NO_PATH_REGEX}+`:""})*?`}}function splitGlobAware(n,e){if(!n)return[];const t=[];let i=!1,s=!1,r="";for(const o of n){switch(o){case e:if(!i&&!s){t.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}r+=o}return r&&t.push(r),t}function parseRegExp(n){if(!n)return"";let e="";const t=splitGlobAware(n,GLOB_SPLIT);if(t.every(i=>i===GLOBSTAR))e=".*";else{let i=!1;t.forEach((s,r)=>{if(s===GLOBSTAR){if(i)return;e+=starsToRegExp(2,r===t.length-1)}else{let o=!1,a="",l=!1,c="";for(const d of s){if(d!=="}"&&o){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===GLOB_SPLIT?u="":u=escapeRegExpCharacters(d),c+=u;continue}switch(d){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const f=`(?:${splitGlobAware(a,",").map(g=>parseRegExp(g)).join("|")})`;e+=f,o=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=NO_PATH_REGEX;continue;case"*":e+=starsToRegExp(1);continue;default:e+=escapeRegExpCharacters(d)}}rparsePattern(a,e)).filter(a=>a!==NULL),n),i=t.length;if(!i)return NULL;if(i===1)return t[0];const s=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function trivia4and5(n,e,t){const i=sep$1===posix.sep,s=i?n:n.replace(ALL_FORWARD_SLASHES,sep$1),r=sep$1+s,o=posix.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(r)||!i&&(l===n||l.endsWith(o)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function toRegExp(n){try{const e=new RegExp(`^${parseRegExp(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return NULL}}function match(n,e,t){return!n||typeof e!="string"?!1:parse$6(n)(e,void 0,t)}function parse$6(n,e={}){if(!n)return FALSE;if(typeof n=="string"||isRelativePattern(n)){const t=parsePattern(n,e);if(t===NULL)return FALSE;const i=function(s,r){return!!t(s,r)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return parsedExpression(n,e)}function isRelativePattern(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function parsedExpression(n,e){const t=aggregateBasenameMatches(Object.getOwnPropertyNames(n).map(a=>parseExpressionPattern(a,n[a],e)).filter(a=>a!==NULL)),i=t.length;if(!i)return NULL;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let f;for(let g=0,m=t.length;g{for(const g of f){const m=await g;if(typeof m=="string")return m}return null})():null},l=t.find(d=>!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let d,u;for(let f=0,g=t.length;f{for(const f of u){const g=await f;if(typeof g=="string")return g}return null})():null},r=t.find(a=>!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function parseExpressionPattern(n,e,t){if(e===!1)return NULL;const i=parsePattern(n,t);if(i===NULL)return NULL;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const r=(o,a,l,c)=>{if(!c||!i(o,a))return null;const d=s.replace("$(basename)",()=>l),u=c(d);return isThenable$1(u)?u.then(f=>f?n:null):u?n:null};return r.requiresSiblings=!0,r}}return i}function aggregateBasenameMatches(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?s[c]:null};r.basenames=i,r.patterns=s,r.allBasenames=i;const o=n.filter(a=>!a.basenames);return o.push(r),o}function score(n,e,t,i,s,r){if(Array.isArray(n)){let o=0;for(const a of n){const l=score(a,e,t,i,s,r);if(l===10)return l;l>o&&(o=l)}return o}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:o,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&s&&(e=s);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(o)if(o===t)u=10;else if(o==="*")u=Math.max(u,5);else return 0;if(d)if(d===r)u=10;else if(d==="*"&&r!==void 0)u=Math.max(u,5);else return 0;if(a){let f;if(typeof a=="string"?f=a:f={...a,base:normalize(a.base)},f===e.fsPath||match(f,e.fsPath))u=10;else return 0}return u}else return 0}}function isExclusive(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(isExclusive):!!n.exclusive}class MatchCandidate{constructor(e,t,i,s,r){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s,this.recursive=r}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)==null?void 0:t.toString())===((i=e.notebookUri)==null?void 0:i.toString())&&this.recursive===e.recursive}}class LanguageFeatureRegistry{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),toDisposable(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,s=>i.push(s.provider)),i}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,!1,r=>{i&&s===r._score?i.push(r.provider):(s=r._score,i=[r.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const s of this._entries)s._score>0&&i(s)}_updateScores(e,t){var r,o;const i=(r=this._notebookInfoResolver)==null?void 0:r.call(this,e.uri),s=i?new MatchCandidate(e.uri,e.getLanguageId(),i.uri,i.type,t):new MatchCandidate(e.uri,e.getLanguageId(),void 0,void 0,t);if(!((o=this._lastCandidate)!=null&&o.equals(s))){this._lastCandidate=s;for(const a of this._entries)if(a._score=score(a.selector,s.uri,s.languageId,shouldSynchronizeModel(e),s.notebookUri,s.notebookType),isExclusive(a.selector)&&a._score>0)if(t)a._score=0;else{for(const l of this._entries)l._score=0;a._score=1e3;break}this._entries.sort(LanguageFeatureRegistry._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:isBuiltinSelector(e.selector)&&!isBuiltinSelector(t.selector)?1:!isBuiltinSelector(e.selector)&&isBuiltinSelector(t.selector)?-1:e._timet._time?-1:0}}function isBuiltinSelector(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(isBuiltinSelector):!!n.isBuiltin}class LanguageFeaturesService{constructor(){this.referenceProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.renameProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.newSymbolNamesProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.codeActionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.definitionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.typeDefinitionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.declarationProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.implementationProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentSymbolProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.inlayHintsProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.colorProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.codeLensProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentRangeFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.onTypeFormattingEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.signatureHelpProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.hoverProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentHighlightProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.multiDocumentHighlightProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.selectionRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.foldingRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.linkProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.inlineCompletionsProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.inlineEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.completionProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.linkedEditingRangeProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentSemanticTokensProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentDropEditProvider=new LanguageFeatureRegistry(this._score.bind(this)),this.documentPasteEditProvider=new LanguageFeatureRegistry(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)==null?void 0:t.call(this,e)}}registerSingleton(ILanguageFeaturesService,LanguageFeaturesService,1);function asCssVariableName(n){return`--vscode-${n.replace(/\./g,"-")}`}function asCssVariable(n){return`var(${asCssVariableName(n)})`}function asCssVariableWithDefault(n,e){return`var(${asCssVariableName(n)}, ${e})`}function isColorDefaults(n){return n!==null&&typeof n=="object"&&"light"in n&&"dark"in n}const Extensions$3={ColorContribution:"base.contributions.colors"},DEFAULT_COLOR_CONFIG_VALUE="default";class ColorRegistry{constructor(){this._onDidChangeSchema=new Emitter$1,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,r){const o={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:r};this.colorsById[e]=o;const a={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return r&&(a.deprecationMessage=r),s&&(a.pattern="^#(?:(?[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",a.patternErrorMessage=localize("transparecyRequired","This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[a,{type:"string",const:DEFAULT_COLOR_CONFIG_VALUE,description:localize("useDefault","Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i!=null&&i.defaults){const s=isColorDefaults(i.defaults)?i.defaults[t.type]:i.defaults;return resolveColorValue(s,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,r=i.indexOf(".")===-1?0:1;return s!==r?s-r:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const colorRegistry$1=new ColorRegistry;Registry.add(Extensions$3.ColorContribution,colorRegistry$1);function registerColor(n,e,t,i,s){return colorRegistry$1.registerColor(n,e,t,i,s)}function executeTransform(n,e){var t,i,s,r;switch(n.op){case 0:return(t=resolveColorValue(n.value,e))==null?void 0:t.darken(n.factor);case 1:return(i=resolveColorValue(n.value,e))==null?void 0:i.lighten(n.factor);case 2:return(s=resolveColorValue(n.value,e))==null?void 0:s.transparent(n.factor);case 3:{const o=resolveColorValue(n.background,e);return o?(r=resolveColorValue(n.value,e))==null?void 0:r.makeOpaque(o):resolveColorValue(n.value,e)}case 4:for(const o of n.values){const a=resolveColorValue(o,e);if(a)return a}return;case 6:return resolveColorValue(e.defines(n.if)?n.then:n.else,e);case 5:{const o=resolveColorValue(n.value,e);if(!o)return;const a=resolveColorValue(n.background,e);return a?o.isDarkerThan(a)?Color.getLighterColor(o,a,n.factor).transparent(n.transparency):Color.getDarkerColor(o,a,n.factor).transparent(n.transparency):o.transparent(n.factor*n.transparency)}default:throw assertNever()}}function darken(n,e){return{op:0,value:n,factor:e}}function lighten(n,e){return{op:1,value:n,factor:e}}function transparent(n,e){return{op:2,value:n,factor:e}}function oneOf(...n){return{op:4,values:n}}function ifDefinedThenElse(n,e,t){return{op:6,if:n,then:e,else:t}}function lessProminent(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function resolveColorValue(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?Color.fromHex(n):e.getColor(n);if(n instanceof Color)return n;if(typeof n=="object")return executeTransform(n,e)}}const workbenchColorsSchemaId="vscode://schemas/workbench-colors",schemaRegistry$1=Registry.as(Extensions$7.JSONContribution);schemaRegistry$1.registerSchema(workbenchColorsSchemaId,colorRegistry$1.getColorSchema());const delayer$1=new RunOnceScheduler(()=>schemaRegistry$1.notifySchemaChanged(workbenchColorsSchemaId),200);colorRegistry$1.onDidChangeSchema(()=>{delayer$1.isScheduled()||delayer$1.schedule()});const foreground=registerColor("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},localize("foreground","Overall foreground color. This color is only used if not overridden by a component."));registerColor("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},localize("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));registerColor("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},localize("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));registerColor("descriptionForeground",{light:"#717171",dark:transparent(foreground,.7),hcDark:transparent(foreground,.7),hcLight:transparent(foreground,.7)},localize("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const iconForeground=registerColor("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},localize("iconForeground","The default color for icons in the workbench.")),focusBorder=registerColor("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},localize("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),contrastBorder=registerColor("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},localize("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),activeContrastBorder=registerColor("contrastActiveBorder",{light:null,dark:null,hcDark:focusBorder,hcLight:focusBorder},localize("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));registerColor("selection.background",null,localize("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const textLinkForeground=registerColor("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},localize("textLinkForeground","Foreground color for links in text."));registerColor("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},localize("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));registerColor("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Color.black,hcLight:"#292929"},localize("textSeparatorForeground","Color for text separators."));registerColor("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},localize("textPreformatForeground","Foreground color for preformatted text segments."));registerColor("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},localize("textPreformatBackground","Background color for preformatted text segments."));registerColor("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},localize("textBlockQuoteBackground","Background color for block quotes in text."));registerColor("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:Color.white,hcLight:"#292929"},localize("textBlockQuoteBorder","Border color for block quotes in text."));registerColor("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:Color.black,hcLight:"#F2F2F2"},localize("textCodeBlockBackground","Background color for code blocks in text."));registerColor("sash.hoverBorder",focusBorder,localize("sashActiveBorder","Border color of active sashes."));const badgeBackground=registerColor("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:Color.black,hcLight:"#0F4A85"},localize("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),badgeForeground=registerColor("badge.foreground",{dark:Color.white,light:"#333",hcDark:Color.white,hcLight:Color.white},localize("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),scrollbarShadow=registerColor("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},localize("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),scrollbarSliderBackground=registerColor("scrollbarSlider.background",{dark:Color.fromHex("#797979").transparent(.4),light:Color.fromHex("#646464").transparent(.4),hcDark:transparent(contrastBorder,.6),hcLight:transparent(contrastBorder,.4)},localize("scrollbarSliderBackground","Scrollbar slider background color.")),scrollbarSliderHoverBackground=registerColor("scrollbarSlider.hoverBackground",{dark:Color.fromHex("#646464").transparent(.7),light:Color.fromHex("#646464").transparent(.7),hcDark:transparent(contrastBorder,.8),hcLight:transparent(contrastBorder,.8)},localize("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),scrollbarSliderActiveBackground=registerColor("scrollbarSlider.activeBackground",{dark:Color.fromHex("#BFBFBF").transparent(.4),light:Color.fromHex("#000000").transparent(.6),hcDark:contrastBorder,hcLight:contrastBorder},localize("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),progressBarBackground=registerColor("progressBar.background",{dark:Color.fromHex("#0E70C0"),light:Color.fromHex("#0E70C0"),hcDark:contrastBorder,hcLight:contrastBorder},localize("progressBarBackground","Background color of the progress bar that can show for long running operations.")),editorBackground=registerColor("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:Color.black,hcLight:Color.white},localize("editorBackground","Editor background color.")),editorForeground=registerColor("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:Color.white,hcLight:foreground},localize("editorForeground","Editor default foreground color."));registerColor("editorStickyScroll.background",editorBackground,localize("editorStickyScrollBackground","Background color of sticky scroll in the editor"));registerColor("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:Color.fromHex("#0F4A85").transparent(.1)},localize("editorStickyScrollHoverBackground","Background color of sticky scroll on hover in the editor"));registerColor("editorStickyScroll.border",{dark:null,light:null,hcDark:contrastBorder,hcLight:contrastBorder},localize("editorStickyScrollBorder","Border color of sticky scroll in the editor"));registerColor("editorStickyScroll.shadow",scrollbarShadow,localize("editorStickyScrollShadow"," Shadow color of sticky scroll in the editor"));const editorWidgetBackground=registerColor("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:Color.white},localize("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),editorWidgetForeground=registerColor("editorWidget.foreground",foreground,localize("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),editorWidgetBorder=registerColor("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:contrastBorder,hcLight:contrastBorder},localize("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));registerColor("editorWidget.resizeBorder",null,localize("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));registerColor("editorError.background",null,localize("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const editorErrorForeground=registerColor("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},localize("editorError.foreground","Foreground color of error squigglies in the editor.")),editorErrorBorder=registerColor("editorError.border",{dark:null,light:null,hcDark:Color.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},localize("errorBorder","If set, color of double underlines for errors in the editor.")),editorWarningBackground=registerColor("editorWarning.background",null,localize("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorWarningForeground=registerColor("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},localize("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),editorWarningBorder=registerColor("editorWarning.border",{dark:null,light:null,hcDark:Color.fromHex("#FFCC00").transparent(.8),hcLight:Color.fromHex("#FFCC00").transparent(.8)},localize("warningBorder","If set, color of double underlines for warnings in the editor."));registerColor("editorInfo.background",null,localize("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const editorInfoForeground=registerColor("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},localize("editorInfo.foreground","Foreground color of info squigglies in the editor.")),editorInfoBorder=registerColor("editorInfo.border",{dark:null,light:null,hcDark:Color.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},localize("infoBorder","If set, color of double underlines for infos in the editor.")),editorHintForeground=registerColor("editorHint.foreground",{dark:Color.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},localize("editorHint.foreground","Foreground color of hint squigglies in the editor."));registerColor("editorHint.border",{dark:null,light:null,hcDark:Color.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},localize("hintBorder","If set, color of double underlines for hints in the editor."));const editorActiveLinkForeground=registerColor("editorLink.activeForeground",{dark:"#4E94CE",light:Color.blue,hcDark:Color.cyan,hcLight:"#292929"},localize("activeLinkForeground","Color of active links.")),editorSelectionBackground=registerColor("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},localize("editorSelectionBackground","Color of the editor selection.")),editorSelectionForeground=registerColor("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:Color.white},localize("editorSelectionForeground","Color of the selected text for high contrast.")),editorInactiveSelection=registerColor("editor.inactiveSelectionBackground",{light:transparent(editorSelectionBackground,.5),dark:transparent(editorSelectionBackground,.5),hcDark:transparent(editorSelectionBackground,.7),hcLight:transparent(editorSelectionBackground,.5)},localize("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),editorSelectionHighlight=registerColor("editor.selectionHighlightBackground",{light:lessProminent(editorSelectionBackground,editorBackground,.3,.6),dark:lessProminent(editorSelectionBackground,editorBackground,.3,.6),hcDark:null,hcLight:null},localize("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));registerColor("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},localize("editorFindMatch","Color of the current search match."));const editorFindMatchForeground=registerColor("editor.findMatchForeground",null,localize("editorFindMatchForeground","Text color of the current search match.")),editorFindMatchHighlight=registerColor("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},localize("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),editorFindMatchHighlightForeground=registerColor("editor.findMatchHighlightForeground",null,localize("findMatchHighlightForeground","Foreground color of the other search matches."),!0);registerColor("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},localize("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.findMatchBorder",{light:null,dark:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("editorFindMatchBorder","Border color of the current search match."));const editorFindMatchHighlightBorder=registerColor("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("findMatchHighlightBorder","Border color of the other search matches.")),editorFindRangeHighlightBorder=registerColor("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:transparent(activeContrastBorder,.4),hcLight:transparent(activeContrastBorder,.4)},localize("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},localize("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const editorHoverBackground=registerColor("editorHoverWidget.background",editorWidgetBackground,localize("hoverBackground","Background color of the editor hover."));registerColor("editorHoverWidget.foreground",editorWidgetForeground,localize("hoverForeground","Foreground color of the editor hover."));const editorHoverBorder=registerColor("editorHoverWidget.border",editorWidgetBorder,localize("hoverBorder","Border color of the editor hover."));registerColor("editorHoverWidget.statusBarBackground",{dark:lighten(editorHoverBackground,.2),light:darken(editorHoverBackground,.05),hcDark:editorWidgetBackground,hcLight:editorWidgetBackground},localize("statusBarBackground","Background color of the editor hover status bar."));const editorInlayHintForeground=registerColor("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:Color.white,hcLight:Color.black},localize("editorInlayHintForeground","Foreground color of inline hints")),editorInlayHintBackground=registerColor("editorInlayHint.background",{dark:transparent(badgeBackground,.1),light:transparent(badgeBackground,.1),hcDark:transparent(Color.white,.1),hcLight:transparent(badgeBackground,.1)},localize("editorInlayHintBackground","Background color of inline hints")),editorInlayHintTypeForeground=registerColor("editorInlayHint.typeForeground",editorInlayHintForeground,localize("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),editorInlayHintTypeBackground=registerColor("editorInlayHint.typeBackground",editorInlayHintBackground,localize("editorInlayHintBackgroundTypes","Background color of inline hints for types")),editorInlayHintParameterForeground=registerColor("editorInlayHint.parameterForeground",editorInlayHintForeground,localize("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),editorInlayHintParameterBackground=registerColor("editorInlayHint.parameterBackground",editorInlayHintBackground,localize("editorInlayHintBackgroundParameter","Background color of inline hints for parameters")),editorLightBulbForeground=registerColor("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},localize("editorLightBulbForeground","The color used for the lightbulb actions icon."));registerColor("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},localize("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));registerColor("editorLightBulbAi.foreground",editorLightBulbForeground,localize("editorLightBulbAiForeground","The color used for the lightbulb AI icon."));registerColor("editor.snippetTabstopHighlightBackground",{dark:new Color(new RGBA(124,124,124,.3)),light:new Color(new RGBA(10,50,100,.2)),hcDark:new Color(new RGBA(124,124,124,.3)),hcLight:new Color(new RGBA(10,50,100,.2))},localize("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));registerColor("editor.snippetTabstopHighlightBorder",null,localize("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));registerColor("editor.snippetFinalTabstopHighlightBackground",null,localize("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));registerColor("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new Color(new RGBA(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},localize("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const defaultInsertColor=new Color(new RGBA(155,185,85,.2)),defaultRemoveColor=new Color(new RGBA(255,0,0,.2)),diffInserted=registerColor("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},localize("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),diffRemoved=registerColor("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},localize("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("diffEditor.insertedLineBackground",{dark:defaultInsertColor,light:defaultInsertColor,hcDark:null,hcLight:null},localize("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("diffEditor.removedLineBackground",{dark:defaultRemoveColor,light:defaultRemoveColor,hcDark:null,hcLight:null},localize("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("diffEditorGutter.insertedLineBackground",null,localize("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));registerColor("diffEditorGutter.removedLineBackground",null,localize("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const diffOverviewRulerInserted=registerColor("diffEditorOverview.insertedForeground",null,localize("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),diffOverviewRulerRemoved=registerColor("diffEditorOverview.removedForeground",null,localize("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));registerColor("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},localize("diffEditorInsertedOutline","Outline color for the text that got inserted."));registerColor("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},localize("diffEditorRemovedOutline","Outline color for text that got removed."));registerColor("diffEditor.border",{dark:null,light:null,hcDark:contrastBorder,hcLight:contrastBorder},localize("diffEditorBorder","Border color between the two text editors."));registerColor("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},localize("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));registerColor("diffEditor.unchangedRegionBackground","sideBar.background",localize("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));registerColor("diffEditor.unchangedRegionForeground","foreground",localize("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));registerColor("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},localize("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const widgetShadow=registerColor("widget.shadow",{dark:transparent(Color.black,.36),light:transparent(Color.black,.16),hcDark:null,hcLight:null},localize("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),widgetBorder=registerColor("widget.border",{dark:null,light:null,hcDark:contrastBorder,hcLight:contrastBorder},localize("widgetBorder","Border color of widgets such as find/replace inside the editor.")),toolbarHoverBackground=registerColor("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},localize("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));registerColor("toolbar.hoverOutline",{dark:null,light:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));registerColor("toolbar.activeBackground",{dark:lighten(toolbarHoverBackground,.1),light:darken(toolbarHoverBackground,.1),hcDark:null,hcLight:null},localize("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));const breadcrumbsForeground=registerColor("breadcrumb.foreground",transparent(foreground,.8),localize("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),breadcrumbsBackground=registerColor("breadcrumb.background",editorBackground,localize("breadcrumbsBackground","Background color of breadcrumb items.")),breadcrumbsFocusForeground=registerColor("breadcrumb.focusForeground",{light:darken(foreground,.2),dark:lighten(foreground,.1),hcDark:lighten(foreground,.1),hcLight:lighten(foreground,.1)},localize("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),breadcrumbsActiveSelectionForeground=registerColor("breadcrumb.activeSelectionForeground",{light:darken(foreground,.2),dark:lighten(foreground,.1),hcDark:lighten(foreground,.1),hcLight:lighten(foreground,.1)},localize("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));registerColor("breadcrumbPicker.background",editorWidgetBackground,localize("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const headerTransparency=.5,currentBaseColor=Color.fromHex("#40C8AE").transparent(headerTransparency),incomingBaseColor=Color.fromHex("#40A6FF").transparent(headerTransparency),commonBaseColor=Color.fromHex("#606060").transparent(.4),contentTransparency=.4,rulerTransparency=1,mergeCurrentHeaderBackground=registerColor("merge.currentHeaderBackground",{dark:currentBaseColor,light:currentBaseColor,hcDark:null,hcLight:null},localize("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.currentContentBackground",transparent(mergeCurrentHeaderBackground,contentTransparency),localize("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeIncomingHeaderBackground=registerColor("merge.incomingHeaderBackground",{dark:incomingBaseColor,light:incomingBaseColor,hcDark:null,hcLight:null},localize("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.incomingContentBackground",transparent(mergeIncomingHeaderBackground,contentTransparency),localize("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeCommonHeaderBackground=registerColor("merge.commonHeaderBackground",{dark:commonBaseColor,light:commonBaseColor,hcDark:null,hcLight:null},localize("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("merge.commonContentBackground",transparent(mergeCommonHeaderBackground,contentTransparency),localize("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const mergeBorder=registerColor("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},localize("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));registerColor("editorOverviewRuler.currentContentForeground",{dark:transparent(mergeCurrentHeaderBackground,rulerTransparency),light:transparent(mergeCurrentHeaderBackground,rulerTransparency),hcDark:mergeBorder,hcLight:mergeBorder},localize("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));registerColor("editorOverviewRuler.incomingContentForeground",{dark:transparent(mergeIncomingHeaderBackground,rulerTransparency),light:transparent(mergeIncomingHeaderBackground,rulerTransparency),hcDark:mergeBorder,hcLight:mergeBorder},localize("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));registerColor("editorOverviewRuler.commonContentForeground",{dark:transparent(mergeCommonHeaderBackground,rulerTransparency),light:transparent(mergeCommonHeaderBackground,rulerTransparency),hcDark:mergeBorder,hcLight:mergeBorder},localize("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const overviewRulerFindMatchForeground=registerColor("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},localize("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerSelectionHighlightForeground=registerColor("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",localize("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),problemsErrorIconForeground=registerColor("problemsErrorIcon.foreground",editorErrorForeground,localize("problemsErrorIconForeground","The color used for the problems error icon.")),problemsWarningIconForeground=registerColor("problemsWarningIcon.foreground",editorWarningForeground,localize("problemsWarningIconForeground","The color used for the problems warning icon.")),problemsInfoIconForeground=registerColor("problemsInfoIcon.foreground",editorInfoForeground,localize("problemsInfoIconForeground","The color used for the problems info icon.")),minimapFindMatch=registerColor("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},localize("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),minimapSelectionOccurrenceHighlight=registerColor("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},localize("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),minimapSelection=registerColor("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},localize("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),minimapInfo=registerColor("minimap.infoHighlight",{dark:editorInfoForeground,light:editorInfoForeground,hcDark:editorInfoBorder,hcLight:editorInfoBorder},localize("minimapInfo","Minimap marker color for infos.")),minimapWarning=registerColor("minimap.warningHighlight",{dark:editorWarningForeground,light:editorWarningForeground,hcDark:editorWarningBorder,hcLight:editorWarningBorder},localize("overviewRuleWarning","Minimap marker color for warnings.")),minimapError=registerColor("minimap.errorHighlight",{dark:new Color(new RGBA(255,18,18,.7)),light:new Color(new RGBA(255,18,18,.7)),hcDark:new Color(new RGBA(255,50,50,1)),hcLight:"#B5200D"},localize("minimapError","Minimap marker color for errors.")),minimapBackground=registerColor("minimap.background",null,localize("minimapBackground","Minimap background color.")),minimapForegroundOpacity=registerColor("minimap.foregroundOpacity",Color.fromHex("#000f"),localize("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));registerColor("minimapSlider.background",transparent(scrollbarSliderBackground,.5),localize("minimapSliderBackground","Minimap slider background color."));registerColor("minimapSlider.hoverBackground",transparent(scrollbarSliderHoverBackground,.5),localize("minimapSliderHoverBackground","Minimap slider background color when hovering."));registerColor("minimapSlider.activeBackground",transparent(scrollbarSliderActiveBackground,.5),localize("minimapSliderActiveBackground","Minimap slider background color when clicked on."));registerColor("charts.foreground",foreground,localize("chartsForeground","The foreground color used in charts."));registerColor("charts.lines",transparent(foreground,.5),localize("chartsLines","The color used for horizontal lines in charts."));registerColor("charts.red",editorErrorForeground,localize("chartsRed","The red color used in chart visualizations."));registerColor("charts.blue",editorInfoForeground,localize("chartsBlue","The blue color used in chart visualizations."));registerColor("charts.yellow",editorWarningForeground,localize("chartsYellow","The yellow color used in chart visualizations."));registerColor("charts.orange",minimapFindMatch,localize("chartsOrange","The orange color used in chart visualizations."));registerColor("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},localize("chartsGreen","The green color used in chart visualizations."));registerColor("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},localize("chartsPurple","The purple color used in chart visualizations."));const inputBackground=registerColor("input.background",{dark:"#3C3C3C",light:Color.white,hcDark:Color.black,hcLight:Color.white},localize("inputBoxBackground","Input box background.")),inputForeground=registerColor("input.foreground",foreground,localize("inputBoxForeground","Input box foreground.")),inputBorder=registerColor("input.border",{dark:null,light:null,hcDark:contrastBorder,hcLight:contrastBorder},localize("inputBoxBorder","Input box border.")),inputActiveOptionBorder=registerColor("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:contrastBorder,hcLight:contrastBorder},localize("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),inputActiveOptionHoverBackground=registerColor("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},localize("inputOption.hoverBackground","Background color of activated options in input fields.")),inputActiveOptionBackground=registerColor("inputOption.activeBackground",{dark:transparent(focusBorder,.4),light:transparent(focusBorder,.2),hcDark:Color.transparent,hcLight:Color.transparent},localize("inputOption.activeBackground","Background hover color of options in input fields.")),inputActiveOptionForeground=registerColor("inputOption.activeForeground",{dark:Color.white,light:Color.black,hcDark:foreground,hcLight:foreground},localize("inputOption.activeForeground","Foreground color of activated options in input fields."));registerColor("input.placeholderForeground",{light:transparent(foreground,.5),dark:transparent(foreground,.5),hcDark:transparent(foreground,.7),hcLight:transparent(foreground,.7)},localize("inputPlaceholderForeground","Input box foreground color for placeholder text."));const inputValidationInfoBackground=registerColor("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:Color.black,hcLight:Color.white},localize("inputValidationInfoBackground","Input validation background color for information severity.")),inputValidationInfoForeground=registerColor("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:foreground},localize("inputValidationInfoForeground","Input validation foreground color for information severity.")),inputValidationInfoBorder=registerColor("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:contrastBorder,hcLight:contrastBorder},localize("inputValidationInfoBorder","Input validation border color for information severity.")),inputValidationWarningBackground=registerColor("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:Color.black,hcLight:Color.white},localize("inputValidationWarningBackground","Input validation background color for warning severity.")),inputValidationWarningForeground=registerColor("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:foreground},localize("inputValidationWarningForeground","Input validation foreground color for warning severity.")),inputValidationWarningBorder=registerColor("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:contrastBorder,hcLight:contrastBorder},localize("inputValidationWarningBorder","Input validation border color for warning severity.")),inputValidationErrorBackground=registerColor("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:Color.black,hcLight:Color.white},localize("inputValidationErrorBackground","Input validation background color for error severity.")),inputValidationErrorForeground=registerColor("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:foreground},localize("inputValidationErrorForeground","Input validation foreground color for error severity.")),inputValidationErrorBorder=registerColor("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:contrastBorder,hcLight:contrastBorder},localize("inputValidationErrorBorder","Input validation border color for error severity.")),selectBackground=registerColor("dropdown.background",{dark:"#3C3C3C",light:Color.white,hcDark:Color.black,hcLight:Color.white},localize("dropdownBackground","Dropdown background.")),selectListBackground=registerColor("dropdown.listBackground",{dark:null,light:null,hcDark:Color.black,hcLight:Color.white},localize("dropdownListBackground","Dropdown list background.")),selectForeground=registerColor("dropdown.foreground",{dark:"#F0F0F0",light:foreground,hcDark:Color.white,hcLight:foreground},localize("dropdownForeground","Dropdown foreground.")),selectBorder=registerColor("dropdown.border",{dark:selectBackground,light:"#CECECE",hcDark:contrastBorder,hcLight:contrastBorder},localize("dropdownBorder","Dropdown border.")),buttonForeground=registerColor("button.foreground",Color.white,localize("buttonForeground","Button foreground color.")),buttonSeparator=registerColor("button.separator",transparent(buttonForeground,.4),localize("buttonSeparator","Button separator color.")),buttonBackground=registerColor("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},localize("buttonBackground","Button background color.")),buttonHoverBackground=registerColor("button.hoverBackground",{dark:lighten(buttonBackground,.2),light:darken(buttonBackground,.2),hcDark:buttonBackground,hcLight:buttonBackground},localize("buttonHoverBackground","Button background color when hovering.")),buttonBorder=registerColor("button.border",contrastBorder,localize("buttonBorder","Button border color.")),buttonSecondaryForeground=registerColor("button.secondaryForeground",{dark:Color.white,light:Color.white,hcDark:Color.white,hcLight:foreground},localize("buttonSecondaryForeground","Secondary button foreground color.")),buttonSecondaryBackground=registerColor("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:Color.white},localize("buttonSecondaryBackground","Secondary button background color.")),buttonSecondaryHoverBackground=registerColor("button.secondaryHoverBackground",{dark:lighten(buttonSecondaryBackground,.2),light:darken(buttonSecondaryBackground,.2),hcDark:null,hcLight:null},localize("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),radioActiveForeground=registerColor("radio.activeForeground",inputActiveOptionForeground,localize("radioActiveForeground","Foreground color of active radio option.")),radioActiveBackground=registerColor("radio.activeBackground",inputActiveOptionBackground,localize("radioBackground","Background color of active radio option.")),radioActiveBorder=registerColor("radio.activeBorder",inputActiveOptionBorder,localize("radioActiveBorder","Border color of the active radio option.")),radioInactiveForeground=registerColor("radio.inactiveForeground",null,localize("radioInactiveForeground","Foreground color of inactive radio option.")),radioInactiveBackground=registerColor("radio.inactiveBackground",null,localize("radioInactiveBackground","Background color of inactive radio option.")),radioInactiveBorder=registerColor("radio.inactiveBorder",{light:transparent(radioActiveForeground,.2),dark:transparent(radioActiveForeground,.2),hcDark:transparent(radioActiveForeground,.4),hcLight:transparent(radioActiveForeground,.2)},localize("radioInactiveBorder","Border color of the inactive radio option.")),radioInactiveHoverBackground=registerColor("radio.inactiveHoverBackground",inputActiveOptionHoverBackground,localize("radioHoverBackground","Background color of inactive active radio option when hovering.")),checkboxBackground=registerColor("checkbox.background",selectBackground,localize("checkbox.background","Background color of checkbox widget."));registerColor("checkbox.selectBackground",editorWidgetBackground,localize("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const checkboxForeground=registerColor("checkbox.foreground",selectForeground,localize("checkbox.foreground","Foreground color of checkbox widget.")),checkboxBorder=registerColor("checkbox.border",selectBorder,localize("checkbox.border","Border color of checkbox widget."));registerColor("checkbox.selectBorder",iconForeground,localize("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const keybindingLabelBackground=registerColor("keybindingLabel.background",{dark:new Color(new RGBA(128,128,128,.17)),light:new Color(new RGBA(221,221,221,.4)),hcDark:Color.transparent,hcLight:Color.transparent},localize("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelForeground=registerColor("keybindingLabel.foreground",{dark:Color.fromHex("#CCCCCC"),light:Color.fromHex("#555555"),hcDark:Color.white,hcLight:foreground},localize("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelBorder=registerColor("keybindingLabel.border",{dark:new Color(new RGBA(51,51,51,.6)),light:new Color(new RGBA(204,204,204,.4)),hcDark:new Color(new RGBA(111,195,223)),hcLight:contrastBorder},localize("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),keybindingLabelBottomBorder=registerColor("keybindingLabel.bottomBorder",{dark:new Color(new RGBA(68,68,68,.6)),light:new Color(new RGBA(187,187,187,.4)),hcDark:new Color(new RGBA(111,195,223)),hcLight:foreground},localize("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),listFocusBackground=registerColor("list.focusBackground",null,localize("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listFocusForeground=registerColor("list.focusForeground",null,localize("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listFocusOutline=registerColor("list.focusOutline",{dark:focusBorder,light:focusBorder,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listFocusAndSelectionOutline=registerColor("list.focusAndSelectionOutline",null,localize("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionBackground=registerColor("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:Color.fromHex("#0F4A85").transparent(.1)},localize("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionForeground=registerColor("list.activeSelectionForeground",{dark:Color.white,light:Color.white,hcDark:null,hcLight:null},localize("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listActiveSelectionIconForeground=registerColor("list.activeSelectionIconForeground",null,localize("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionBackground=registerColor("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:Color.fromHex("#0F4A85").transparent(.1)},localize("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionForeground=registerColor("list.inactiveSelectionForeground",null,localize("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveSelectionIconForeground=registerColor("list.inactiveSelectionIconForeground",null,localize("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveFocusBackground=registerColor("list.inactiveFocusBackground",null,localize("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listInactiveFocusOutline=registerColor("list.inactiveFocusOutline",null,localize("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),listHoverBackground=registerColor("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:Color.white.transparent(.1),hcLight:Color.fromHex("#0F4A85").transparent(.1)},localize("listHoverBackground","List/Tree background when hovering over items using the mouse.")),listHoverForeground=registerColor("list.hoverForeground",null,localize("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),listDropOverBackground=registerColor("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},localize("listDropBackground","List/Tree drag and drop background when moving items over other items when using the mouse.")),listDropBetweenBackground=registerColor("list.dropBetweenBackground",{dark:iconForeground,light:iconForeground,hcDark:null,hcLight:null},localize("listDropBetweenBackground","List/Tree drag and drop border color when moving items between items when using the mouse.")),listHighlightForeground=registerColor("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:focusBorder,hcLight:focusBorder},localize("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),listFocusHighlightForeground=registerColor("list.focusHighlightForeground",{dark:listHighlightForeground,light:ifDefinedThenElse(listActiveSelectionBackground,listHighlightForeground,"#BBE7FF"),hcDark:listHighlightForeground,hcLight:listHighlightForeground},localize("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));registerColor("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},localize("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));registerColor("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},localize("listErrorForeground","Foreground color of list items containing errors."));registerColor("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},localize("listWarningForeground","Foreground color of list items containing warnings."));const listFilterWidgetBackground=registerColor("listFilterWidget.background",{light:darken(editorWidgetBackground,0),dark:lighten(editorWidgetBackground,0),hcDark:editorWidgetBackground,hcLight:editorWidgetBackground},localize("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),listFilterWidgetOutline=registerColor("listFilterWidget.outline",{dark:Color.transparent,light:Color.transparent,hcDark:"#f38518",hcLight:"#007ACC"},localize("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),listFilterWidgetNoMatchesOutline=registerColor("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:contrastBorder,hcLight:contrastBorder},localize("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),listFilterWidgetShadow=registerColor("listFilterWidget.shadow",widgetShadow,localize("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));registerColor("list.filterMatchBackground",{dark:editorFindMatchHighlight,light:editorFindMatchHighlight,hcDark:null,hcLight:null},localize("listFilterMatchHighlight","Background color of the filtered match."));registerColor("list.filterMatchBorder",{dark:editorFindMatchHighlightBorder,light:editorFindMatchHighlightBorder,hcDark:contrastBorder,hcLight:activeContrastBorder},localize("listFilterMatchHighlightBorder","Border color of the filtered match."));registerColor("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},localize("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized."));const treeIndentGuidesStroke=registerColor("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},localize("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),treeInactiveIndentGuidesStroke=registerColor("tree.inactiveIndentGuidesStroke",transparent(treeIndentGuidesStroke,.4),localize("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),tableColumnsBorder=registerColor("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},localize("tableColumnsBorder","Table border color between columns.")),tableOddRowsBackgroundColor=registerColor("tree.tableOddRowsBackground",{dark:transparent(foreground,.04),light:transparent(foreground,.04),hcDark:null,hcLight:null},localize("tableOddRowsBackgroundColor","Background color for odd table rows."));registerColor("editorActionList.background",editorWidgetBackground,localize("editorActionListBackground","Action List background color."));registerColor("editorActionList.foreground",editorWidgetForeground,localize("editorActionListForeground","Action List foreground color."));registerColor("editorActionList.focusForeground",listActiveSelectionForeground,localize("editorActionListFocusForeground","Action List foreground color for the focused item."));registerColor("editorActionList.focusBackground",listActiveSelectionBackground,localize("editorActionListFocusBackground","Action List background color for the focused item."));const menuBorder=registerColor("menu.border",{dark:null,light:null,hcDark:contrastBorder,hcLight:contrastBorder},localize("menuBorder","Border color of menus.")),menuForeground=registerColor("menu.foreground",selectForeground,localize("menuForeground","Foreground color of menu items.")),menuBackground=registerColor("menu.background",selectBackground,localize("menuBackground","Background color of menu items.")),menuSelectionForeground=registerColor("menu.selectionForeground",listActiveSelectionForeground,localize("menuSelectionForeground","Foreground color of the selected menu item in menus.")),menuSelectionBackground=registerColor("menu.selectionBackground",listActiveSelectionBackground,localize("menuSelectionBackground","Background color of the selected menu item in menus.")),menuSelectionBorder=registerColor("menu.selectionBorder",{dark:null,light:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("menuSelectionBorder","Border color of the selected menu item in menus.")),menuSeparatorBackground=registerColor("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:contrastBorder,hcLight:contrastBorder},localize("menuSeparatorBackground","Color of a separator menu item in menus.")),quickInputBackground=registerColor("quickInput.background",editorWidgetBackground,localize("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),quickInputForeground=registerColor("quickInput.foreground",editorWidgetForeground,localize("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),quickInputTitleBackground=registerColor("quickInputTitle.background",{dark:new Color(new RGBA(255,255,255,.105)),light:new Color(new RGBA(0,0,0,.06)),hcDark:"#000000",hcLight:Color.white},localize("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),pickerGroupForeground=registerColor("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:Color.white,hcLight:"#0F4A85"},localize("pickerGroupForeground","Quick picker color for grouping labels.")),pickerGroupBorder=registerColor("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:Color.white,hcLight:"#0F4A85"},localize("pickerGroupBorder","Quick picker color for grouping borders.")),_deprecatedQuickInputListFocusBackground=registerColor("quickInput.list.focusBackground",null,"",void 0,localize("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),quickInputListFocusForeground=registerColor("quickInputList.focusForeground",listActiveSelectionForeground,localize("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),quickInputListFocusIconForeground=registerColor("quickInputList.focusIconForeground",listActiveSelectionIconForeground,localize("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),quickInputListFocusBackground=registerColor("quickInputList.focusBackground",{dark:oneOf(_deprecatedQuickInputListFocusBackground,listActiveSelectionBackground),light:oneOf(_deprecatedQuickInputListFocusBackground,listActiveSelectionBackground),hcDark:null,hcLight:null},localize("quickInput.listFocusBackground","Quick picker background color for the focused item."));registerColor("search.resultsInfoForeground",{light:foreground,dark:transparent(foreground,.65),hcDark:foreground,hcLight:foreground},localize("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));registerColor("searchEditor.findMatchBackground",{light:transparent(editorFindMatchHighlight,.66),dark:transparent(editorFindMatchHighlight,.66),hcDark:editorFindMatchHighlight,hcLight:editorFindMatchHighlight},localize("searchEditor.queryMatch","Color of the Search Editor query matches."));registerColor("searchEditor.findMatchBorder",{light:transparent(editorFindMatchHighlightBorder,.66),dark:transparent(editorFindMatchHighlightBorder,.66),hcDark:editorFindMatchHighlightBorder,hcLight:editorFindMatchHighlightBorder},localize("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));var __decorate$2r=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2l=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const IHoverService=createDecorator("hoverService");let WorkbenchHoverDelegate=class extends Disposable{get delay(){return this.isInstantlyHovering()?0:this._delay}constructor(e,t,i={},s,r){super(),this.placement=e,this.instantHover=t,this.overrideOptions=i,this.configurationService=s,this.hoverService=r,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new DisposableStore),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i=typeof this.overrideOptions=="function"?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const s=isHTMLElement(e.target)?[e.target]:e.target.targetElements;for(const o of s)this.hoverDisposables.add(addStandardDisposableListener(o,"keydown",a=>{a.equals(9)&&this.hoverService.hideHover()}));const r=isHTMLElement(e.content)?void 0:e.content.toString();return this.hoverService.showHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:r,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return this.instantHover&&Date.now()-this.lastHoverHideTime{try{e.releasePointerCapture(t)}catch{}}))}catch{o=getWindow(e)}this._hooks.add(addDisposableListener(o,EventType$1.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(addDisposableListener(o,EventType$1.POINTER_UP,a=>this.stopMonitoring(!0)))}}function memoize(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const r=`$memoize$${e}`;t[i]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,o)}),this[r]}}var __decorate$2q=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},EventType;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(EventType||(EventType={}));const Wi=class Wi extends Disposable{constructor(){super(),this.dispatched=!1,this.targets=new LinkedList,this.ignoreTargets=new LinkedList,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Event$1.runAndSubscribe(onDidRegisterWindow,({window:e,disposables:t})=>{t.add(addDisposableListener(e.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),t.add(addDisposableListener(e.document,"touchend",i=>this.onTouchEnd(e,i))),t.add(addDisposableListener(e.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:mainWindow,disposables:this._store}))}static addTarget(e){if(!Wi.isTouchDevice())return Disposable.None;Wi.INSTANCE||(Wi.INSTANCE=new Wi);const t=Wi.INSTANCE.targets.push(e);return toDisposable(t)}static ignoreTarget(e){if(!Wi.isTouchDevice())return Disposable.None;Wi.INSTANCE||(Wi.INSTANCE=new Wi);const t=Wi.INSTANCE.ignoreTargets.push(e);return toDisposable(t)}static isTouchDevice(){return"ontouchstart"in mainWindow||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Wi.HOLD_DELAY&&Math.abs(l.initialPageX-tail(l.rollingPageX))<30&&Math.abs(l.initialPageY-tail(l.rollingPageY))<30){const d=this.newGestureEvent(EventType.Contextmenu,l.initialTarget);d.pageX=tail(l.rollingPageX),d.pageY=tail(l.rollingPageY),this.dispatchEvent(d)}else if(s===1){const d=tail(l.rollingPageX),u=tail(l.rollingPageY),f=tail(l.rollingTimestamps)-l.rollingTimestamps[0],g=d-l.rollingPageX[0],m=u-l.rollingPageY[0],_=[...this.targets].filter(v=>l.initialTarget instanceof Node&&v.contains(l.initialTarget));this.inertia(e,_,i,Math.abs(g)/f,g>0?1:-1,d,Math.abs(m)/f,m>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(EventType.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===EventType.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Wi.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===EventType.Change||e.type===EventType.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let s=0,r=e.initialTarget;for(;r&&r!==i;)s++,r=r.parentElement;t.push([s,i])}t.sort((i,s)=>i[0]-s[0]);for(const[i,s]of t)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,s,r,o,a,l,c){this.handle=scheduleAtNextAnimationFrame(e,()=>{const d=Date.now(),u=d-i;let f=0,g=0,m=!0;s+=Wi.SCROLL_FRICTION*u,a+=Wi.SCROLL_FRICTION*u,s>0&&(m=!1,f=r*s*u),a>0&&(m=!1,g=l*a*u);const _=this.newGestureEvent(EventType.Change);_.translationX=f,_.translationY=g,t.forEach(v=>v.dispatchEvent(_)),m||this.inertia(e,t,d,s,r,o+f,a,l,c+g)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};Wi.SCROLL_FRICTION=-.005,Wi.HOLD_DELAY=700,Wi.CLEAR_TAP_COUNT_TIME=400;let Gesture=Wi;__decorate$2q([memoize],Gesture,"isTouchDevice",null);let Widget$1=class extends Disposable{onclick(e,t){this._register(addDisposableListener(e,EventType$1.CLICK,i=>t(new StandardMouseEvent(getWindow(e),i))))}onmousedown(e,t){this._register(addDisposableListener(e,EventType$1.MOUSE_DOWN,i=>t(new StandardMouseEvent(getWindow(e),i))))}onmouseover(e,t){this._register(addDisposableListener(e,EventType$1.MOUSE_OVER,i=>t(new StandardMouseEvent(getWindow(e),i))))}onmouseleave(e,t){this._register(addDisposableListener(e,EventType$1.MOUSE_LEAVE,i=>t(new StandardMouseEvent(getWindow(e),i))))}onkeydown(e,t){this._register(addDisposableListener(e,EventType$1.KEY_DOWN,i=>t(new StandardKeyboardEvent(i))))}onkeyup(e,t){this._register(addDisposableListener(e,EventType$1.KEY_UP,i=>t(new StandardKeyboardEvent(i))))}oninput(e,t){this._register(addDisposableListener(e,EventType$1.INPUT,t))}onblur(e,t){this._register(addDisposableListener(e,EventType$1.BLUR,t))}onfocus(e,t){this._register(addDisposableListener(e,EventType$1.FOCUS,t))}ignoreGesture(e){return Gesture.ignoreTarget(e)}};const ARROW_IMG_SIZE=11;class ScrollbarArrow extends Widget$1{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...ThemeIcon.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=ARROW_IMG_SIZE+"px",this.domNode.style.height=ARROW_IMG_SIZE+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new GlobalPointerMoveMonitor),this._register(addStandardDisposableListener(this.bgDomNode,EventType$1.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(addStandardDisposableListener(this.domNode,EventType$1.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new WindowIntervalTimer),this._pointerdownScheduleRepeatTimer=this._register(new TimeoutTimer)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,getWindow(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class ScrollbarVisibilityController extends Disposable{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new TimeoutTimer)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const POINTER_DRAG_RESET_DISTANCE$1=140;class AbstractScrollbar extends Widget$1{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new ScrollbarVisibilityController(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new GlobalPointerMoveMonitor),this._shouldRender=!0,this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(addDisposableListener(this.domNode.domNode,EventType$1.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new ScrollbarArrow(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=createFastDomNode(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(addDisposableListener(this.slider.domNode,EventType$1.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const r=getDomNodePagePosition(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{const o=this._sliderOrthogonalPointerPosition(r),a=Math.abs(o-i);if(isWindows&&a>POINTER_DRAG_RESET_DISTANCE$1){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const c=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const MINIMUM_SLIDER_SIZE=20;class ScrollbarState{constructor(e,t,i,s,r,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ScrollbarState(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,r){const o=Math.max(0,i-e),a=Math.max(0,o-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(MINIMUM_SLIDER_SIZE,Math.floor(i*a/s))),d=(a-c)/(s-i),u=r*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=ScrollbarState._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new StandardWheelEvent(null,1,0))}),this._createArrow({className:"scra",icon:Codicon.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:o,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class VerticalScrollbar extends AbstractScrollbar{constructor(e,t,i){const s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new ScrollbarState(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const o=(t.arrowSize-ARROW_IMG_SIZE)/2,a=(t.verticalScrollbarSize-ARROW_IMG_SIZE)/2;this._createArrow({className:"scra",icon:Codicon.scrollbarButtonUp,top:o,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,0,1))}),this._createArrow({className:"scra",icon:Codicon.scrollbarButtonDown,top:void 0,left:a,bottom:o,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new StandardWheelEvent(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class ScrollState{constructor(e,t,i,s,r,o,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,s=s|0,r=r|0,o=o|0,a=a|0),this.rawScrollLeft=s,this.rawScrollTop=a,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),r<0&&(r=0),a+r>o&&(a=o-r),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=r,this.scrollHeight=o,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new ScrollState(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new ScrollState(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}}class Scrollable extends Disposable{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Emitter$1),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ScrollState(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var s;const i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),(s=this._smoothScrolling)==null||s.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new SmoothScrollingOperation(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=SmoothScrollingOperation.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class SmoothScrollingUpdate{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function createEaseOutCubic(n,e){const t=e-n;return function(i){return n+t*easeOutCubic(i)}}function createComposed(n,e,t){return function(i){return i2.5*i){let r,o;return e0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(i+=.25),t){const s=Math.abs(e.deltaX),r=Math.abs(e.deltaY),o=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.max(Math.min(s,o),1),c=Math.max(Math.min(r,a),1),d=Math.max(s,o),u=Math.max(r,a);d%l===0&&u%c===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};$h.INSTANCE=new $h;let MouseWheelClassifier=$h;class AbstractScrollableElement extends Widget$1{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new Emitter$1),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Emitter$1),e.style.overflow="hidden",this._options=resolveOptions$1(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));const s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new VerticalScrollbar(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new HorizontalScrollbar(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=createFastDomNode(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=createFastDomNode(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=createFastDomNode(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new TimeoutTimer),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=dispose(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,isMacintosh&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new StandardWheelEvent(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=dispose(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new StandardWheelEvent(s))};this._mouseWheelToDispose.push(addDisposableListener(this._listenOnDomNode,EventType$1.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var r;if((r=e.browserEvent)!=null&&r.defaultPrevented)return;const t=MouseWheelClassifier.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+o===0?a=o=0:Math.abs(o)>=Math.abs(a)?a=0:o=0),this._options.flipAxes&&([o,a]=[a,o]);const l=!isMacintosh&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(o){const u=SCROLL_WHEEL_SENSITIVITY*o,f=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,f)}if(a){const u=SCROLL_WHEEL_SENSITIVITY*a,f=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,f)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),HIDE_TIMEOUT)}}class ScrollableElement extends AbstractScrollableElement{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Scrollable({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>scheduleAtNextAnimationFrame(getWindow(e),s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class SmoothScrollableElement extends AbstractScrollableElement{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class DomScrollableElement extends AbstractScrollableElement{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Scrollable({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>scheduleAtNextAnimationFrame(getWindow(e),s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function resolveOptions$1(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,isMacintosh&&(e.className+=" mac"),e}const hoverWidget="",$$d=$$e;let HoverWidget$1=class extends Disposable{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 DomScrollableElement(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}};class HoverAction extends Disposable{static render(e,t,i){return new HoverAction(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=append$1(e,$$d("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=append$1(this.actionContainer,$$d("a.action")),this.action.setAttribute("role","button"),t.iconClass&&append$1(this.action,$$d(`span.icon.${t.iconClass}`));const s=append$1(this.action,$$d("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._store.add(new ClickAction(this.actionContainer,t.run)),this._store.add(new KeyDownAction(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function getHoverAccessibleViewHint(n,e){return n&&e?localize("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?localize("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}class ClickAction extends Disposable{constructor(e,t){super(),this._register(addDisposableListener(e,EventType$1.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class KeyDownAction extends Disposable{constructor(e,t,i){super(),this._register(addDisposableListener(e,EventType$1.KEY_DOWN,s=>{const r=new StandardKeyboardEvent(s);i.some(o=>r.equals(o))&&(s.stopPropagation(),s.preventDefault(),t(e))}))}}const IOpenerService=createDecorator("openerService");function extractSelection(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}class DomEmitter{get event(){return this.emitter.event}constructor(e,t,i){const s=r=>this.emitter.fire(r);this.emitter=new Emitter$1({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}function renderText(n,e={}){const t=createElement(e);return t.textContent=n,t}function renderFormattedText(n,e={}){const t=createElement(e);return _renderFormattedText(t,parseFormattedText(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function createElement(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class StringStream{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function _renderFormattedText(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const r=document.createElement("a");t.disposables.add(addStandardDisposableListener(r,"click",o=>{t.callback(String(e.index),o)})),s=r}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(r=>{_renderFormattedText(s,r,t,i)})}function parseFormattedText(n,e){const t={type:1,children:[]};let i=0,s=t;const r=[],o=new StringStream(n);for(;!o.eos();){let a=o.next();const l=a==="\\"&&formatTagType(o.peek(),e)!==0;if(l&&(a=o.next()),!l&&isFormatTag(a,e)&&a===o.peek()){o.advance(),s.type===2&&(s=r.pop());const c=formatTagType(a,e);if(s.type===c||s.type===5&&c===6)s=r.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),r.push(s),s=d}}else if(a===` +`)s.type===2&&(s=r.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),r.push(s),s=c}else s.content+=a}return s.type===2&&(s=r.pop()),t}function isFormatTag(n,e){return formatTagType(n,e)!==0}function formatTagType(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const labelWithIconsRegex=new RegExp(`(\\\\)?\\$\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\)`,"g");function renderLabelWithIcons(n){const e=new Array;let t,i=0,s=0;for(;(t=labelWithIconsRegex.exec(n))!==null;){s=t.index||0,i0)return new Uint32Array(e)}let codeBufferLength=0;const codeBuffer=new Uint32Array(10);function disassembleKorean(n){if(codeBufferLength=0,getCodesFromArray(n,modernConsonants,4352),codeBufferLength>0||(getCodesFromArray(n,modernVowels,4449),codeBufferLength>0)||(getCodesFromArray(n,modernFinalConsonants,4520),codeBufferLength>0)||(getCodesFromArray(n,compatibilityJamo,12593),codeBufferLength))return codeBuffer.subarray(0,codeBufferLength);if(n>=44032&&n<=55203){const e=n-44032,t=e%588,i=Math.floor(e/588),s=Math.floor(t/28),r=t%28-1;if(i=0&&(r0)return codeBuffer.subarray(0,codeBufferLength)}}function getCodesFromArray(n,e,t){n>=t&&n>8&&(codeBuffer[codeBufferLength++]=n>>8&255),n>>16&&(codeBuffer[codeBufferLength++]=n>>16&255))}const modernConsonants=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),modernVowels=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),modernFinalConsonants=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),compatibilityJamo=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function or(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function matchesContiguousSubString(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function matchesSubString(n,e){return _matchesSubString(n.toLowerCase(),e.toLowerCase(),0,0)}function _matchesSubString(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=_matchesSubString(n,e,t+1,i+1))?join$1({start:i,end:i+1},s):null}return _matchesSubString(n,e,t,i+1)}function isLower(n){return 97<=n&&n<=122}function isUpper(n){return 65<=n&&n<=90}function isNumber$2(n){return 48<=n&&n<=57}function isWhitespace$1(n){return n===32||n===9||n===10||n===13}const wordSeparators=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>wordSeparators.add(n.charCodeAt(0)));function isWordSeparator(n){return isWhitespace$1(n)||wordSeparators.has(n)}function charactersMatch(n,e){return n===e||isWordSeparator(n)&&isWordSeparator(e)}const alternateCharsCache=new Map;function getAlternateCodes(n){if(alternateCharsCache.has(n))return alternateCharsCache.get(n);let e;const t=getKoreanAltChars(n);return t&&(e=t),alternateCharsCache.set(n,e),e}function isAlphanumeric(n){return isLower(n)||isUpper(n)||isNumber$2(n)}function join$1(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function nextAnchor(n,e){for(let t=e;t0&&!isAlphanumeric(n.charCodeAt(t-1)))return t}return n.length}function _matchesCamelCase(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,r=i+1;for(s=_matchesCamelCase(n,e,t+1,i+1);!s&&(r=nextAnchor(e,r)).6}function isCamelCaseWord(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function isCamelCasePattern(n){let e=0,t=0,i=0,s=0;for(let r=0;r60&&(e=e.substring(0,60));const t=analyzeCamelCaseWord(e);if(!isCamelCaseWord(t)){if(!isUpperCaseWord(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s0&&isWordSeparator(n.charCodeAt(t-1)))return t;return n.length}const fuzzyContiguousFilter=or(matchesPrefix,matchesCamelCase,matchesContiguousSubString),fuzzySeparateFilter=or(matchesPrefix,matchesCamelCase,matchesSubString),fuzzyRegExpCache=new LRUCache(1e4);function matchesFuzzy(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=fuzzyRegExpCache.get(n);i||(i=new RegExp(convertSimple2RegExpPattern(n),"i"),fuzzyRegExpCache.set(n,i));const s=i.exec(e);return s?[{start:s.index,end:s.index+s[0].length}]:t?fuzzySeparateFilter(n,e):fuzzyContiguousFilter(n,e)}function matchesFuzzy2(n,e){const t=fuzzyScore(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?createMatches(t):null}function anyScore(n,e,t,i,s,r){const o=Math.min(13,n.length);for(;t"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,r=e[e.length-1];r&&r.end===s?r.end=s+1:e.push({start:s,end:s+1})}return e}const _maxLen=128;function initTable(){const n=[],e=[];for(let t=0;t<=_maxLen;t++)e[t]=0;for(let t=0;t<=_maxLen;t++)n.push(e.slice(0));return n}function initArr(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const _minWordMatchPos=initArr(2*_maxLen),_maxWordMatchPos=initArr(2*_maxLen),_diag=initTable(),_table=initTable(),_arrows=initTable();function isSeparatorAtPos(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!isEmojiImprecise(t)}}function isWhitespaceAtPos(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function isUpperCaseAtPos(n,e,t){return e[n]!==t[n]}function isPatternInWord(n,e,t,i,s,r,o=!1){for(;e_maxLen?_maxLen:n.length,l=i.length>_maxLen?_maxLen:i.length;if(t>=a||r>=l||a-t>l-r||!isPatternInWord(e,t,a,s,r,l,!0))return;_fillInMaxWordMatchPos(a,l,t,r,e,s);let c=1,d=1,u=t,f=r;const g=[!1];for(c=1,u=t;uS,A=T?_table[c][d-1]+(_diag[c][d-1]>0?-5:0):0,F=f>S+1&&_diag[c][d-1]>0,B=F?_table[c][d-2]+(_diag[c][d-2]>0?-5:0):0;if(F&&(!T||B>=A)&&(!N||B>=R))_table[c][d]=B,_arrows[c][d]=3,_diag[c][d]=0;else if(T&&(!N||A>=R))_table[c][d]=A,_arrows[c][d]=2,_diag[c][d]=0;else if(N)_table[c][d]=R,_arrows[c][d]=1,_diag[c][d]=_diag[c-1][d-1]+1;else throw new Error("not possible")}}if(!g[0]&&!o.firstMatchCanBeWeak)return;c--,d--;const m=[_table[c][d],r];let _=0,v=0;for(;c>=1;){let S=d;do{const w=_arrows[c][S];if(w===3)S=S-2;else if(w===2)S=S-1;else break}while(S>=1);_>1&&e[t+c-1]===s[r+d-1]&&!isUpperCaseAtPos(S+r-1,i,s)&&_+1>_diag[c][S]&&(S=d),S===d?_++:_=1,v||(v=S),c--,d=S-1,m.push(d)}l-r===a&&o.boostFullMatch&&(m[0]+=2);const C=v-a;return m[0]-=C,m}function _fillInMaxWordMatchPos(n,e,t,i,s,r){let o=n-1,a=e-1;for(;o>=t&&a>=i;)s[o]===r[a]&&(_maxWordMatchPos[o]=a,o--),a--}function _doScore(n,e,t,i,s,r,o,a,l,c,d){if(e[t]!==r[o])return Number.MIN_SAFE_INTEGER;let u=1,f=!1;return o===t-i?u=n[t]===s[o]?7:5:isUpperCaseAtPos(o,s,r)&&(o===0||!isUpperCaseAtPos(o-1,s,r))?(u=n[t]===s[o]?7:5,f=!0):isSeparatorAtPos(r,o)&&(o===0||!isSeparatorAtPos(r,o-1))?u=5:(isSeparatorAtPos(r,o-1)||isWhitespaceAtPos(r,o-1))&&(u=5,f=!0),u>1&&t===i&&(d[0]=!0),f||(f=isUpperCaseAtPos(o,s,r)||isSeparatorAtPos(r,o-1)||isWhitespaceAtPos(r,o-1)),t===i?o>l&&(u-=f?3:5):c?u+=f?2:0:u+=f?0:1,o+1===a&&(u-=f?3:5),u}function fuzzyScoreGracefulAggressive(n,e,t,i,s,r,o){return fuzzyScoreWithPermutations(n,e,t,i,s,r,!0,o)}function fuzzyScoreWithPermutations(n,e,t,i,s,r,o,a){let l=fuzzyScore(n,e,t,i,s,r,a);if(l&&!o)return l;if(n.length>=3){const c=Math.min(7,n.length-1);for(let d=t+1;dl[0])&&(l=f))}}}return l}function nextTypoPermutation(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const iconStartMarker="$(",iconsRegex=new RegExp(`\\$\\(${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?\\)`,"g"),escapeIconsRegex=new RegExp(`(\\\\)?${iconsRegex.source}`,"g");function escapeIcons(n){return n.replace(escapeIconsRegex,(e,t)=>t?e:`\\${e}`)}const markdownEscapedIconsRegex=new RegExp(`\\\\${iconsRegex.source}`,"g");function markdownEscapeEscapedIcons(n){return n.replace(markdownEscapedIconsRegex,e=>`\\${e}`)}const stripIconsRegex=new RegExp(`(\\s)?(\\\\)?${iconsRegex.source}(\\s)?`,"g");function stripIcons(n){return n.indexOf(iconStartMarker)===-1?n:n.replace(stripIconsRegex,(e,t,i,s)=>i?e:t||s||"")}function getCodiconAriaLabel(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const _parseIconsRegex=new RegExp(`\\$\\(${ThemeIcon.iconNameCharacter}+\\)`,"g");function parseLabelWithIcons(n){_parseIconsRegex.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=_parseIconsRegex.lastIndex,r=_parseIconsRegex.exec(n),o=n.substring(s,r==null?void 0:r.index);if(o.length>0){e+=o;for(let a=0;agetRoot(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=sep$1){return hasTrailingPathSeparator(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sep$1){let i=!1;if(e.scheme===Schemas.file){const s=originalFSPath(e);i=s!==void 0&&s.length===getRoot(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!hasTrailingPathSeparator(e,t)?e.with({path:e.path+"/"}):e}}const extUri=new ExtUri(()=>!1),isEqual=extUri.isEqual.bind(extUri);extUri.isEqualOrParent.bind(extUri);extUri.getComparisonKey.bind(extUri);const basenameOrAuthority=extUri.basenameOrAuthority.bind(extUri),basename$1=extUri.basename.bind(extUri),extname$1=extUri.extname.bind(extUri),dirname$1=extUri.dirname.bind(extUri),joinPath=extUri.joinPath.bind(extUri),normalizePath=extUri.normalizePath.bind(extUri),relativePath=extUri.relativePath.bind(extUri),resolvePath=extUri.resolvePath.bind(extUri);extUri.isAbsolutePath.bind(extUri);const isEqualAuthority=extUri.isEqualAuthority.bind(extUri),hasTrailingPathSeparator=extUri.hasTrailingPathSeparator.bind(extUri);extUri.removeTrailingPathSeparator.bind(extUri);extUri.addTrailingPathSeparator.bind(extUri);var DataUri;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(o=>{const[a,l]=o.split(":");a&&l&&i.set(a,l)});const r=t.path.substring(0,t.path.indexOf(";"));return r&&i.set(n.META_DATA_MIME,r),i}n.parseMetaData=e})(DataUri||(DataUri={}));class MarkdownString{constructor(e="",t=!1){if(this.value=e,typeof this.value!="string")throw illegalArgument("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=0){return this.value+=escapeMarkdownSyntaxTokens(this.supportThemeIcons?escapeIcons(e):e).replace(/([ \t]+)/g,(i,s)=>" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`:` + +`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=` +${appendEscapedMarkdownCodeBlockFence(t,e)} +`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(escapeRegExpCharacters(t),"g");return e.replace(i,(s,r)=>e.charAt(r-1)!=="\\"?`\\${s}`:s)}}function isEmptyMarkdownString(n){return isMarkdownString(n)?!n.value:Array.isArray(n)?n.every(isEmptyMarkdownString):!0}function isMarkdownString(n){return n instanceof MarkdownString?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function markdownStringEqual(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&isEqual(URI.from(n.baseUri),URI.from(e.baseUri)))}function escapeMarkdownSyntaxTokens(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function appendEscapedMarkdownCodeBlockFence(n,e){var s;const t=((s=n.match(/^`+/gm))==null?void 0:s.reduce((r,o)=>r.length>o.length?r:o).length)??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,n,`${"`".repeat(i)}`].join(` +`)}function escapeDoubleQuotes(n){return n.replace(/"/g,""")}function removeMarkdownEscapes(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function parseHrefAndDimensions(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),r=/width=(\d+)/.exec(i),o=s?s[1]:"",a=r?r[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(o));l&&e.push(`width="${a}"`),c&&e.push(`height="${o}"`)}return{href:n,dimensions:e}}class IdGenerator{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const defaultGenerator=new IdGenerator("id#");let __marked_exports={};(function(){function n(e,t){t(__marked_exports)}n.amd=!0,function(e,t){typeof n=="function"&&n.amd?n(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}e.defaults=t();function i(vt){e.defaults=vt}const s=/[&<>"']/,r=new RegExp(s.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,a=new RegExp(o.source,"g"),l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=vt=>l[vt];function d(vt,te){if(te){if(s.test(vt))return vt.replace(r,c)}else if(o.test(vt))return vt.replace(a,c);return vt}const u=/(^|[^\[])\^/g;function f(vt,te){let se=typeof vt=="string"?vt:vt.source;te=te||"";const oe={replace:(ge,_e)=>{let Ee=typeof _e=="string"?_e:_e.source;return Ee=Ee.replace(u,"$1"),se=se.replace(ge,Ee),oe},getRegex:()=>new RegExp(se,te)};return oe}function g(vt){try{vt=encodeURI(vt).replace(/%25/g,"%")}catch{return null}return vt}const m={exec:()=>null};function _(vt,te){const se=vt.replace(/\|/g,(_e,Ee,Ae)=>{let Ye=!1,it=Ee;for(;--it>=0&&Ae[it]==="\\";)Ye=!Ye;return Ye?"|":" |"}),oe=se.split(/ \|/);let ge=0;if(oe[0].trim()||oe.shift(),oe.length>0&&!oe[oe.length-1].trim()&&oe.pop(),te)if(oe.length>te)oe.splice(te);else for(;oe.length{const _e=ge.match(/^\s+/);if(_e===null)return ge;const[Ee]=_e;return Ee.length>=oe.length?ge.slice(oe.length):ge}).join(` +`)}class L{constructor(te){Ii(this,"options");Ii(this,"rules");Ii(this,"lexer");this.options=te||e.defaults}space(te){const se=this.rules.block.newline.exec(te);if(se&&se[0].length>0)return{type:"space",raw:se[0]}}code(te){const se=this.rules.block.code.exec(te);if(se){const oe=se[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:v(oe,` +`)}}}fences(te){const se=this.rules.block.fences.exec(te);if(se){const oe=se[0],ge=w(oe,se[3]||"");return{type:"code",raw:oe,lang:se[2]?se[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):se[2],text:ge}}}heading(te){const se=this.rules.block.heading.exec(te);if(se){let oe=se[2].trim();if(/#$/.test(oe)){const ge=v(oe,"#");(this.options.pedantic||!ge||/ $/.test(ge))&&(oe=ge.trim())}return{type:"heading",raw:se[0],depth:se[1].length,text:oe,tokens:this.lexer.inline(oe)}}}hr(te){const se=this.rules.block.hr.exec(te);if(se)return{type:"hr",raw:v(se[0],` +`)}}blockquote(te){const se=this.rules.block.blockquote.exec(te);if(se){let oe=v(se[0],` +`).split(` +`),ge="",_e="";const Ee=[];for(;oe.length>0;){let Ae=!1;const Ye=[];let it;for(it=0;it/.test(oe[it]))Ye.push(oe[it]),Ae=!0;else if(!Ae)Ye.push(oe[it]);else break;oe=oe.slice(it);const bt=Ye.join(` +`),Dt=bt.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` + $1`).replace(/^ {0,3}>[ \t]?/gm,"");ge=ge?`${ge} +${bt}`:bt,_e=_e?`${_e} +${Dt}`:Dt;const It=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(Dt,Ee,!0),this.lexer.state.top=It,oe.length===0)break;const Wt=Ee[Ee.length-1];if((Wt==null?void 0:Wt.type)==="code")break;if((Wt==null?void 0:Wt.type)==="blockquote"){const Yt=Wt,Ri=Yt.raw+` +`+oe.join(` +`),Hi=this.blockquote(Ri);Ee[Ee.length-1]=Hi,ge=ge.substring(0,ge.length-Yt.raw.length)+Hi.raw,_e=_e.substring(0,_e.length-Yt.text.length)+Hi.text;break}else if((Wt==null?void 0:Wt.type)==="list"){const Yt=Wt,Ri=Yt.raw+` +`+oe.join(` +`),Hi=this.list(Ri);Ee[Ee.length-1]=Hi,ge=ge.substring(0,ge.length-Wt.raw.length)+Hi.raw,_e=_e.substring(0,_e.length-Yt.raw.length)+Hi.raw,oe=Ri.substring(Ee[Ee.length-1].raw.length).split(` +`);continue}}return{type:"blockquote",raw:ge,tokens:Ee,text:_e}}}list(te){let se=this.rules.block.list.exec(te);if(se){let oe=se[1].trim();const ge=oe.length>1,_e={type:"list",raw:"",ordered:ge,start:ge?+oe.slice(0,-1):"",loose:!1,items:[]};oe=ge?`\\d{1,9}\\${oe.slice(-1)}`:`\\${oe}`,this.options.pedantic&&(oe=ge?oe:"[*+-]");const Ee=new RegExp(`^( {0,3}${oe})((?:[ ][^\\n]*)?(?:\\n|$))`);let Ae=!1;for(;te;){let Ye=!1,it="",bt="";if(!(se=Ee.exec(te))||this.rules.block.hr.test(te))break;it=se[0],te=te.substring(it.length);let Dt=se[2].split(` +`,1)[0].replace(/^\t+/,ys=>" ".repeat(3*ys.length)),It=te.split(` +`,1)[0],Wt=!Dt.trim(),Yt=0;if(this.options.pedantic?(Yt=2,bt=Dt.trimStart()):Wt?Yt=se[1].length+1:(Yt=se[2].search(/[^ ]/),Yt=Yt>4?1:Yt,bt=Dt.slice(Yt),Yt+=se[1].length),Wt&&/^ *$/.test(It)&&(it+=It+` +`,te=te.substring(It.length+1),Ye=!0),!Ye){const ys=new RegExp(`^ {0,${Math.min(3,Yt-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),gt=new RegExp(`^ {0,${Math.min(3,Yt-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),ve=new RegExp(`^ {0,${Math.min(3,Yt-1)}}(?:\`\`\`|~~~)`),Xe=new RegExp(`^ {0,${Math.min(3,Yt-1)}}#`);for(;te;){const rt=te.split(` +`,1)[0];if(It=rt,this.options.pedantic&&(It=It.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),ve.test(It)||Xe.test(It)||ys.test(It)||gt.test(te))break;if(It.search(/[^ ]/)>=Yt||!It.trim())bt+=` +`+It.slice(Yt);else{if(Wt||Dt.search(/[^ ]/)>=4||ve.test(Dt)||Xe.test(Dt)||gt.test(Dt))break;bt+=` +`+It}!Wt&&!It.trim()&&(Wt=!0),it+=rt+` +`,te=te.substring(rt.length+1),Dt=It.slice(Yt)}}_e.loose||(Ae?_e.loose=!0:/\n *\n *$/.test(it)&&(Ae=!0));let Ri=null,Hi;this.options.gfm&&(Ri=/^\[[ xX]\] /.exec(bt),Ri&&(Hi=Ri[0]!=="[ ] ",bt=bt.replace(/^\[[ xX]\] +/,""))),_e.items.push({type:"list_item",raw:it,task:!!Ri,checked:Hi,loose:!1,text:bt,tokens:[]}),_e.raw+=it}_e.items[_e.items.length-1].raw=_e.items[_e.items.length-1].raw.trimEnd(),_e.items[_e.items.length-1].text=_e.items[_e.items.length-1].text.trimEnd(),_e.raw=_e.raw.trimEnd();for(let Ye=0;Ye<_e.items.length;Ye++)if(this.lexer.state.top=!1,_e.items[Ye].tokens=this.lexer.blockTokens(_e.items[Ye].text,[]),!_e.loose){const it=_e.items[Ye].tokens.filter(Dt=>Dt.type==="space"),bt=it.length>0&&it.some(Dt=>/\n.*\n/.test(Dt.raw));_e.loose=bt}if(_e.loose)for(let Ye=0;Ye<_e.items.length;Ye++)_e.items[Ye].loose=!0;return _e}}html(te){const se=this.rules.block.html.exec(te);if(se)return{type:"html",block:!0,raw:se[0],pre:se[1]==="pre"||se[1]==="script"||se[1]==="style",text:se[0]}}def(te){const se=this.rules.block.def.exec(te);if(se){const oe=se[1].toLowerCase().replace(/\s+/g," "),ge=se[2]?se[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",_e=se[3]?se[3].substring(1,se[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):se[3];return{type:"def",tag:oe,raw:se[0],href:ge,title:_e}}}table(te){const se=this.rules.block.table.exec(te);if(!se||!/[:|]/.test(se[2]))return;const oe=_(se[1]),ge=se[2].replace(/^\||\| *$/g,"").split("|"),_e=se[3]&&se[3].trim()?se[3].replace(/\n[ \t]*$/,"").split(` +`):[],Ee={type:"table",raw:se[0],header:[],align:[],rows:[]};if(oe.length===ge.length){for(const Ae of ge)/^ *-+: *$/.test(Ae)?Ee.align.push("right"):/^ *:-+: *$/.test(Ae)?Ee.align.push("center"):/^ *:-+ *$/.test(Ae)?Ee.align.push("left"):Ee.align.push(null);for(let Ae=0;Ae({text:Ye,tokens:this.lexer.inline(Ye),header:!1,align:Ee.align[it]})));return Ee}}lheading(te){const se=this.rules.block.lheading.exec(te);if(se)return{type:"heading",raw:se[0],depth:se[2].charAt(0)==="="?1:2,text:se[1],tokens:this.lexer.inline(se[1])}}paragraph(te){const se=this.rules.block.paragraph.exec(te);if(se){const oe=se[1].charAt(se[1].length-1)===` +`?se[1].slice(0,-1):se[1];return{type:"paragraph",raw:se[0],text:oe,tokens:this.lexer.inline(oe)}}}text(te){const se=this.rules.block.text.exec(te);if(se)return{type:"text",raw:se[0],text:se[0],tokens:this.lexer.inline(se[0])}}escape(te){const se=this.rules.inline.escape.exec(te);if(se)return{type:"escape",raw:se[0],text:d(se[1])}}tag(te){const se=this.rules.inline.tag.exec(te);if(se)return!this.lexer.state.inLink&&/^/i.test(se[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:se[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:se[0]}}link(te){const se=this.rules.inline.link.exec(te);if(se){const oe=se[2].trim();if(!this.options.pedantic&&/^$/.test(oe))return;const Ee=v(oe.slice(0,-1),"\\");if((oe.length-Ee.length)%2===0)return}else{const Ee=C(se[2],"()");if(Ee>-1){const Ye=(se[0].indexOf("!")===0?5:4)+se[1].length+Ee;se[2]=se[2].substring(0,Ee),se[0]=se[0].substring(0,Ye).trim(),se[3]=""}}let ge=se[2],_e="";if(this.options.pedantic){const Ee=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);Ee&&(ge=Ee[1],_e=Ee[3])}else _e=se[3]?se[3].slice(1,-1):"";return ge=ge.trim(),/^$/.test(oe)?ge=ge.slice(1):ge=ge.slice(1,-1)),S(se,{href:ge&&ge.replace(this.rules.inline.anyPunctuation,"$1"),title:_e&&_e.replace(this.rules.inline.anyPunctuation,"$1")},se[0],this.lexer)}}reflink(te,se){let oe;if((oe=this.rules.inline.reflink.exec(te))||(oe=this.rules.inline.nolink.exec(te))){const ge=(oe[2]||oe[1]).replace(/\s+/g," "),_e=se[ge.toLowerCase()];if(!_e){const Ee=oe[0].charAt(0);return{type:"text",raw:Ee,text:Ee}}return S(oe,_e,oe[0],this.lexer)}}emStrong(te,se,oe=""){let ge=this.rules.inline.emStrongLDelim.exec(te);if(!ge||ge[3]&&oe.match(/[\p{L}\p{N}]/u))return;if(!(ge[1]||ge[2]||"")||!oe||this.rules.inline.punctuation.exec(oe)){const Ee=[...ge[0]].length-1;let Ae,Ye,it=Ee,bt=0;const Dt=ge[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(Dt.lastIndex=0,se=se.slice(-1*te.length+Ee);(ge=Dt.exec(se))!=null;){if(Ae=ge[1]||ge[2]||ge[3]||ge[4]||ge[5]||ge[6],!Ae)continue;if(Ye=[...Ae].length,ge[3]||ge[4]){it+=Ye;continue}else if((ge[5]||ge[6])&&Ee%3&&!((Ee+Ye)%3)){bt+=Ye;continue}if(it-=Ye,it>0)continue;Ye=Math.min(Ye,Ye+it+bt);const It=[...ge[0]][0].length,Wt=te.slice(0,Ee+ge.index+It+Ye);if(Math.min(Ee,Ye)%2){const Ri=Wt.slice(1,-1);return{type:"em",raw:Wt,text:Ri,tokens:this.lexer.inlineTokens(Ri)}}const Yt=Wt.slice(2,-2);return{type:"strong",raw:Wt,text:Yt,tokens:this.lexer.inlineTokens(Yt)}}}}codespan(te){const se=this.rules.inline.code.exec(te);if(se){let oe=se[2].replace(/\n/g," ");const ge=/[^ ]/.test(oe),_e=/^ /.test(oe)&&/ $/.test(oe);return ge&&_e&&(oe=oe.substring(1,oe.length-1)),oe=d(oe,!0),{type:"codespan",raw:se[0],text:oe}}}br(te){const se=this.rules.inline.br.exec(te);if(se)return{type:"br",raw:se[0]}}del(te){const se=this.rules.inline.del.exec(te);if(se)return{type:"del",raw:se[0],text:se[2],tokens:this.lexer.inlineTokens(se[2])}}autolink(te){const se=this.rules.inline.autolink.exec(te);if(se){let oe,ge;return se[2]==="@"?(oe=d(se[1]),ge="mailto:"+oe):(oe=d(se[1]),ge=oe),{type:"link",raw:se[0],text:oe,href:ge,tokens:[{type:"text",raw:oe,text:oe}]}}}url(te){var oe;let se;if(se=this.rules.inline.url.exec(te)){let ge,_e;if(se[2]==="@")ge=d(se[0]),_e="mailto:"+ge;else{let Ee;do Ee=se[0],se[0]=((oe=this.rules.inline._backpedal.exec(se[0]))==null?void 0:oe[0])??"";while(Ee!==se[0]);ge=d(se[0]),se[1]==="www."?_e="http://"+se[0]:_e=se[0]}return{type:"link",raw:se[0],text:ge,href:_e,tokens:[{type:"text",raw:ge,text:ge}]}}}inlineText(te){const se=this.rules.inline.text.exec(te);if(se){let oe;return this.lexer.state.inRawBlock?oe=se[0]:oe=d(se[0]),{type:"text",raw:se[0],text:oe}}}}const I=/^(?: *(?:\n|$))+/,N=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,R=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,T=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,A=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,B=f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,F).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),W=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,G=/^[^\n]+/,j=/(?!\s*\])(?:\\.|[^\[\]\\])+/,K=f(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",j).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ee=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),U="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",q=/|$))/,Q=f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",q).replace("tag",U).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce=f(W).replace("hr",T).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",U).getRegex(),Ce={blockquote:f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ce).getRegex(),code:N,def:K,fences:R,heading:A,hr:T,html:Q,lheading:B,list:ee,newline:I,paragraph:ce,table:m,text:G},ae=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",T).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",U).getRegex(),be={...Ce,table:ae,paragraph:f(W).replace("hr",T).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ae).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",U).getRegex()},De={...Ce,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",q).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(W).replace("hr",T).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",B).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Te=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)/,Qe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,le=f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,qe).getRegex(),pe=f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,qe).getRegex(),Ie=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,qe).getRegex(),$e=f(/\\([punct])/,"gu").replace(/punct/g,qe).getRegex(),ye=f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Re=f(q).replace("(?:-->|$)","-->").getRegex(),Ue=f("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Re).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),He=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ve=f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",He).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Oe=f(/^!?\[(label)\]\[(ref)\]/).replace("label",He).replace("ref",j).getRegex(),ot=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",j).getRegex(),et=f("reflink|nolink(?!\\()","g").replace("reflink",Oe).replace("nolink",ot).getRegex(),nt={_backpedal:m,anyPunctuation:$e,autolink:ye,blockSkip:je,br:ze,code:xe,del:m,emStrongLDelim:le,emStrongRDelimAst:pe,emStrongRDelimUnd:Ie,escape:Te,link:Ve,nolink:ot,punctuation:Le,reflink:Oe,reflinkSearch:et,tag:Ue,text:Qe,url:m},lt={...nt,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",He).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",He).getRegex()},Ct={...nt,escape:f(Te).replace("])","~|])").getRegex(),url:f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\Ye+" ".repeat(it.length));let ge,_e,Ee;for(;te;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(Ae=>(ge=Ae.call({lexer:this},te,se))?(te=te.substring(ge.raw.length),se.push(ge),!0):!1))){if(ge=this.tokenizer.space(te)){te=te.substring(ge.raw.length),ge.raw.length===1&&se.length>0?se[se.length-1].raw+=` +`:se.push(ge);continue}if(ge=this.tokenizer.code(te)){te=te.substring(ge.raw.length),_e=se[se.length-1],_e&&(_e.type==="paragraph"||_e.type==="text")?(_e.raw+=` +`+ge.raw,_e.text+=` +`+ge.text,this.inlineQueue[this.inlineQueue.length-1].src=_e.text):se.push(ge);continue}if(ge=this.tokenizer.fences(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.heading(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.hr(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.blockquote(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.list(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.html(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.def(te)){te=te.substring(ge.raw.length),_e=se[se.length-1],_e&&(_e.type==="paragraph"||_e.type==="text")?(_e.raw+=` +`+ge.raw,_e.text+=` +`+ge.raw,this.inlineQueue[this.inlineQueue.length-1].src=_e.text):this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(ge=this.tokenizer.lheading(te)){te=te.substring(ge.raw.length),se.push(ge);continue}if(Ee=te,this.options.extensions&&this.options.extensions.startBlock){let Ae=1/0;const Ye=te.slice(1);let it;this.options.extensions.startBlock.forEach(bt=>{it=bt.call({lexer:this},Ye),typeof it=="number"&&it>=0&&(Ae=Math.min(Ae,it))}),Ae<1/0&&Ae>=0&&(Ee=te.substring(0,Ae+1))}if(this.state.top&&(ge=this.tokenizer.paragraph(Ee))){_e=se[se.length-1],oe&&(_e==null?void 0:_e.type)==="paragraph"?(_e.raw+=` +`+ge.raw,_e.text+=` +`+ge.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=_e.text):se.push(ge),oe=Ee.length!==te.length,te=te.substring(ge.raw.length);continue}if(ge=this.tokenizer.text(te)){te=te.substring(ge.raw.length),_e=se[se.length-1],_e&&_e.type==="text"?(_e.raw+=` +`+ge.raw,_e.text+=` +`+ge.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=_e.text):se.push(ge);continue}if(te){const Ae="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(Ae);break}else throw new Error(Ae)}}return this.state.top=!0,se}inline(te,se=[]){return this.inlineQueue.push({src:te,tokens:se}),se}inlineTokens(te,se=[]){let oe,ge,_e,Ee=te,Ae,Ye,it;if(this.tokens.links){const bt=Object.keys(this.tokens.links);if(bt.length>0)for(;(Ae=this.tokenizer.rules.inline.reflinkSearch.exec(Ee))!=null;)bt.includes(Ae[0].slice(Ae[0].lastIndexOf("[")+1,-1))&&(Ee=Ee.slice(0,Ae.index)+"["+"a".repeat(Ae[0].length-2)+"]"+Ee.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ae=this.tokenizer.rules.inline.blockSkip.exec(Ee))!=null;)Ee=Ee.slice(0,Ae.index)+"["+"a".repeat(Ae[0].length-2)+"]"+Ee.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Ae=this.tokenizer.rules.inline.anyPunctuation.exec(Ee))!=null;)Ee=Ee.slice(0,Ae.index)+"++"+Ee.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;te;)if(Ye||(it=""),Ye=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(bt=>(oe=bt.call({lexer:this},te,se))?(te=te.substring(oe.raw.length),se.push(oe),!0):!1))){if(oe=this.tokenizer.escape(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.tag(te)){te=te.substring(oe.raw.length),ge=se[se.length-1],ge&&oe.type==="text"&&ge.type==="text"?(ge.raw+=oe.raw,ge.text+=oe.text):se.push(oe);continue}if(oe=this.tokenizer.link(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(oe.raw.length),ge=se[se.length-1],ge&&oe.type==="text"&&ge.type==="text"?(ge.raw+=oe.raw,ge.text+=oe.text):se.push(oe);continue}if(oe=this.tokenizer.emStrong(te,Ee,it)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.codespan(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.br(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.del(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(oe=this.tokenizer.autolink(te)){te=te.substring(oe.raw.length),se.push(oe);continue}if(!this.state.inLink&&(oe=this.tokenizer.url(te))){te=te.substring(oe.raw.length),se.push(oe);continue}if(_e=te,this.options.extensions&&this.options.extensions.startInline){let bt=1/0;const Dt=te.slice(1);let It;this.options.extensions.startInline.forEach(Wt=>{It=Wt.call({lexer:this},Dt),typeof It=="number"&&It>=0&&(bt=Math.min(bt,It))}),bt<1/0&&bt>=0&&(_e=te.substring(0,bt+1))}if(oe=this.tokenizer.inlineText(_e)){te=te.substring(oe.raw.length),oe.raw.slice(-1)!=="_"&&(it=oe.raw.slice(-1)),Ye=!0,ge=se[se.length-1],ge&&ge.type==="text"?(ge.raw+=oe.raw,ge.text+=oe.text):se.push(oe);continue}if(te){const bt="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return se}}class _i{constructor(te){Ii(this,"options");Ii(this,"parser");this.options=te||e.defaults}space(te){return""}code({text:te,lang:se,escaped:oe}){var Ee;const ge=(Ee=(se||"").match(/^\S*/))==null?void 0:Ee[0],_e=te.replace(/\n$/,"")+` +`;return ge?'
'+(oe?_e:d(_e,!0))+`
+`:"
"+(oe?_e:d(_e,!0))+`
+`}blockquote({tokens:te}){return`
+${this.parser.parse(te)}
+`}html({text:te}){return te}heading({tokens:te,depth:se}){return`${this.parser.parseInline(te)} +`}hr(te){return`
+`}list(te){const se=te.ordered,oe=te.start;let ge="";for(let Ae=0;Ae +`+ge+" +`}listitem(te){let se="";if(te.task){const oe=this.checkbox({checked:!!te.checked});te.loose?te.tokens.length>0&&te.tokens[0].type==="paragraph"?(te.tokens[0].text=oe+" "+te.tokens[0].text,te.tokens[0].tokens&&te.tokens[0].tokens.length>0&&te.tokens[0].tokens[0].type==="text"&&(te.tokens[0].tokens[0].text=oe+" "+te.tokens[0].tokens[0].text)):te.tokens.unshift({type:"text",raw:oe+" ",text:oe+" "}):se+=oe+" "}return se+=this.parser.parse(te.tokens,!!te.loose),`
  • ${se}
  • +`}checkbox({checked:te}){return"'}paragraph({tokens:te}){return`

    ${this.parser.parseInline(te)}

    +`}table(te){let se="",oe="";for(let _e=0;_e${ge}`),` + +`+se+` +`+ge+`
    +`}tablerow({text:te}){return` +${te} +`}tablecell(te){const se=this.parser.parseInline(te.tokens),oe=te.header?"th":"td";return(te.align?`<${oe} align="${te.align}">`:`<${oe}>`)+se+` +`}strong({tokens:te}){return`${this.parser.parseInline(te)}`}em({tokens:te}){return`${this.parser.parseInline(te)}`}codespan({text:te}){return`${te}`}br(te){return"
    "}del({tokens:te}){return`${this.parser.parseInline(te)}`}link({href:te,title:se,tokens:oe}){const ge=this.parser.parseInline(oe),_e=g(te);if(_e===null)return ge;te=_e;let Ee='
    ",Ee}image({href:te,title:se,text:oe}){const ge=g(te);if(ge===null)return oe;te=ge;let _e=`${oe}{const it=Ae[Ye].flat(1/0);oe=oe.concat(this.walkTokens(it,se))}):Ae.tokens&&(oe=oe.concat(this.walkTokens(Ae.tokens,se)))}}return oe}use(...te){const se=this.defaults.extensions||{renderers:{},childTokens:{}};return te.forEach(oe=>{const ge={...oe};if(ge.async=this.defaults.async||ge.async||!1,oe.extensions&&(oe.extensions.forEach(_e=>{if(!_e.name)throw new Error("extension name required");if("renderer"in _e){const Ee=se.renderers[_e.name];Ee?se.renderers[_e.name]=function(...Ae){let Ye=_e.renderer.apply(this,Ae);return Ye===!1&&(Ye=Ee.apply(this,Ae)),Ye}:se.renderers[_e.name]=_e.renderer}if("tokenizer"in _e){if(!_e.level||_e.level!=="block"&&_e.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const Ee=se[_e.level];Ee?Ee.unshift(_e.tokenizer):se[_e.level]=[_e.tokenizer],_e.start&&(_e.level==="block"?se.startBlock?se.startBlock.push(_e.start):se.startBlock=[_e.start]:_e.level==="inline"&&(se.startInline?se.startInline.push(_e.start):se.startInline=[_e.start]))}"childTokens"in _e&&_e.childTokens&&(se.childTokens[_e.name]=_e.childTokens)}),ge.extensions=se),oe.renderer){const _e=this.defaults.renderer||new _i(this.defaults);for(const Ee in oe.renderer){if(!(Ee in _e))throw new Error(`renderer '${Ee}' does not exist`);if(["options","parser"].includes(Ee))continue;const Ae=Ee,Ye=oe.renderer[Ae],it=_e[Ae];_e[Ae]=(...bt)=>{let Dt=Ye.apply(_e,bt);return Dt===!1&&(Dt=it.apply(_e,bt)),Dt||""}}ge.renderer=_e}if(oe.tokenizer){const _e=this.defaults.tokenizer||new L(this.defaults);for(const Ee in oe.tokenizer){if(!(Ee in _e))throw new Error(`tokenizer '${Ee}' does not exist`);if(["options","rules","lexer"].includes(Ee))continue;const Ae=Ee,Ye=oe.tokenizer[Ae],it=_e[Ae];_e[Ae]=(...bt)=>{let Dt=Ye.apply(_e,bt);return Dt===!1&&(Dt=it.apply(_e,bt)),Dt}}ge.tokenizer=_e}if(oe.hooks){const _e=this.defaults.hooks||new Si;for(const Ee in oe.hooks){if(!(Ee in _e))throw new Error(`hook '${Ee}' does not exist`);if(Ee==="options")continue;const Ae=Ee,Ye=oe.hooks[Ae],it=_e[Ae];Si.passThroughHooks.has(Ee)?_e[Ae]=bt=>{if(this.defaults.async)return Promise.resolve(Ye.call(_e,bt)).then(It=>it.call(_e,It));const Dt=Ye.call(_e,bt);return it.call(_e,Dt)}:_e[Ae]=(...bt)=>{let Dt=Ye.apply(_e,bt);return Dt===!1&&(Dt=it.apply(_e,bt)),Dt}}ge.hooks=_e}if(oe.walkTokens){const _e=this.defaults.walkTokens,Ee=oe.walkTokens;ge.walkTokens=function(Ae){let Ye=[];return Ye.push(Ee.call(this,Ae)),_e&&(Ye=Ye.concat(_e.call(this,Ae))),Ye}}this.defaults={...this.defaults,...ge}}),this}setOptions(te){return this.defaults={...this.defaults,...te},this}lexer(te,se){return Vt.lex(te,se??this.defaults)}parser(te,se){return At.parse(te,se??this.defaults)}parseMarkdown(te,se){return(ge,_e)=>{const Ee={..._e},Ae={...this.defaults,...Ee},Ye=this.onError(!!Ae.silent,!!Ae.async);if(this.defaults.async===!0&&Ee.async===!1)return Ye(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof ge>"u"||ge===null)return Ye(new Error("marked(): input parameter is undefined or null"));if(typeof ge!="string")return Ye(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ge)+", string expected"));if(Ae.hooks&&(Ae.hooks.options=Ae),Ae.async)return Promise.resolve(Ae.hooks?Ae.hooks.preprocess(ge):ge).then(it=>te(it,Ae)).then(it=>Ae.hooks?Ae.hooks.processAllTokens(it):it).then(it=>Ae.walkTokens?Promise.all(this.walkTokens(it,Ae.walkTokens)).then(()=>it):it).then(it=>se(it,Ae)).then(it=>Ae.hooks?Ae.hooks.postprocess(it):it).catch(Ye);try{Ae.hooks&&(ge=Ae.hooks.preprocess(ge));let it=te(ge,Ae);Ae.hooks&&(it=Ae.hooks.processAllTokens(it)),Ae.walkTokens&&this.walkTokens(it,Ae.walkTokens);let bt=se(it,Ae);return Ae.hooks&&(bt=Ae.hooks.postprocess(bt)),bt}catch(it){return Ye(it)}}}onError(te,se){return oe=>{if(oe.message+=` +Please report this to https://github.com/markedjs/marked.`,te){const ge="

    An error occurred:

    "+d(oe.message+"",!0)+"
    ";return se?Promise.resolve(ge):ge}if(se)return Promise.reject(oe);throw oe}}}const vi=new bi;function Ot(vt,te){return vi.parse(vt,te)}Ot.options=Ot.setOptions=function(vt){return vi.setOptions(vt),Ot.defaults=vi.defaults,i(Ot.defaults),Ot},Ot.getDefaults=t,Ot.defaults=e.defaults,Ot.use=function(...vt){return vi.use(...vt),Ot.defaults=vi.defaults,i(Ot.defaults),Ot},Ot.walkTokens=function(vt,te){return vi.walkTokens(vt,te)},Ot.parseInline=vi.parseInline,Ot.Parser=At,Ot.parser=At.parse,Ot.Renderer=_i,Ot.TextRenderer=Xt,Ot.Lexer=Vt,Ot.lexer=Vt.lex,Ot.Tokenizer=L,Ot.Hooks=Si,Ot.parse=Ot;const Hn=Ot.options,Cr=Ot.setOptions,ps=Ot.use,Li=Ot.walkTokens,mn=Ot.parseInline,xo=Ot,xr=At.parse,ms=Vt.lex;e.Hooks=Si,e.Lexer=Vt,e.Marked=bi,e.Parser=At,e.Renderer=_i,e.TextRenderer=Xt,e.Tokenizer=L,e.getDefaults=t,e.lexer=ms,e.marked=Ot,e.options=Hn,e.parse=xo,e.parseInline=mn,e.parser=xr,e.setOptions=Cr,e.use=ps,e.walkTokens=Li})})();__marked_exports.Hooks||exports.Hooks;__marked_exports.Lexer||exports.Lexer;__marked_exports.Marked||exports.Marked;__marked_exports.Parser||exports.Parser;var Renderer=__marked_exports.Renderer||exports.Renderer;__marked_exports.TextRenderer||exports.TextRenderer;__marked_exports.Tokenizer||exports.Tokenizer;var defaults=__marked_exports.defaults||exports.defaults;__marked_exports.getDefaults||exports.getDefaults;var lexer=__marked_exports.lexer||exports.lexer;__marked_exports.marked||exports.marked;__marked_exports.options||exports.options;var parse$5=__marked_exports.parse||exports.parse;__marked_exports.parseInline||exports.parseInline;var parser=__marked_exports.parser||exports.parser;__marked_exports.setOptions||exports.setOptions;__marked_exports.use||exports.use;__marked_exports.walkTokens||exports.walkTokens;function stringify$1(n){return JSON.stringify(n,replacer$1)}function parse$4(n){let e=JSON.parse(n);return e=revive(e),e}function replacer$1(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function revive(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return URI.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof VSBuffer||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=parseHrefAndDimensions(n),s.push(`src="${escapeDoubleQuotes(n)}"`)),t&&s.push(`alt="${escapeDoubleQuotes(t)}"`),e&&s.push(`title="${escapeDoubleQuotes(e)}"`),i.length&&(s=s.concat(i)),""},paragraph({tokens:n}){return`

    ${this.parser.parseInline(n)}

    `},link({href:n,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof n!="string"?"":(n===i&&(i=removeMarkdownEscapes(i)),e=typeof e=="string"?escapeDoubleQuotes(removeMarkdownEscapes(e)):"",n=removeMarkdownEscapes(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
    ${i}`)}});function renderMarkdown(n,e={},t={}){const i=new DisposableStore;let s=!1;const r=createElement(e),o=function(_){let v;try{v=parse$4(decodeURIComponent(_))}catch{}return v?(v=cloneAndChange(v,C=>{if(n.uris&&n.uris[C])return URI.revive(n.uris[C])}),encodeURIComponent(JSON.stringify(v))):_},a=function(_,v){const C=n.uris&&n.uris[_];let S=URI.revive(C);return v?_.startsWith(Schemas.data+":")?_:(S||(S=URI.parse(_)),FileAccess.uriToBrowserUri(S).toString(!0)):!S||URI.parse(_).toString()===S.toString()?_:(S.query&&(S=S.with({query:o(S.query)})),S.toString())},l=new Renderer;l.image=defaultMarkedRenderers.image,l.link=defaultMarkedRenderers.link,l.paragraph=defaultMarkedRenderers.paragraph;const c=[],d=[];if(e.codeBlockRendererSync?l.code=({text:_,lang:v})=>{const C=defaultGenerator.nextId(),S=e.codeBlockRendererSync(postProcessCodeBlockLanguageId(v),_);return d.push([C,S]),`
    ${escape$1(_)}
    `}:e.codeBlockRenderer&&(l.code=({text:_,lang:v})=>{const C=defaultGenerator.nextId(),S=e.codeBlockRenderer(postProcessCodeBlockLanguageId(v),_);return c.push(S.then(w=>[C,w])),`
    ${escape$1(_)}
    `}),e.actionHandler){const _=function(S){let w=S.target;if(!(w.tagName!=="A"&&(w=w.parentElement,!w||w.tagName!=="A")))try{let L=w.dataset.href;L&&(n.baseUri&&(L=resolveWithBaseUri(URI.from(n.baseUri),L)),e.actionHandler.callback(L,S))}catch(L){onUnexpectedError(L)}finally{S.preventDefault()}},v=e.actionHandler.disposables.add(new DomEmitter(r,"click")),C=e.actionHandler.disposables.add(new DomEmitter(r,"auxclick"));e.actionHandler.disposables.add(Event$1.any(v.event,C.event)(S=>{const w=new StandardMouseEvent(getWindow(r),S);!w.leftButton&&!w.middleButton||_(w)})),e.actionHandler.disposables.add(addDisposableListener(r,"keydown",S=>{const w=new StandardKeyboardEvent(S);!w.equals(10)&&!w.equals(3)||_(w)}))}n.supportHtml||(l.html=({text:_})=>{var C;return(C=e.sanitizerOptions)!=null&&C.replaceWithPlaintext?escape$1(_):(n.isTrusted?_.match(/^(]+>)|(<\/\s*span>)$/):void 0)?_:""}),t.renderer=l;let u=n.value??"";u.length>1e5&&(u=`${u.substr(0,1e5)}…`),n.supportThemeIcons&&(u=markdownEscapeEscapedIcons(u));let f;if(e.fillInIncompleteTokens){const _={...defaults,...t},v=lexer(u,_),C=fillInIncompleteTokens(v);f=parser(C,_)}else f=parse$5(u,{...t,async:!1});n.supportThemeIcons&&(f=renderLabelWithIcons(f).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const m=new DOMParser().parseFromString(sanitizeRenderedMarkdown({isTrusted:n.isTrusted,...e.sanitizerOptions},f),"text/html");if(m.body.querySelectorAll("img, audio, video, source").forEach(_=>{const v=_.getAttribute("src");if(v){let C=v;try{n.baseUri&&(C=resolveWithBaseUri(URI.from(n.baseUri),C))}catch{}if(_.setAttribute("src",a(C,!0)),e.remoteImageIsAllowed){const S=URI.parse(C);S.scheme!==Schemas.file&&S.scheme!==Schemas.data&&!e.remoteImageIsAllowed(S)&&_.replaceWith($$e("",void 0,_.outerHTML))}}}),m.body.querySelectorAll("a").forEach(_=>{const v=_.getAttribute("href");if(_.setAttribute("href",""),!v||/^data:|javascript:/i.test(v)||/^command:/i.test(v)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(v))_.replaceWith(..._.childNodes);else{let C=a(v,!1);n.baseUri&&(C=resolveWithBaseUri(URI.from(n.baseUri),v)),_.dataset.href=C}}),r.innerHTML=sanitizeRenderedMarkdown({isTrusted:n.isTrusted,...e.sanitizerOptions},m.body.innerHTML),c.length>0)Promise.all(c).then(_=>{var S;if(s)return;const v=new Map(_),C=r.querySelectorAll("div[data-code]");for(const w of C){const L=v.get(w.dataset.code??"");L&&reset$1(w,L)}(S=e.asyncRenderCallback)==null||S.call(e)});else if(d.length>0){const _=new Map(d),v=r.querySelectorAll("div[data-code]");for(const C of v){const S=_.get(C.dataset.code??"");S&&reset$1(C,S)}}if(e.asyncRenderCallback)for(const _ of r.getElementsByTagName("img")){const v=i.add(addDisposableListener(_,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:r,dispose:()=>{s=!0,i.dispose()}}}function postProcessCodeBlockLanguageId(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function resolveWithBaseUri(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?resolvePath(n,e).toString():resolvePath(dirname$1(n),e).toString()}const selfClosingTags=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function sanitizeRenderedMarkdown(n,e){const{config:t,allowedSchemes:i}=getSanitizerOptions(n),s=new DisposableStore;s.add(addDompurifyHook("uponSanitizeAttribute",(r,o)=>{var a;if(o.attrName==="style"||o.attrName==="class"){if(r.tagName==="SPAN"){if(o.attrName==="style"){o.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(border-radius:[0-9]+px;)?$/.test(o.attrValue);return}else if(o.attrName==="class"){o.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(o.attrValue);return}}o.keepAttr=!1;return}else if(r.tagName==="INPUT"&&((a=r.attributes.getNamedItem("type"))==null?void 0:a.value)==="checkbox"){if(o.attrName==="type"&&o.attrValue==="checkbox"||o.attrName==="disabled"||o.attrName==="checked"){o.keepAttr=!0;return}o.keepAttr=!1}})),s.add(addDompurifyHook("uponSanitizeElement",(r,o)=>{var a;if(o.tagName==="input"&&(((a=r.attributes.getNamedItem("type"))==null?void 0:a.value)==="checkbox"?r.setAttribute("disabled",""):n.replaceWithPlaintext||r.remove()),n.replaceWithPlaintext&&!o.allowedTags[o.tagName]&&o.tagName!=="body"&&r.parentElement){let l,c;if(o.tagName==="#comment")l=``;else{const g=selfClosingTags.includes(o.tagName),m=r.attributes.length?" "+Array.from(r.attributes).map(_=>`${_.name}="${_.value}"`).join(" "):"";l=`<${o.tagName}${m}>`,g||(c=``)}const d=document.createDocumentFragment(),u=r.parentElement.ownerDocument.createTextNode(l);d.appendChild(u);const f=c?r.parentElement.ownerDocument.createTextNode(c):void 0;for(;r.firstChild;)d.appendChild(r.firstChild);f&&d.appendChild(f),r.nodeType===Node.COMMENT_NODE?r.parentElement.insertBefore(d,r):r.parentElement.replaceChild(d,r)}})),s.add(hookDomPurifyHrefAndSrcSanitizer(i));try{return sanitize$1(e,{...t,RETURN_TRUSTED_TYPE:!0})}finally{s.dispose()}}const allowedMarkdownAttr=["align","autoplay","alt","checked","class","colspan","controls","data-code","data-href","disabled","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","style","target","title","type","width","start"];function getSanitizerOptions(n){const e=[Schemas.http,Schemas.https,Schemas.mailto,Schemas.data,Schemas.file,Schemas.vscodeFileResource,Schemas.vscodeRemote,Schemas.vscodeRemoteResource];return n.isTrusted&&e.push(Schemas.command),{config:{ALLOWED_TAGS:n.allowedTags??[...basicMarkupHtmlTags],ALLOWED_ATTR:allowedMarkdownAttr,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function renderStringAsPlaintext(n){return typeof n=="string"?n:renderMarkdownAsPlaintext(n)}function renderMarkdownAsPlaintext(n,e){let t=n.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=parse$5(t,{async:!1,renderer:e?plainTextWithCodeBlocksRenderer.value:plainTextRenderer.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>unescapeInfo.get(s)??s);return sanitizeRenderedMarkdown({isTrusted:!1},i).toString()}const unescapeInfo=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function createRenderer(){const n=new Renderer;return n.code=({text:e})=>e,n.blockquote=({text:e})=>e+` +`,n.html=e=>"",n.heading=function({tokens:e}){return this.parser.parseInline(e)+` +`},n.hr=()=>"",n.list=function({items:e}){return e.map(t=>this.listitem(t)).join(` +`)+` +`},n.listitem=({text:e})=>e+` +`,n.paragraph=function({tokens:e}){return this.parser.parseInline(e)+` +`},n.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+` +`+t.map(i=>i.map(s=>this.tablecell(s)).join(" ")).join(` +`)+` +`},n.tablerow=({text:e})=>e,n.tablecell=function({tokens:e}){return this.parser.parseInline(e)},n.strong=({text:e})=>e,n.em=({text:e})=>e,n.codespan=({text:e})=>e,n.br=e=>` +`,n.del=({text:e})=>e,n.image=e=>"",n.text=({text:e})=>e,n.link=({text:e})=>e,n}const plainTextRenderer=new Lazy(n=>createRenderer()),plainTextWithCodeBlocksRenderer=new Lazy(()=>{const n=createRenderer();return n.code=({text:e})=>` +\`\`\` +${e} +\`\`\` +`,n});function mergeRawTokenText(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function completeSingleLinePattern(n){var e,t;if(n.tokens)for(let i=n.tokens.length-1;i>=0;i--){const s=n.tokens[i];if(s.type==="text"){const r=s.raw.split(` +`),o=r[r.length-1];if(o.includes("`"))return completeCodespan(n);if(o.includes("**"))return completeDoublestar(n);if(o.match(/\*\w/))return completeStar(n);if(o.match(/(^|\s)__\w/))return completeDoubleUnderscore(n);if(o.match(/(^|\s)_\w/))return completeUnderscore(n);if(hasLinkTextAndStartOfLinkTarget(o)||hasStartOfLinkTargetAndNoLinkText(o)&&n.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=n.tokens.slice(i+1);return((e=a[0])==null?void 0:e.type)==="link"&&((t=a[1])==null?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||o.match(/^[^"]* +"[^"]*$/)?completeLinkTargetArg(n):completeLinkTarget(n)}else if(o.match(/(^|\s)\[\w*/))return completeLinkText(n)}}}function hasLinkTextAndStartOfLinkTarget(n){return!!n.match(/(^|\s)\[.*\]\(\w*/)}function hasStartOfLinkTargetAndNoLinkText(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function completeListItemPattern(n){var l;const e=n.items[n.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if((t==null?void 0:t.type)==="text"&&!("inRawBlock"in e)&&(i=completeSingleLinePattern(t)),!i||i.type!=="paragraph")return;const s=mergeRawTokenText(n.items.slice(0,-1)),r=(l=e.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:l[0];if(!r)return;const o=r+mergeRawTokenText(e.tokens.slice(0,-1))+i.raw,a=lexer(s+o)[0];if(a.type==="list")return a}const maxIncompleteTokensFixRounds=3;function fillInIncompleteTokens(n){for(let e=0;e"u"&&o.match(/^\s*\|/)){const a=o.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(o.match(/^\s*\|/)){if(r!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const r=s?t.slice(0,-1).join(` +`):e,o=!!r.match(/\|\s*$/),a=r+(o?"":"|")+` +|${" --- |".repeat(i)}`;return lexer(a)}}function addDompurifyHook(n,e){return addHook(n,e),toDisposable(()=>removeHook(n))}const renderedMarkdown="",gr=class gr{static createEmpty(e,t){const i=gr.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new gr(s,e,t)}static createFromTextAndMetadata(e,t){let i=0,s="";const r=new Array;for(const{text:o,metadata:a}of e)r.push(i+o.length,a),i+=o.length,s+=o;return new gr(new Uint32Array(r),s,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}equals(e){return e instanceof gr?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,r=s+(i<<1);for(let o=s;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=TokenMetadata.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return TokenMetadata.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return TokenMetadata.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return TokenMetadata.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return TokenMetadata.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return TokenMetadata.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return gr.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new SliceLineTokens(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let r=0;r>>1)-1;for(;it&&(s=r)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const r=new Array;let o=0;for(;;){const a=to){s+=this._text.substring(o,l.offset);const c=this._tokens[(t<<1)+1];r.push(s.length,c),o=l.offset}s+=l.text,r.push(s.length,l.tokenMetadata),i++}else break}return new gr(new Uint32Array(r),s,this.languageIdCodec)}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i>>0;let LineTokens=gr;class SliceLineTokens{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let r=this._firstTokenIndex,o=e.getCount();r=i);r++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof SliceLineTokens?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),s=this._source.getEndOffset(t);let r=this._source.getTokenText(t);return ithis._endOffset&&(r=r.substring(0,r.length-(s-this._endOffset))),r}forEach(e){for(let t=0;t>>0,new EncodedTokenizationResult(t,e===null?NullState:e)}const fallback={getInitialState:()=>NullState,tokenizeEncoded:(n,e,t)=>nullTokenizeEncoded(0,t)};async function tokenizeToString(n,e,t){if(!t)return _tokenizeToString(e,n.languageIdCodec,fallback);const i=await TokenizationRegistry.getOrCreate(t);return _tokenizeToString(e,n.languageIdCodec,i||fallback)}function tokenizeLineToHTML(n,e,t,i,s,r,o){let a="
    ",l=i,c=0,d=!0;for(let u=0,f=e.getCount();u0;)o&&d?(m+=" ",d=!1):(m+=" ",d=!0),v--;break}case 60:m+="<",d=!1;break;case 62:m+=">",d=!1;break;case 38:m+="&",d=!1;break;case 0:m+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:m+="�",d=!1;break;case 13:m+="​",d=!1;break;case 32:o&&d?(m+=" ",d=!1):(m+=" ",d=!0);break;default:m+=String.fromCharCode(_),d=!1}}if(a+=`${m}`,g>s||l>=s)break}return a+="
    ",a}function _tokenizeToString(n,e,t){let i='
    ';const s=splitLines(n);let r=t.getInitialState();for(let o=0,a=s.length;o0&&(i+="
    ");const c=t.tokenizeEncoded(l,!0,r);LineTokens.convertToEndOffset(c.tokens,l.length);const u=new LineTokens(c.tokens,l,e).inflate();let f=0;for(let g=0,m=u.getCount();g${escape$1(l.substring(f,v))}`,f=v}r=c.endState}return i+="
    ",i}var __decorate$2p=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2k=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MarkdownRenderer_1,vl;let MarkdownRenderer=(vl=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new Emitter$1,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new DisposableStore,r=s.add(renderMarkdown(e,{...this._getRenderOptions(e,s),...t},i));return r.element.classList.add("rendered-markdown"),{element:r.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,s)=>{var l,c;let r;i?r=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(r=(l=this._options.editor.getModel())==null?void 0:l.getLanguageId()),r||(r=PLAINTEXT_LANGUAGE_ID);const o=await tokenizeToString(this._languageService,s,r),a=document.createElement("span");if(a.innerHTML=((c=MarkdownRenderer_1._ttpTokenizer)==null?void 0:c.createHTML(o))??o,this._options.editor){const d=this._options.editor.getOption(50);applyFontInfo(a,d)}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(a.style.fontSize=this._options.codeBlockFontSize),a},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>openLinkFromMarkdown(this._openerService,i,e.isTrusted),disposables:t}}}},MarkdownRenderer_1=vl,vl._ttpTokenizer=createTrustedTypesPolicy("tokenizeToString",{createHTML(e){return e}}),vl);MarkdownRenderer=MarkdownRenderer_1=__decorate$2p([__param$2k(1,ILanguageService),__param$2k(2,IOpenerService)],MarkdownRenderer);async function openLinkFromMarkdown(n,e,t){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:toAllowCommandsOption(t)})}catch(i){return onUnexpectedError(i),!1}}function toAllowCommandsOption(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}const IAccessibilityService=createDecorator("accessibilityService"),CONTEXT_ACCESSIBILITY_MODE_ENABLED=new RawContextKey("accessibilityModeEnabled",!1),aria="",MAX_MESSAGE_LENGTH=2e4;let ariaContainer,alertContainer,alertContainer2,statusContainer,statusContainer2;function setARIAContainer(n){ariaContainer=document.createElement("div"),ariaContainer.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),ariaContainer.appendChild(i),i};alertContainer=e(),alertContainer2=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),ariaContainer.appendChild(i),i};statusContainer=t(),statusContainer2=t(),n.appendChild(ariaContainer)}function alert$1(n){ariaContainer&&(alertContainer.textContent!==n?(clearNode(alertContainer2),insertMessage(alertContainer,n)):(clearNode(alertContainer),insertMessage(alertContainer2,n)))}function status(n){ariaContainer&&(statusContainer.textContent!==n?(clearNode(statusContainer2),insertMessage(statusContainer,n)):(clearNode(statusContainer),insertMessage(statusContainer2,n)))}function insertMessage(n,e){clearNode(n),e.length>MAX_MESSAGE_LENGTH&&(e=e.substr(0,MAX_MESSAGE_LENGTH)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}var __decorate$2o=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2j=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $$c=$$e;let HoverWidget=class extends Widget$1{get _targetWindow(){return getWindow(this._target.targetElements[0])}get _targetDocumentElement(){return getWindow(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,r,o){var f,g,m,_,v,C,S;super(),this._keybindingService=t,this._configurationService=i,this._openerService=s,this._instantiationService=r,this._accessibilityService=o,this._messageListeners=new DisposableStore,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new Emitter$1),this._onRequestLayout=this._register(new Emitter$1),this._linkHandler=e.linkHandler||(w=>openLinkFromMarkdown(this._openerService,w,isMarkdownString(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new ElementHoverTarget(e.target),this._hoverPointer=(f=e.appearance)!=null&&f.showPointer?$$c("div.workbench-hover-pointer"):void 0,this._hover=this._register(new HoverWidget$1),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),(g=e.appearance)!=null&&g.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),(m=e.appearance)!=null&&m.skipFadeInAnimation&&this._hover.containerDomNode.classList.add("skip-fade-in"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),(_=e.position)!=null&&_.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0),this._hoverPosition=((v=e.position)==null?void 0:v.hoverPosition)??3,this.onmousedown(this._hover.containerDomNode,w=>w.stopPropagation()),this.onkeydown(this._hover.containerDomNode,w=>{w.equals(9)&&this.dispose()}),this._register(addDisposableListener(this._targetWindow,"blur",()=>this.dispose()));const a=$$c("div.hover-row.markdown-hover"),l=$$c("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(isHTMLElement(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const w=e.content,L=this._instantiationService.createInstance(MarkdownRenderer,{codeBlockFontFamily:this._configurationService.getValue("editor").fontFamily||EDITOR_FONT_DEFAULTS.fontFamily}),{element:I}=L.render(w,{actionHandler:{callback:N=>this._linkHandler(N),disposables:this._messageListeners},asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}});l.appendChild(I)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const w=$$c("div.hover-row.status-bar"),L=$$c("div.actions");e.actions.forEach(I=>{const N=this._keybindingService.lookupKeybinding(I.commandId),R=N?N.getLabel():null;HoverAction.render(L,{label:I.label,commandId:I.commandId,run:T=>{I.run(T),this.dispose()},iconClass:I.iconClass},R)}),w.appendChild(L),this._hover.containerDomNode.appendChild(w)}this._hoverContainer=$$c("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:((C=e.persistence)==null?void 0:C.hideOnHover)===void 0?c=typeof e.content=="string"||isMarkdownString(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):c=e.persistence.hideOnHover,(S=e.appearance)!=null&&S.showHoverHint){const w=$$c("div.hover-row.status-bar"),L=$$c("div.info");L.textContent=localize("hoverhint","Hold {0} key to mouse over",isMacintosh?"Option":"Alt"),w.appendChild(L),this._hover.containerDomNode.appendChild(w)}const d=[...this._target.targetElements];c||d.push(this._hoverContainer);const u=this._register(new CompositeMouseTracker(d));if(this._register(u.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const w=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new CompositeMouseTracker(w)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=u}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=prepend$1(this._hoverContainer,$$c("div")),s=append$1(this._hoverContainer,$$c("div"));i.tabIndex=0,s.tabIndex=0,this._register(addDisposableListener(s,"focus",r=>{e.focus(),r.preventDefault()})),this._register(addDisposableListener(i,"focus",r=>{t.focus(),r.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return r}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){var s;e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&getHoverAccessibleViewHint(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:s.getAriaLabel());i&&status(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const u=getDomNodeZoomLevel(d),f=d.getBoundingClientRect();return{top:f.top*u,bottom:f.bottom*u,right:f.right*u,left:f.left*u}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:r,left:o}=t[0],a=s-o,l=r-i,c={top:i,right:s,bottom:r,left:o,width:a,height:l,center:{x:o+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.clientHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight/2;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._hoverContainer.remove(),this._messageListeners.dispose(),this._target.dispose(),super.dispose()),this._isDisposed=!0}};HoverWidget=__decorate$2o([__param$2j(1,IKeybindingService),__param$2j(2,IConfigurationService),__param$2j(3,IOpenerService),__param$2j(4,IInstantiationService),__param$2j(5,IAccessibilityService)],HoverWidget);class CompositeMouseTracker extends Widget$1{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e){super(),this._elements=e,this._isMouseIn=!0,this._onMouseOut=this._register(new Emitter$1),this._elements.forEach(t=>this.onmouseover(t,()=>this._onTargetMouseOver(t))),this._elements.forEach(t=>this.onmouseleave(t,()=>this._onTargetMouseLeave(t)))}_onTargetMouseOver(e){this._isMouseIn=!0,this._clearEvaluateMouseStateTimeout(e)}_onTargetMouseLeave(e){this._isMouseIn=!1,this._evaluateMouseState(e)}_evaluateMouseState(e){this._clearEvaluateMouseStateTimeout(e),this._mouseTimeout=getWindow(e).setTimeout(()=>this._fireIfMouseOutside(),0)}_clearEvaluateMouseStateTimeout(e){this._mouseTimeout&&(getWindow(e).clearTimeout(this._mouseTimeout),this._mouseTimeout=void 0)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class ElementHoverTarget{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var Range$1;(function(n){function e(r,o){if(r.start>=o.end||o.start>=r.end)return{start:0,end:0};const a=Math.max(r.start,o.start),l=Math.min(r.end,o.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(r){return r.end-r.start<=0}n.isEmpty=t;function i(r,o){return!t(e(r,o))}n.intersects=i;function s(r,o){const a=[],l={start:r.start,end:Math.min(o.start,r.end)},c={start:Math.max(o.end,r.start),end:r.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(Range$1||(Range$1={}));const contextview="";function isAnchor(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var LayoutAnchorMode;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(LayoutAnchorMode||(LayoutAnchorMode={}));function layout(n,e,t){const i=t.mode===LayoutAnchorMode.ALIGN?t.offset:t.offset+t.size,s=t.mode===LayoutAnchorMode.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const dl=class dl extends Disposable{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=Disposable.None,this.toDisposeOnSetContainer=Disposable.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=$$e(".context-view"),hide(this.view),this.setContainer(e,t),this._register(toDisposable(()=>this.setContainer(null,1)))}setContainer(e,t){var s;this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,(s=this.shadowRootHostElement)==null||s.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=$$e(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=SHADOW_ROOT_CSS,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild($$e("slot"))}else this.container.appendChild(this.view);const r=new DisposableStore;dl.BUBBLE_UP_EVENTS.forEach(o=>{r.add(addStandardDisposableListener(this.container,o,a=>{this.onDOMEvent(a,!1)}))}),dl.BUBBLE_DOWN_EVENTS.forEach(o=>{r.add(addStandardDisposableListener(this.container,o,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=r}}show(e){var t,i;this.isVisible()&&this.hide(),clearNode(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",show(this.view),this.toDisposeOnClean=e.render(this.view)||Disposable.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)==null||i.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(isIOS&&BrowserFeatures.pointerEvents)){this.hide();return}(t=(e=this.delegate)==null?void 0:e.layout)==null||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(isHTMLElement(e)){const f=getDomNodePagePosition(e),g=getDomNodeZoomLevel(e);t={top:f.top*g,left:f.left*g,width:f.width*g,height:f.height*g}}else isAnchor(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=getTotalWidth(this.view),s=getTotalHeight(this.view),r=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;const d=getActiveWindow();if(a===0){const f={offset:t.top-d.pageYOffset,size:t.height,position:r===0?0:1},g={offset:t.left,size:t.width,position:o===0?0:1,mode:LayoutAnchorMode.ALIGN};l=layout(d.innerHeight,s,f)+d.pageYOffset,Range$1.intersects({start:l,end:l+s},{start:f.offset,end:f.offset+f.size})&&(g.mode=LayoutAnchorMode.AVOID),c=layout(d.innerWidth,i,g)}else{const f={offset:t.left,size:t.width,position:o===0?0:1},g={offset:t.top,size:t.height,position:r===0?0:1,mode:LayoutAnchorMode.ALIGN};c=layout(d.innerWidth,i,f),Range$1.intersects({start:c,end:c+i},{start:f.offset,end:f.offset+f.size})&&(g.mode=LayoutAnchorMode.AVOID),l=layout(d.innerHeight,s,g)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(r===0?"bottom":"top"),this.view.classList.add(o===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=getDomNodePagePosition(this.container);this.view.style.top=`${l-(this.useFixedPosition?getDomNodePagePosition(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?getDomNodePagePosition(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),hide(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,getWindow(e).document.activeElement):t&&!isAncestor$1(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};dl.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],dl.BUBBLE_DOWN_EVENTS=["click"];let ContextView=dl;const SHADOW_ROOT_CSS=` + :host { + all: initial; /* 1st rule so subsequent properties are reset. */ + } + + .codicon[class*='codicon-'] { + font: normal normal normal 16px/1 codicon; + display: inline-block; + text-decoration: none; + text-rendering: auto; + text-align: center; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + } + + :host { + font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; + } + + :host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } + :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } + :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } + :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } + :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } + + :host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } + :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } + :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } + :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } + :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } + + :host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } + :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } + :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } +`;var __decorate$2n=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ContextViewHandler=class extends Disposable{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new ContextView(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(getWindow(t))?s=1:i?s=3:s=2:s=1,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const r={close:()=>{this.openContextView===r&&this.hideContextView()}};return this.openContextView=r,r}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};ContextViewHandler=__decorate$2n([__param$2i(0,ILayoutService)],ContextViewHandler);class ContextViewService extends ContextViewHandler{getContextViewElement(){return this.contextView.getViewElement()}}class ManagedHoverWidget{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||isString$3(e)||isHTMLElement(e))s=e;else if(!isFunction$2(e.markdown))s=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(localize("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new CancellationTokenSource$1;const r=this._cancellationTokenSource.token;if(s=await e.markdown(r),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){var r;const s=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,actions:i==null?void 0:i.actions,linkHandler:i==null?void 0:i.linkHandler,trapFocus:i==null?void 0:i.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s,showHoverHint:(r=i==null?void 0:i.appearance)==null?void 0:r.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?isMarkdownString(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)==null?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)==null||e.dispose(),(t=this._cancellationTokenSource)==null||t.dispose(!0),this._cancellationTokenSource=void 0}}var __decorate$2m=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2h=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let HoverService=class extends Disposable{constructor(e,t,i,s,r){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=s,this._accessibilityService=r,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new ContextViewHandler(this._layoutService))}showHover(e,t,i){var l,c,d,u;if(getHoverOptionsIdentity(this._currentHoverOptions)===getHoverOptionsIdentity(e)||this._currentHover&&((c=(l=this._currentHoverOptions)==null?void 0:l.persistence)!=null&&c.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const s=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),r=getActiveElement();i||(s&&r?r.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=r):this._lastFocusedElementBeforeOpen=void 0);const o=new DisposableStore,a=this._instantiationService.createInstance(HoverWidget,e);if((d=e.persistence)!=null&&d.sticky&&(a.isLocked=!0),a.onDispose(()=>{var g,m;((g=this._currentHover)==null?void 0:g.domNode)&&isAncestorOfActiveElement(this._currentHover.domNode)&&((m=this._lastFocusedElementBeforeOpen)==null||m.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),o.dispose()},void 0,o),!e.container){const f=isHTMLElement(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(getWindow(f))}if(this._contextViewHandler.showContextView(new HoverContextViewDelegate(a,t),e.container),a.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),(u=e.persistence)!=null&&u.sticky)o.add(addDisposableListener(getWindow(e.container).document,EventType$1.MOUSE_DOWN,f=>{isAncestor$1(f.target,a.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const g of e.target.targetElements)o.add(addDisposableListener(g,EventType$1.CLICK,()=>this.hideHover()));else o.add(addDisposableListener(e.target,EventType$1.CLICK,()=>this.hideHover()));const f=getActiveElement();if(f){const g=getWindow(f).document;o.add(addDisposableListener(f,EventType$1.KEY_DOWN,m=>{var _;return this._keyDown(m,a,!!((_=e.persistence)!=null&&_.hideOnKeyDown))})),o.add(addDisposableListener(g,EventType$1.KEY_DOWN,m=>{var _;return this._keyDown(m,a,!!((_=e.persistence)!=null&&_.hideOnKeyDown))})),o.add(addDisposableListener(f,EventType$1.KEY_UP,m=>this._keyUp(m,a))),o.add(addDisposableListener(g,EventType$1.KEY_UP,m=>this._keyUp(m,a)))}}if("IntersectionObserver"in mainWindow){const f=new IntersectionObserver(m=>this._intersectionChange(m,a),{threshold:0}),g="targetElements"in e.target?e.target.targetElements[0]:e.target;f.observe(g),o.add(toDisposable(()=>f.disconnect()))}return this._currentHover=a,a}hideHover(){var e;(e=this._currentHover)!=null&&e.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showHover(this._lastHoverOptions,!0,!0)}_keyDown(e,t,i){var o,a;if(e.key==="Alt"){t.isLocked=!0;return}const s=new StandardKeyboardEvent(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||i&&(!((o=this._currentHoverOptions)!=null&&o.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(a=this._lastFocusedElementBeforeOpen)==null||a.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)==null||i.focus()))}setupManagedHover(e,t,i,s){t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let r,o;const a=(w,L)=>{var N;const I=o!==void 0;w&&(o==null||o.dispose(),o=void 0),L&&(r==null||r.dispose(),r=void 0),I&&((N=e.onDidHideHover)==null||N.call(e),o=void 0)},l=(w,L,I,N)=>new TimeoutTimer(async()=>{(!o||o.isDisposed)&&(o=new ManagedHoverWidget(e,I||t,w>0),await o.update(typeof i=="function"?i():i,L,{...s,trapFocus:N}))},w);let c=!1;const d=addDisposableListener(t,EventType$1.MOUSE_DOWN,()=>{c=!0,a(!0,!0)},!0),u=addDisposableListener(t,EventType$1.MOUSE_UP,()=>{c=!1},!0),f=addDisposableListener(t,EventType$1.MOUSE_LEAVE,w=>{c=!1,a(!1,w.fromElement===t)},!0),g=w=>{if(r)return;const L=new DisposableStore,I={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const N=R=>{I.x=R.x+10,isHTMLElement(R.target)&&getHoverTargetElement(R.target,t)!==t&&a(!0,!0)};L.add(addDisposableListener(t,EventType$1.MOUSE_MOVE,N,!0))}r=L,!(isHTMLElement(w.target)&&getHoverTargetElement(w.target,t)!==t)&&L.add(l(e.delay,!1,I))},m=addDisposableListener(t,EventType$1.MOUSE_OVER,g,!0),_=()=>{if(c||r)return;const w={targetElements:[t],dispose:()=>{}},L=new DisposableStore,I=()=>a(!0,!0);L.add(addDisposableListener(t,EventType$1.BLUR,I,!0)),L.add(l(e.delay,!1,w)),r=L};let v;const C=t.tagName.toLowerCase();C!=="input"&&C!=="textarea"&&(v=addDisposableListener(t,EventType$1.FOCUS,_,!0));const S={show:w=>{a(!1,!0),l(0,w,void 0,w)},hide:()=>{a(!0,!0)},update:async(w,L)=>{i=w,await(o==null?void 0:o.update(i,void 0,L))},dispose:()=>{this._managedHovers.delete(t),m.dispose(),f.dispose(),d.dispose(),u.dispose(),v==null||v.dispose(),a(!0,!0)}};return this._managedHovers.set(t,S),S}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};HoverService=__decorate$2m([__param$2h(0,IInstantiationService),__param$2h(1,IContextMenuService),__param$2h(2,IKeybindingService),__param$2h(3,ILayoutService),__param$2h(4,IAccessibilityService)],HoverService);function getHoverOptionsIdentity(n){if(n!==void 0)return(n==null?void 0:n.id)??n}class HoverContextViewDelegate{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function getHoverTargetElement(n,e){for(e=e??getWindow(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}registerSingleton(IHoverService,HoverService,1);registerThemingParticipant((n,e)=>{const t=n.getColor(editorHoverBorder);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const IBulkEditService=createDecorator("IWorkspaceEditService");class ResourceEdit{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(ResourceTextEdit.is(t))return ResourceTextEdit.lift(t);if(ResourceFileEdit.is(t))return ResourceFileEdit.lift(t);throw new Error("Unsupported edit")})}}class ResourceTextEdit extends ResourceEdit{static is(e){return e instanceof ResourceTextEdit?!0:isObject(e)&&URI.isUri(e.resource)&&isObject(e.textEdit)}static lift(e){return e instanceof ResourceTextEdit?e:new ResourceTextEdit(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class ResourceFileEdit extends ResourceEdit{static is(e){return e instanceof ResourceFileEdit?!0:isObject(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof ResourceFileEdit?e:new ResourceFileEdit(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const diffEditorDefaultOptions={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},editorConfigurationBaseNode=Object.freeze({id:"editor",order:5,type:"object",title:localize("editorConfigurationTitle","Editor"),scope:5}),editorConfiguration={...editorConfigurationBaseNode,properties:{"editor.tabSize":{type:"number",default:EDITOR_MODEL_DEFAULTS.tabSize,minimum:1,markdownDescription:localize("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:localize("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.insertSpaces,markdownDescription:localize("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.detectIndentation,markdownDescription:localize("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,description:localize("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:EDITOR_MODEL_DEFAULTS.largeFileOptimizations,description:localize("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[localize("wordBasedSuggestions.off","Turn off Word Based Suggestions."),localize("wordBasedSuggestions.currentDocument","Only suggest words from the active document."),localize("wordBasedSuggestions.matchingDocuments","Suggest words from all open documents of the same language."),localize("wordBasedSuggestions.allDocuments","Suggest words from all open documents.")],description:localize("wordBasedSuggestions","Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[localize("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),localize("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),localize("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:localize("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:localize("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:localize("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:localize("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:localize("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:localize("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:localize("editor.experimental.treeSitterTelemetry","Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `editor.experimental.preferTreeSitter` for specific languages will take precedence."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:localize("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:localize("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:localize("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:localize("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:localize("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:localize("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:diffEditorDefaultOptions.maxComputationTime,description:localize("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:diffEditorDefaultOptions.maxFileSize,description:localize("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:diffEditorDefaultOptions.renderSideBySide,description:localize("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:diffEditorDefaultOptions.renderSideBySideInlineBreakpoint,description:localize("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:diffEditorDefaultOptions.useInlineViewWhenSpaceIsLimited,description:localize("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:diffEditorDefaultOptions.renderMarginRevertIcon,description:localize("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:diffEditorDefaultOptions.renderGutterMenu,description:localize("renderGutterMenu","When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:diffEditorDefaultOptions.ignoreTrimWhitespace,description:localize("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:diffEditorDefaultOptions.renderIndicators,description:localize("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:diffEditorDefaultOptions.diffCodeLens,description:localize("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:diffEditorDefaultOptions.diffWordWrap,markdownEnumDescriptions:[localize("wordWrap.off","Lines will never wrap."),localize("wordWrap.on","Lines will wrap at the viewport width."),localize("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:diffEditorDefaultOptions.diffAlgorithm,markdownEnumDescriptions:[localize("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),localize("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:diffEditorDefaultOptions.hideUnchangedRegions.enabled,markdownDescription:localize("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:diffEditorDefaultOptions.hideUnchangedRegions.revealLineCount,markdownDescription:localize("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:diffEditorDefaultOptions.hideUnchangedRegions.minimumLineCount,markdownDescription:localize("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:diffEditorDefaultOptions.hideUnchangedRegions.contextLineCount,markdownDescription:localize("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:diffEditorDefaultOptions.experimental.showMoves,markdownDescription:localize("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:diffEditorDefaultOptions.experimental.showEmptyDecorations,description:localize("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:diffEditorDefaultOptions.experimental.useTrueInlineView,description:localize("useTrueInlineView","If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function isConfigurationPropertySchema(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of editorOptionsRegistry){const e=n.schema;if(typeof e<"u")if(isConfigurationPropertySchema(e))editorConfiguration.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(editorConfiguration.properties[t]=e[t])}let cachedEditorConfigurationKeys=null;function getEditorConfigurationKeys(){return cachedEditorConfigurationKeys===null&&(cachedEditorConfigurationKeys=Object.create(null),Object.keys(editorConfiguration.properties).forEach(n=>{cachedEditorConfigurationKeys[n]=!0})),cachedEditorConfigurationKeys}function isEditorConfigurationKey(n){return getEditorConfigurationKeys()[`editor.${n}`]||!1}function isDiffEditorConfigurationKey(n){return getEditorConfigurationKeys()[`diffEditor.${n}`]||!1}const configurationRegistry$1=Registry.as(Extensions$6.Configuration);configurationRegistry$1.registerConfiguration(editorConfiguration);class EditOperation{static insert(e,t){return{range:new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function freeze(n){return Object.isFrozen(n)?n:deepFreeze(n)}class ConfigurationModel{static createEmptyModel(e){return new ConfigurationModel({},[],[],void 0,e)}constructor(e,t,i,s,r){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.logService=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if((e=this.raw)!=null&&e.length){const t=this.raw.map(i=>{if(i instanceof ConfigurationModel)return i;const s=new ConfigurationModelParser("",this.logService);return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?getConfigurationValue(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return freeze(i.rawConfiguration.getValue(e))},get override(){return t?freeze(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return freeze(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:r,identifiers:o,keys:a}of i.rawConfiguration.overrides){const l=new ConfigurationModel(r,a,[],void 0,i.logService).getValue(e);l!==void 0&&s.push({identifiers:o,value:l})}return s.length?freeze(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?getConfigurationValue(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var o,a;const t=deepClone(this.contents),i=deepClone(this.overrides),s=[...this.keys],r=(o=this.raw)!=null&&o.length?[...this.raw]:[this];for(const l of e)if(r.push(...(a=l.raw)!=null&&a.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(t,l.contents);for(const c of l.overrides){const[d]=i.filter(u=>equals$1(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=distinct(d.keys)):i.push(deepClone(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new ConfigurationModel(t,s,i,r.every(l=>l instanceof ConfigurationModel)?void 0:r,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of distinct([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[s];const o=t[s];o&&(typeof r=="object"&&typeof o=="object"?(r=deepClone(r),this.mergeContents(r,o)):r=o),i[s]=r}return new ConfigurationModel(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&isObject(e[i])&&isObject(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=deepClone(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=r=>{r&&(i?this.mergeContents(i,r):i=deepClone(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&s(r.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),removeFromValueTree(this.contents,e),OVERRIDE_PROPERTY_REGEX.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>equals$1(i.identifiers,overrideIdentifiersFromKey(e))),1))}updateValue(e,t,i){if(addToValueTree(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),OVERRIDE_PROPERTY_REGEX.test(e)){const s=overrideIdentifiersFromKey(e),r={identifiers:s,keys:Object.keys(this.contents[e]),contents:toValuesTree(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>equals$1(a.identifiers,s));o!==-1?this.overrides[o]=r:this.overrides.push(r)}}}class ConfigurationModelParser{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||ConfigurationModel.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:r,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new ConfigurationModel(i,s,r,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const i=Registry.as(Extensions$6.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const r=toValuesTree(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),o=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:o,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var l,c,d;let r=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!((l=s==null?void 0:s.exclude)!=null&&l.length))return{raw:e,restricted:[],hasExcludedProperties:r};const o={},a=[];for(const u in e)if(OVERRIDE_PROPERTY_REGEX.test(u)&&i){const f=this.filter(e[u],t,!1,s);o[u]=f.raw,r=r||f.hasExcludedProperties,a.push(...f.restricted)}else{const f=t[u],g=f?typeof f.scope<"u"?f.scope:3:void 0;f!=null&&f.restricted&&a.push(u),!((c=s.exclude)!=null&&c.includes(u))&&((d=s.include)!=null&&d.includes(u)||(g===void 0||s.scopes===void 0||s.scopes.includes(g))&&!(s.skipRestricted&&(f!=null&&f.restricted)))?o[u]=e[u]:r=!0}return{raw:o,restricted:a,hasExcludedProperties:r}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(OVERRIDE_PROPERTY_REGEX.test(s)){const r={};for(const o in e[s])r[o]=e[s][o];i.push({identifiers:overrideIdentifiersFromKey(s),keys:Object.keys(r),contents:toValuesTree(r,t)})}return i}}class ConfigurationInspectValue{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=r,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=f,this.memoryConfigurationModel=g}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class Configuration{constructor(e,t,i,s,r,o,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=r,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ResourceMap,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=ConfigurationModel.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),r=this.getFolderConfigurationModelForResource(t.resource,i),o=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new ConfigurationInspectValue(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,r||void 0,o)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const r=this._memoryConfigurationByResource.get(e);r&&(i=i.merge(r))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:r}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),r=this.parseConfigurationModel(e.application,t),o=this.parseConfigurationModel(e.user,t),a=this.parseConfigurationModel(e.workspace,t),l=e.folders.reduce((c,d)=>(c.set(URI.revive(d[0]),this.parseConfigurationModel(d[1],t)),c),new ResourceMap);return new Configuration(i,s,r,o,ConfigurationModel.createEmptyModel(t),a,l,ConfigurationModel.createEmptyModel(t),new ResourceMap,t)}static parseConfigurationModel(e,t){return new ConfigurationModel(e.contents,e.keys,e.overrides,void 0,t)}}class ConfigurationChangeEvent{constructor(e,t,i,s,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=r,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Configuration.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var a;const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const r=s+i.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(a=this.previous)==null?void 0:a.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!equals(l,c)}return!0}}class IMEImpl{constructor(){this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const IME=new IMEImpl,NoMatchingKb={kind:0},MoreChordsNeeded={kind:1};function KbFound(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class KeybindingResolver{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const r of e){const o=r.command;o&&o.charAt(0)!=="-"&&this._defaultBoundCommands.set(o,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=KeybindingResolver.handleRemovals([].concat(e).concat(t));for(let r=0,o=this._keybindings.length;r"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const r=i[s];if(r.command===t.command)continue;let o=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const r=i[s];if(t.contextMatchesRules(r.when))return r}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const r=this._map.get(s[0]);if(r===void 0)return this._log("\\ No keybinding entries."),NoMatchingKb;let o=null;if(s.length<2)o=r;else{o=[];for(let l=0,c=r.length;ld.chords.length)continue;let u=!0;for(let f=1;f=0;i--){const s=t[i];if(KeybindingResolver._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function printWhenExplanation(n){return n?`${n.serialize()}`:"no when condition"}function printSourceExplanation(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const HIGH_FREQ_COMMANDS=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class AbstractKeybindingService extends Disposable{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Event$1.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=r,this._onDidUpdateKeybindings=this._register(new Emitter$1),this._currentChords=[],this._currentChordChecker=new IntervalTimer,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new TimeoutTimer,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),NoMatchingKb;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),NoMatchingKb;const r=this._contextKeyService.getContext(t),o=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(r,o,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw illegalState("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(localize("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(localize("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),IME.enabled&&IME.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],IME.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=KeybindingModifierSet.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=i.getChords();return this._ignoreSingleModifiers=new KeybindingModifierSet(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,o=null;if(i){const[d]=e.getSingleModifierDispatchChords();r=d,o=d?[d]:[]}else[r]=e.getDispatchChords(),o=this._currentChords.map(({keypress:d})=>d);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,o,r);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:u})=>u).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(localize("missing.chord","The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(r,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:u})=>u).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(localize("missing.chord","The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(s=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}HIGH_FREQ_COMMANDS.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const Fh=class Fh{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};Fh.EMPTY=new Fh(null);let KeybindingModifierSet=Fh;class ResolvedKeybindingItem{constructor(e,t,i,s,r,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?toEmptyArrayIfContainsNull(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=toEmptyArrayIfContainsNull(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=r,this.extensionId=o,this.isBuiltinExtension=a}}function toEmptyArrayIfContainsNull(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return AriaLabelProvider.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:ElectronAcceleratorLabelProvider.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return UserSettingsLabelProvider.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new ResolvedChord(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class USLayoutResolvedKeybinding extends BaseResolvedKeybinding{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return KeyCodeUtils.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":KeyCodeUtils.toString(e.keyCode)}_getElectronAccelerator(e){return KeyCodeUtils.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=KeyCodeUtils.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return USLayoutResolvedKeybinding.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=KeyCodeUtils.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=IMMUTABLE_CODE_TO_KEY_CODE[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof KeyCodeChord)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new KeyCodeChord(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=toEmptyArrayIfContainsNull(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new USLayoutResolvedKeybinding(i,t)]:[]}}const ILabelService=createDecorator("labelService"),IProgressService=createDecorator("progressService"),ym=class ym{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};ym.None=Object.freeze({report(){}});let Progress=ym;const IEditorProgressService=createDecorator("editorProgressService");class StringIterator{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new TernarySearchTree(new UriIterator(e,t))}static forStrings(){return new TernarySearchTree(new StringIterator)}static forConfigKeys(){return new TernarySearchTree(new ConfigKeysIterator)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new TernarySearchTreeNode,this._root.segment=i.value());const r=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new TernarySearchTreeNode,s.left.segment=i.value()),r.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new TernarySearchTreeNode,s.right.segment=i.value()),r.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new TernarySearchTreeNode,s.mid.segment=i.value()),r.push([0,s]),s=s.mid;else break}const o=s.value;s.value=t,s.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=r[a][0],u=r[a+1][0];if(d===1&&u===1)r[a][1]=l.rotateLeft();else if(d===-1&&u===-1)r[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){var t;return(t=this._getNode(e))==null?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)s.push([-1,r]),r=r.left;else if(o<0)s.push([1,r]),r=r.right;else if(i.hasNext())i.next(),s.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=this._min(r.right);if(o.key){const{key:a,value:l,segment:c}=o;this._delete(o.key,!1),r.key=a,r.value=l,r.segment=c}}else{const o=r.left??r.right;if(s.length>0){const[a,l]=s[s.length-1];switch(a){case-1:l.left=o;break;case 0:l.mid=o;break;case 1:l.right=o;break}}else this._root=o}for(let o=s.length-1;o>=0;o--){const a=s[o][1];a.updateHeight();const l=a.balanceFactor();if(l>1?(a.right.balanceFactor()>=0||(a.right=a.right.rotateRight()),s[o][1]=a.rotateLeft()):l<-1&&(a.left.balanceFactor()<=0||(a.left=a.left.rotateLeft()),s[o][1]=a.rotateRight()),o>0)switch(s[o-1][0]){case-1:s[o-1][1].left=s[o][1];break;case 1:s[o-1][1].right=s[o][1];break;case 0:s[o-1][1].mid=s[o][1];break}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const r=i.cmp(s.segment);if(r>0)s=s.left;else if(r<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const IWorkspaceContextService=createDecorator("contextService");function isSingleFolderWorkspaceIdentifier(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&URI.isUri(e.uri)}function isEmptyWorkspaceIdentifier(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!isSingleFolderWorkspaceIdentifier(n)&&!isWorkspaceIdentifier(n)}const EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE={id:"ext-dev"},UNKNOWN_EMPTY_WINDOW_WORKSPACE={id:"empty-window"};function toWorkspaceIdentifier(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:basename$2(n)}:e?EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE:UNKNOWN_EMPTY_WINDOW_WORKSPACE;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function isWorkspaceIdentifier(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&URI.isUri(e.configPath)}class WorkspaceFolder{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const WORKSPACE_EXTENSION="code-workspace";localize("codeWorkspace","Code Workspace");const STANDALONE_EDITOR_WORKSPACE_ID="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function isStandaloneEditorWorkspace(n){return n.id===STANDALONE_EDITOR_WORKSPACE_ID}var InspectTokensNLS;(function(n){n.inspectTokensAction=localize("inspectTokens","Developer: Inspect Tokens")})(InspectTokensNLS||(InspectTokensNLS={}));var GoToLineNLS;(function(n){n.gotoLineActionLabel=localize("gotoLineActionLabel","Go to Line/Column...")})(GoToLineNLS||(GoToLineNLS={}));var QuickHelpNLS;(function(n){n.helpQuickAccessActionLabel=localize("helpQuickAccess","Show all Quick Access Providers")})(QuickHelpNLS||(QuickHelpNLS={}));var QuickCommandNLS;(function(n){n.quickCommandActionLabel=localize("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=localize("quickCommandActionHelp","Show And Run Commands")})(QuickCommandNLS||(QuickCommandNLS={}));var QuickOutlineNLS;(function(n){n.quickOutlineActionLabel=localize("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=localize("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(QuickOutlineNLS||(QuickOutlineNLS={}));var StandaloneCodeEditorNLS;(function(n){n.editorViewAccessibleLabel=localize("editorViewAccessibleLabel","Editor content")})(StandaloneCodeEditorNLS||(StandaloneCodeEditorNLS={}));var ToggleHighContrastNLS;(function(n){n.toggleHighContrast=localize("toggleHighContrast","Toggle High Contrast Theme")})(ToggleHighContrastNLS||(ToggleHighContrastNLS={}));var StandaloneServicesNLS;(function(n){n.bulkEditServiceSummary=localize("bulkEditServiceSummary","Made {0} edits in {1} files")})(StandaloneServicesNLS||(StandaloneServicesNLS={}));const IWorkspaceTrustManagementService=createDecorator("workspaceTrustManagementService");let registeredAssociations=[],nonUserRegisteredAssociations=[],userRegisteredAssociations=[];function registerPlatformLanguageAssociation(n,e=!1){_registerLanguageAssociation(n,!1,e)}function _registerLanguageAssociation(n,e,t){const i=toLanguageAssociationItem(n,e);registeredAssociations.push(i),i.userConfigured?userRegisteredAssociations.push(i):nonUserRegisteredAssociations.push(i),t&&!i.userConfigured&®isteredAssociations.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function toLanguageAssociationItem(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?parse$6(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(posix.sep)>=0:!1}}function clearPlatformLanguageAssociations(){registeredAssociations=registeredAssociations.filter(n=>n.userConfigured),nonUserRegisteredAssociations=[]}function getLanguageIds(n,e){return getAssociations(n,e).map(t=>t.id)}function getAssociations(n,e){let t;if(n)switch(n.scheme){case Schemas.file:t=n.fsPath;break;case Schemas.data:{t=DataUri.parseMetaData(n).get(DataUri.META_DATA_LABEL);break}case Schemas.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Mimes.unknown}];t=t.toLowerCase();const i=basename$2(t),s=getAssociationByPath(t,i,userRegisteredAssociations);if(s)return[s,{id:PLAINTEXT_LANGUAGE_ID,mime:Mimes.text}];const r=getAssociationByPath(t,i,nonUserRegisteredAssociations);if(r)return[r,{id:PLAINTEXT_LANGUAGE_ID,mime:Mimes.text}];if(e){const o=getAssociationByFirstline(e);if(o)return[o,{id:PLAINTEXT_LANGUAGE_ID,mime:Mimes.text}]}return[{id:"unknown",mime:Mimes.unknown}]}function getAssociationByPath(n,e,t){var o;let i,s,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){i=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const c=l.filepatternOnPath?n:e;(o=l.filepatternLowercase)!=null&&o.call(l,c)&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(i)return i;if(s)return s;if(r)return r}function getAssociationByFirstline(n){if(startsWithUTF8BOM(n)&&(n=n.substr(1)),n.length>0)for(let e=registeredAssociations.length-1;e>=0;e--){const t=registeredAssociations[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const hasOwnProperty$4=Object.prototype.hasOwnProperty,NULL_LANGUAGE_ID="vs.editor.nullLanguage";class LanguageIdCodec{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(NULL_LANGUAGE_ID,0),this._register(PLAINTEXT_LANGUAGE_ID,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||NULL_LANGUAGE_ID}}const Vd=class Vd extends Disposable{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,Vd.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new LanguageIdCodec,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(ModesRegistry.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){Vd.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},clearPlatformLanguageAssociations();const e=[].concat(ModesRegistry.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),Registry.as(Extensions$6.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;hasOwnProperty$4.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)registerPlatformLanguageAssociation({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)registerPlatformLanguageAssociation({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)registerPlatformLanguageAssociation({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);regExpLeadsToEndlessLoop(l)||registerPlatformLanguageAssociation({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let r=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const o=r!==null&&r.length>0;if(!(o&&r[0]===null)){const a=(o?r[0]:null)||i;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?hasOwnProperty$4.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return hasOwnProperty$4.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&hasOwnProperty$4.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:getLanguageIds(e,t)}};Vd.instanceCount=0;let LanguagesRegistry=Vd;const strictEquals=(n,e)=>n===e;function itemsEquals(n=strictEquals){return(e,t)=>equals$1(e,t,n)}function itemEquals(){return(n,e)=>n.equals(e)}function equalsIfDefined(n,e,t){if(t!==void 0){const i=n;return i==null||e===void 0||e===null?e===i:t(i,e)}else{const i=n;return(s,r)=>s==null||r===void 0||r===null?r===s:i(s,r)}}function structuralEquals(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t{const r=getFunctionName(s);if(r!==void 0)return r;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r))}flatten(){return _derived({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(_recomputeInitiallyAndOnChange(this,t)),this}keepObserved(e){return e.add(_keepObserved(this)),this}}class BaseObservable extends ConvenientObservable{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 transaction(n,e){const t=new TransactionImpl(n,e);try{n(t)}finally{t.finish()}}let _globalTransaction;function globalTransaction(n){if(_globalTransaction)n(_globalTransaction);else{const e=new TransactionImpl(n,void 0);_globalTransaction=e;try{n(e)}finally{e.finish(),_globalTransaction=void 0}}}async function asyncTransaction(n,e){const t=new TransactionImpl(n,e);try{await n(t)}finally{t.finish()}}function subtransaction(n,e,t){n?e(n):transaction(e,t)}class TransactionImpl{constructor(e,t){this._fn=e,this._getDebugName=t,this.updatingObservers=[]}getDebugName(){return this._getDebugName?this._getDebugName():getFunctionName(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this.updatingObservers;for(let t=0;t{},()=>`Setting ${this.debugName}`));try{const o=this._value;this._setValue(e),(r=getLogger())==null||r.handleObservableChanged(this,{oldValue:o,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function disposableObservableValue(n,e){let t;return typeof n=="string"?t=new DebugNameData(void 0,n,void 0):t=new DebugNameData(n,void 0,void 0),new DisposableObservableValue(t,e,strictEquals)}class DisposableObservableValue extends ObservableValue{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)==null||e.dispose()}}function derived(n,e){return e!==void 0?new Derived(new DebugNameData(n,void 0,e),e,void 0,void 0,void 0,strictEquals):new Derived(new DebugNameData(void 0,void 0,n),n,void 0,void 0,void 0,strictEquals)}function derivedWithSetter(n,e,t){return new DerivedWithSetter(new DebugNameData(n,void 0,e),e,void 0,void 0,void 0,strictEquals,t)}function derivedOpts(n,e){return new Derived(new DebugNameData(n.owner,n.debugName,n.debugReferenceFn),e,void 0,void 0,n.onLastObserverRemoved,n.equalsFn??strictEquals)}_setDerivedOpts(derivedOpts);function derivedHandleChanges(n,e){return new Derived(new DebugNameData(n.owner,n.debugName,void 0),e,n.createEmptyChangeSummary,n.handleChange,void 0,n.equalityComparer??strictEquals)}function derivedWithStore(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new DisposableStore;return new Derived(new DebugNameData(i,void 0,t),r=>(s.clear(),t(r,s)),void 0,void 0,()=>s.dispose(),strictEquals)}function derivedDisposable(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);let s;return new Derived(new DebugNameData(i,void 0,t),r=>{s?s.clear():s=new DisposableStore;const o=t(r);return o&&s.add(o),o},void 0,void 0,()=>{s&&(s.dispose(),s=void 0)},strictEquals)}class Derived extends BaseObservable{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s,r=void 0,o){var a;super(),this._debugNameData=e,this._computeFn=t,this.createChangeSummary=i,this._handleChange=s,this._handleLastObserverRemoved=r,this._equalityComparator=o,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(a=this.createChangeSummary)==null?void 0:a.call(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)==null||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)==null?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var o;if(this.state===3)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e;const t=this.state!==0,i=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(o=this.createChangeSummary)==null?void 0:o.call(this);try{this.value=this._computeFn(this,s)}finally{for(const a of this.dependenciesToBeRemoved)a.removeObserver(this);this.dependenciesToBeRemoved.clear()}if(t&&!this._equalityComparator(i,this.value))for(const a of this.observers)a.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)}assertFn(()=>this.updateCount>=0)}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:r=>r===e},this.changeSummary):!0,s=this.state===3;if(i&&(this.state===1||s)&&(this.state=2,s))for(const r of this.observers)r.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}class DerivedWithSetter extends Derived{constructor(e,t,i,s,r=void 0,o,a){super(e,t,i,s,r,o),this.set=a}}function autorun(n){return new AutorunObserver(new DebugNameData(void 0,void 0,n),n,void 0,void 0)}function autorunOpts(n,e){return new AutorunObserver(new DebugNameData(n.owner,n.debugName,n.debugReferenceFn??e),e,void 0,void 0)}function autorunHandleChanges(n,e){return new AutorunObserver(new DebugNameData(n.owner,n.debugName,n.debugReferenceFn??e),e,n.createEmptyChangeSummary,n.handleChange)}function autorunWithStoreHandleChanges(n,e){const t=new DisposableStore,i=autorunHandleChanges({owner:n.owner,debugName:n.debugName,debugReferenceFn:n.debugReferenceFn??e,createEmptyChangeSummary:n.createEmptyChangeSummary,handleChange:n.handleChange},(s,r)=>{t.clear(),e(s,r,t)});return toDisposable(()=>{i.dispose(),t.dispose()})}function autorunWithStore(n){const e=new DisposableStore,t=autorunOpts({owner:void 0,debugName:void 0,debugReferenceFn:n},i=>{e.clear(),n(i,e)});return toDisposable(()=>{t.dispose(),e.dispose()})}class AutorunObserver{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s){var r;this._debugNameData=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(r=this.createChangeSummary)==null?void 0:r.call(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var i,s;if(this.state===3)return;const e=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=e,this.state=3;const t=this.disposed;try{if(!t){(i=getLogger())==null||i.handleAutorunTriggered(this);const r=this.changeSummary;this.changeSummary=(s=this.createChangeSummary)==null?void 0:s.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--,assertFn(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=AutorunObserver})(autorun||(autorun={}));function constObservable(n){return new ConstObservable(n)}class ConstObservable extends ConvenientObservable{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 observableFromEvent(...n){let e,t,i;return n.length===3?[e,t,i]=n:[t,i]=n,new FromEventObservable(new DebugNameData(e,void 0,i),t,i,()=>FromEventObservable.globalTransaction,strictEquals)}function observableFromEventOpts(n,e,t){return new FromEventObservable(new DebugNameData(n.owner,n.debugName,n.debugReferenceFn??t),e,t,()=>FromEventObservable.globalTransaction,n.equalsFn??strictEquals)}class FromEventObservable extends BaseObservable{constructor(e,t,i,s,r){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=s,this._equalityComparator=r,this.hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),l=this.value;(!this.hasValue||!this._equalityComparator(l,a))&&(this.value=a,this.hasValue&&subtransaction(this._getTransaction(),d=>{for(const u of this.observers)d.updateObserver(u,this),u.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")}),this.hasValue=!0)}}getDebugName(){return this._debugNameData.getDebugName(this)}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=FromEventObservable;function e(t,i){let s=!1;FromEventObservable.globalTransaction===void 0&&(FromEventObservable.globalTransaction=t,s=!0);try{i()}finally{s&&(FromEventObservable.globalTransaction=void 0)}}n.batchEventsGlobally=e})(observableFromEvent||(observableFromEvent={}));function observableSignalFromEvent(n,e){return new FromEventObservableSignal(n,e)}class FromEventObservableSignal extends BaseObservable{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{transaction(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function observableSignal(n){return typeof n=="string"?new ObservableSignal(n):new ObservableSignal(void 0,n)}class ObservableSignal extends BaseObservable{get debugName(){return new DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){transaction(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 keepObserved(n){const e=new KeepAliveObserver(!1,void 0);return n.addObserver(e),toDisposable(()=>{n.removeObserver(e)})}_setKeepObserved(keepObserved);function recomputeInitiallyAndOnChange(n,e){const t=new KeepAliveObserver(!0,e);return n.addObserver(t),e?e(n.get()):n.reportChanges(),toDisposable(()=>{n.removeObserver(t)})}_setRecomputeInitiallyAndOnChange(recomputeInitiallyAndOnChange);class KeepAliveObserver{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter--,this._counter===0&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges())}handlePossibleChange(e){}handleChange(e,t){}}function derivedObservableWithCache(n,e){let t;return derivedOpts({owner:n,debugReferenceFn:e},s=>(t=e(s,t),t))}function mapObservableArrayCached(n,e,t,i){let s=new ArrayMap(t,i);return derivedOpts({debugReferenceFn:t,owner:n,onLastObserverRemoved:()=>{s.dispose(),s=new ArrayMap(t)}},o=>(s.setItems(e.read(o)),s.getItems()))}class ArrayMap{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const s of e){const r=this._keySelector?this._keySelector(s):s;let o=this._cache.get(r);if(o)i.delete(r);else{const a=new DisposableStore;o={out:this._map(s,a),store:a},this._cache.set(r,o)}t.push(o.out)}for(const s of i)this._cache.get(s).store.dispose(),this._cache.delete(s);this._items=t}getItems(){return this._items}}function derivedConstOnceDefined(n,e){return derivedObservableWithCache(n,(t,i)=>i??e(t))}class ObservablePromise{static fromFn(e){return new ObservablePromise(e())}constructor(e){this._value=observableValue(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(transaction(i=>{this._value.set(new PromiseResult(t,void 0),i)}),t),t=>{throw transaction(i=>{this._value.set(new PromiseResult(void 0,t),i)}),t})}}class PromiseResult{constructor(e,t){this.data=e,this.error=t}}function waitForState(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,r)=>{let o=!0,a=!1;const l=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=autorun(d=>{const{isFinished:u,error:f,state:g}=l.read(d);(u||f)&&(o?a=!0:c.dispose(),f?r(f===!0?g:f):s(g))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),r(new CancellationError)});if(i.isCancellationRequested){c.dispose(),d.dispose(),r(new CancellationError);return}}o=!1,a&&c.dispose()})}class LazyObservableValue extends BaseObservable{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this.observers)for(const t of this._deltas)e.handleChange(this,t);this._deltas.length=0}else for(const e of this.observers)e.handleChange(this,void 0)}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this.observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this.observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this.observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let s;t||(t=s=new TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),i!==void 0&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(r,o)=>{},handlePossibleChange:r=>{}},this),this._updateCounter>1)for(const r of this.observers)r.handlePossibleChange(this)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function observableValueOpts(n,e){return n.lazy?new LazyObservableValue(new DebugNameData(n.owner,n.debugName,void 0),e,n.equalsFn??strictEquals):new ObservableValue(new DebugNameData(n.owner,n.debugName,void 0),e,n.equalsFn??strictEquals)}const Wd=class Wd extends Disposable{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new Emitter$1),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new Emitter$1),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new Emitter$1({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Wd.instanceCount++,this._registry=this._register(new LanguagesRegistry(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Wd.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return firstOrDefault(i,null)}createById(e){return new LanguageSelection(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new LanguageSelection(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=PLAINTEXT_LANGUAGE_ID),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),TokenizationRegistry.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Wd.instanceCount=0;let LanguageService=Wd;class LanguageSelection{constructor(e,t){this._value=observableFromEvent(this,e,()=>t()),this.onDidChange=Event$1.fromObservable(this._value)}get languageId(){return this._value.get()}}const DataTransfers={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Mimes.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},nullHoverDelegateFactory=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let hoverDelegateFactory=nullHoverDelegateFactory;const defaultHoverDelegateMouse=new Lazy(()=>hoverDelegateFactory("mouse",!1)),defaultHoverDelegateElement=new Lazy(()=>hoverDelegateFactory("element",!1));function setHoverDelegateFactory(n){hoverDelegateFactory=n}function getDefaultHoverDelegate(n){return n==="element"?defaultHoverDelegateElement.value:defaultHoverDelegateMouse.value}function createInstantHoverDelegate(){return hoverDelegateFactory("element",!0)}let baseHoverDelegate={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function setBaseLayerHoverDelegate(n){baseHoverDelegate=n}function getBaseLayerHoverDelegate(){return baseHoverDelegate}class CombinedSpliceable{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}const list="";class ListError extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function groupIntersect(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class RangeMap{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,r=groupIntersect({start:0,end:e},this.groups),o=groupIntersect({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:shift(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=concat$1(r,a,o),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var __decorate$2l=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};const StaticDND={CurrentDragAndDropData:void 0},DefaultOptions$1={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class ElementsDragAndDropData{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class ExternalElementsDragAndDropData{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NativeDragAndDropData{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const Bh=class Bh{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:getContentWidth(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=DefaultOptions$1){var o,a;if(this.virtualDelegate=t,this.domId=`list_id_${++Bh.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Delayer(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Disposable.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Disposable.None,this.onDragLeaveTimeout=Disposable.None,this.disposables=new DisposableStore,this._onDidChangeContentHeight=new Emitter$1,this._onDidChangeContentWidth=new Emitter$1,this.onDidChangeContentHeight=Event$1.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const l of i)this.renderers.set(l.templateId,l);this.cache=this.disposables.add(new RowCache(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??DefaultOptions$1.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new ListViewAccessibilityProvider(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??DefaultOptions$1.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Gesture.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Scrollable({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:l=>scheduleAtNextAnimationFrame(getWindow(this.domNode),l)})),this.scrollableElement=this.disposables.add(new SmoothScrollableElement(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??DefaultOptions$1.alwaysConsumeMouseWheel,horizontal:1,vertical:s.verticalScrollMode??DefaultOptions$1.verticalScrollMode,useShadows:s.useShadows??DefaultOptions$1.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(addDisposableListener(this.rowsContainer,EventType.Change,l=>this.onTouchChange(l))),this.disposables.add(addDisposableListener(this.scrollableElement.getDomNode(),"scroll",l=>l.target.scrollTop=0)),this.disposables.add(addDisposableListener(this.domNode,"dragover",l=>this.onDragOver(this.toDragEvent(l)))),this.disposables.add(addDisposableListener(this.domNode,"drop",l=>this.onDrop(this.toDragEvent(l)))),this.disposables.add(addDisposableListener(this.domNode,"dragleave",l=>this.onDragLeave(this.toDragEvent(l)))),this.disposables.add(addDisposableListener(this.domNode,"dragend",l=>this.onDragEnd(l))),this.setRowLineHeight=s.setRowLineHeight??DefaultOptions$1.setRowLineHeight,this.setRowHeight=s.setRowHeight??DefaultOptions$1.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??DefaultOptions$1.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(DefaultOptions$1.dnd),this.layout((o=s.initialSize)==null?void 0:o.height,(a=s.initialSize)==null?void 0:a.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new RangeMap(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},o=Range$1.intersect(s,r),a=new Map;for(let I=o.end-1;I>=o.start;I--){const N=this.items[I];if(N.dragStartDisposable.dispose(),N.checkedDisposable.dispose(),N.row){let R=a.get(N.templateId);R||(R=[],a.set(N.templateId,R));const T=this.renderers.get(N.templateId);T&&T.disposeElement&&T.disposeElement(N.element,I,N.row.templateData,N.size),R.unshift(N.row)}N.row=null,N.stale=!0}const l={start:e+t,end:this.items.length},c=Range$1.intersect(l,s),d=Range$1.relativeComplement(l,s),u=i.map(I=>({id:String(this.itemId++),element:I,templateId:this.virtualDelegate.getTemplateId(I),size:this.virtualDelegate.getHeight(I),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(I),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Disposable.None,checkedDisposable:Disposable.None,stale:!1}));let f;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),f=this.items,this.items=u):(this.rangeMap.splice(e,t,u),f=this.items.splice(e,t,...u));const g=i.length-t,m=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),_=shift(c,g),v=Range$1.intersect(m,_);for(let I=v.start;Ishift(I,g)),L=[{start:e,end:e+i.length},...S].map(I=>Range$1.intersect(m,I)).reverse();for(const I of L)for(let N=I.end-1;N>=I.start;N--){const R=this.items[N],T=a.get(R.templateId),A=T==null?void 0:T.pop();this.insertItemInDOM(N,A)}for(const I of a.values())for(const N of I)this.cache.release(N);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),f.map(I=>I.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=scheduleAtNextAnimationFrame(getWindow(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getRenderRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:getContentHeight(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:getContentWidth(this.domNode)})}render(e,t,i,s,r,o=!1){const a=this.getRenderRange(t,i),l=Range$1.relativeComplement(a,e).reverse(),c=Range$1.relativeComplement(e,a);if(o){const d=Range$1.intersect(e,a);for(let u=d.start;u{for(const d of c)for(let u=d.start;u=d.start;u--)this.insertItemInDOM(u)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&r!==void 0&&(this.rowsContainer.style.width=`${Math.max(r,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var l,c;const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const d=this.cache.alloc(i.templateId);i.row=d.row,i.stale||(i.stale=d.isReusingConnectedDomNode)}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const r=this.accessibilityProvider.isChecked(i.element);if(typeof r=="boolean")i.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const d=u=>i.row.domNode.setAttribute("aria-checked",String(!!u));d(r.value),i.checkedDisposable=r.onDidChange(()=>d(r.value))}if(i.stale||!i.row.domNode.parentElement){const d=((c=(l=this.items.at(e+1))==null?void 0:l.row)==null?void 0:c.domNode)??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==d)&&this.rowsContainer.insertBefore(i.row.domNode,d),i.stale=!1}this.updateItemInDOM(i,e);const o=this.renderers.get(i.templateId);if(!o)throw new Error(`No renderer found for template id ${i.templateId}`);o==null||o.renderElement(i.element,e,i.row.templateData,i.size);const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=addDisposableListener(i.row.domNode,"dragstart",d=>this.onDragStart(i.element,a,d))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=getContentWidth(e.row.domNode);const t=getWindow(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return Event$1.filter(Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return Event$1.any(Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),Event$1.map(this.disposables.add(new DomEmitter(this.domNode,EventType.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return Event$1.map(this.disposables.add(new DomEmitter(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return Event$1.map(this.disposables.add(new DomEmitter(this.rowsContainer,EventType.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,r=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:r}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var r,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(DataTransfers.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,i)),typeof a>"u"&&(a=String(s.length));const l=$$e(".monaco-drag-image");l.textContent=a,(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||this.domNode.ownerDocument})(this.domNode).appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>l.remove(),0)}this.domNode.classList.add("dragging"),this.currentDragData=new ElementsDragAndDropData(s),StaticDND.CurrentDragAndDropData=new ExternalElementsDragAndDropData(s),(o=(r=this.dnd).onDragStart)==null||o.call(r,this.currentDragData,i)}onDragOver(e){var r,o;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),StaticDND.CurrentDragAndDropData&&StaticDND.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(StaticDND.CurrentDragAndDropData)this.currentDragData=StaticDND.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new NativeDragAndDropData}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&((r=t.effect)==null?void 0:r.type)===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=distinct(i).filter(a=>a>=-1&&aa-l),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(equalsDragFeedback(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=toDisposable(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&i[0]{var a;for(const l of i){const c=this.items[l];c.dropTarget=!1,(a=c.row)==null||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=disposableTimeout(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)==null||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,StaticDND.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,StaticDND.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Disposable.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=getTopLeftOffset(this.domNode).top;this.dragOverAnimationDisposable=animate(getWindow(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=disposableTimeout(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return clamp(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(isHTMLElement(i)||isSVGElement(i))&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const r=Number(s);if(!isNaN(r))return r}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let r,o;e===this.elementTop(s.start)?(r=s.start,o=0):s.end-s.start>1&&(r=s.start+1,o=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=f.start;g--)this.insertItemInDOM(g);for(let f=l.start;f=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class TraitRenderer{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(r=>r.templateData===i);if(s>=0){const r=this.renderedElements[s];this.trait.unrender(i),r.index=t}else{const r={index:t,templateData:i};this.renderedElements.push(r)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const r of this.renderedElements)r.index=e+t&&s.push({index:r.index+i-t,templateData:r.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let Trait$1=class{get name(){return this._trait}get renderer(){return new TraitRenderer(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new Emitter$1,this.onChange=this._onChange.event}splice(e,t,i){const s=i.length-t,r=e+t,o=[];let a=0;for(;a=r;)o.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(o,o)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(numericSort),t)}_set(e,t,i){const s=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=disjunction(r,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return binarySearch(this.sortedIndexes,e,numericSort)>=0}dispose(){dispose(this._onChange)}};__decorate$2k([memoize],Trait$1.prototype,"renderer",null);class SelectionTrait extends Trait$1{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class TraitSpliceable{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const r=new Set(s),o=i.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,o)}}function isInputElement(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function isListElementDescendantOfClass(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:isListElementDescendantOfClass(n.parentElement,e)}function isMonacoEditor(n){return isListElementDescendantOfClass(n,"monaco-editor")}function isMonacoCustomToggle(n){return isListElementDescendantOfClass(n,"monaco-custom-toggle")}function isActionItem(n){return isListElementDescendantOfClass(n,"action-item")}function isStickyScrollElement(n){return isListElementDescendantOfClass(n,"monaco-tree-sticky-row")}function isStickyScrollContainer(n){return n.classList.contains("monaco-tree-sticky-container")}function isButton(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:isButton(n.parentElement)}class KeyboardController{get onKeyDown(){return Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event,e=>e.filter(t=>!isInputElement(t.target)).map(t=>new StandardKeyboardEvent(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new DisposableStore,this.multipleSelectionDisposables=new DisposableStore,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(isMacintosh?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(range$2(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}__decorate$2k([memoize],KeyboardController.prototype,"onKeyDown",null);var TypeNavigationMode;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(TypeNavigationMode||(TypeNavigationMode={}));var TypeNavigationControllerState;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(TypeNavigationControllerState||(TypeNavigationControllerState={}));const DefaultKeyboardNavigationDelegate=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class TypeNavigationController{constructor(e,t,i,s,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=r,this.enabled=!1,this.state=TypeNavigationControllerState.Idle,this.mode=TypeNavigationMode.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new DisposableStore,this.disposables=new DisposableStore,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??TypeNavigationMode.Automatic}enable(){if(this.enabled)return;let e=!1;const t=Event$1.chain(this.enabledDisposables.add(new DomEmitter(this.view.domNode,"keydown")).event,r=>r.filter(o=>!isInputElement(o.target)).filter(()=>this.mode===TypeNavigationMode.Automatic||this.triggered).map(o=>new StandardKeyboardEvent(o)).filter(o=>e||this.keyboardNavigationEventFilter(o)).filter(o=>this.delegate.mightProducePrintableCharacter(o)).forEach(o=>EventHelper.stop(o,!0)).map(o=>o.browserEvent.key)),i=Event$1.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);Event$1.reduce(Event$1.any(t,i),(r,o)=>o===null?null:(r||"")+o,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var t;const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const i=(t=this.list.options.accessibilityProvider)==null?void 0:t.getAriaLabel(this.list.element(e[0]));typeof i=="string"?alert$1(i):i&&alert$1(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=TypeNavigationControllerState.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===TypeNavigationControllerState.Idle?1:0;this.state=TypeNavigationControllerState.Typing;for(let r=0;r1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}else if(typeof l>"u"||matchesPrefix(e,l)){this.previouslyFocused=i,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class DOMFocusController{constructor(e,t){this.list=e,this.view=t,this.disposables=new DisposableStore;const i=Event$1.chain(this.disposables.add(new DomEmitter(t.domNode,"keydown")).event,r=>r.filter(o=>!isInputElement(o.target)).map(o=>new StandardKeyboardEvent(o)));Event$1.chain(i,r=>r.filter(o=>o.keyCode===2&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!isHTMLElement(s)||s.tabIndex===-1)return;const r=getWindow(s).getComputedStyle(s);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function isSelectionSingleChangeEvent(n){return isMacintosh?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function isSelectionRangeChangeEvent(n){return n.browserEvent.shiftKey}function isMouseRightClick(n){return isMouseEvent(n)&&n.button===2}const DefaultMultipleSelectionController={isSelectionSingleChangeEvent,isSelectionRangeChangeEvent};class MouseController{constructor(e){this.list=e,this.disposables=new DisposableStore,this._onPointer=new Emitter$1,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||DefaultMultipleSelectionController),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Gesture.addTarget(e.getHTMLElement()))),Event$1.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||DefaultMultipleSelectionController))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){isMonacoEditor(e.browserEvent.target)||getActiveElement()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),isMouseRightClick(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),r=Math.max(i,t),o=range$2(s,r+1),a=this.list.getSelection(),l=getContiguousRangeContaining(disjunction(a,[i]),i);if(l.length===0)return;const c=disjunction(o,relativeComplement(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),r=s.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class DefaultStyleController{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } + `),e.listFocusAndSelectionForeground&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } + `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=asCssValueWithDefault(e.listFocusAndSelectionOutline,asCssValueWithDefault(e.listSelectionOutline,e.listFocusOutline??""));s&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` + .monaco-drag-image, + .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } + .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } + `);const r=asCssValueWithDefault(e.listSelectionOutline,e.listInactiveFocusOutline??"");r&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` + .monaco-list${t}.drop-target, + .monaco-list${t} .monaco-list-rows.drop-target, + .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } + `),e.listDropBetweenBackground&&(i.push(` + .monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, + .monaco-list${t} .monaco-list-row.drop-target-before::before { + content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${e.listDropBetweenBackground}; + }`),i.push(` + .monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, + .monaco-list${t} .monaco-list-row.drop-target-after::after { + content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; + background-color: ${e.listDropBetweenBackground}; + }`)),e.tableColumnsBorder&&i.push(` + .monaco-table > .monaco-split-view2, + .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, + .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, + .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: ${e.tableColumnsBorder}; + } + + .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, + .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { + border-color: transparent; + } + `),e.tableOddRowsBackgroundColor&&i.push(` + .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, + .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { + background-color: ${e.tableOddRowsBackgroundColor}; + } + `),this.styleElement.textContent=i.join(` +`)}}const unthemedListStyles={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Color.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Color.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Color.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},DefaultOptions={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function getContiguousRangeContaining(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class PipelineRenderer{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let r=0;for(const o of this.renderers)o.renderElement(e,t,i[r++],s)}disposeElement(e,t,i,s){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)==null||o.call(a,e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class AccessibiltyRenderer{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new DisposableStore}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),r=s&&typeof s!="string"?s:constObservable(s);i.disposables.add(autorun(a=>{this.setAriaLabel(a.readObservable(r),i.container)}));const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.container.setAttribute("aria-level",`${o}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,s){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class ListViewDragAndDrop{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,e,t)}onDragOver(e,t,i,s,r){return this.dnd.onDragOver(e,t,i,s,r)}onDragLeave(e,t,i,s){var r,o;(o=(r=this.dnd).onDragLeave)==null||o.call(r,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}drop(e,t,i,s,r){this.dnd.drop(e,t,i,s,r)}dispose(){this.dnd.dispose()}}class List{get onDidChangeFocus(){return Event$1.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return Event$1.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event,r=>r.map(o=>new StandardKeyboardEvent(o)).filter(o=>e=o.keyCode===58||o.shiftKey&&o.keyCode===68).map(o=>EventHelper.stop(o,!0)).filter(()=>!1)),i=Event$1.chain(this.disposables.add(new DomEmitter(this.view.domNode,"keyup")).event,r=>r.forEach(()=>e=!1).map(o=>new StandardKeyboardEvent(o)).filter(o=>o.keyCode===58||o.shiftKey&&o.keyCode===68).map(o=>EventHelper.stop(o,!0)).map(({browserEvent:o})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:o}})),s=Event$1.chain(this.view.onContextMenu,r=>r.filter(o=>!e).map(({element:o,index:a,browserEvent:l})=>({element:o,index:a,anchor:new StandardMouseEvent(getWindow(this.view.domNode),l),browserEvent:l})));return Event$1.any(t,i,s)}get onKeyDown(){return this.disposables.add(new DomEmitter(this.view.domNode,"keydown")).event}get onDidFocus(){return Event$1.signal(this.disposables.add(new DomEmitter(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return Event$1.signal(this.disposables.add(new DomEmitter(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,r=DefaultOptions){var c,d,u;this.user=e,this._options=r,this.focus=new Trait$1("focused"),this.anchor=new Trait$1("anchor"),this.eventBufferer=new EventBufferer,this._ariaLabel="",this.disposables=new DisposableStore,this._onDidDispose=new Emitter$1,this.onDidDispose=this._onDidDispose.event;const o=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(c=this._options.accessibilityProvider)==null?void 0:c.getWidgetRole():"list";this.selection=new SelectionTrait(o!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=r.accessibilityProvider,this.accessibilityProvider&&(a.push(new AccessibiltyRenderer(this.accessibilityProvider)),(u=(d=this.accessibilityProvider).onDidChangeActiveDescendant)==null||u.call(d,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new PipelineRenderer(f.templateId,[...a,f]));const l={...r,dnd:r.dnd&&new ListViewDragAndDrop(this,r.dnd)};if(this.view=this.createListView(t,i,s,l),this.view.domNode.setAttribute("role",o),r.styleController)this.styleController=r.styleController(this.view.domId);else{const f=createStyleSheet(this.view.domNode);this.styleController=new DefaultStyleController(f,this.view.domId)}if(this.spliceable=new CombinedSpliceable([new TraitSpliceable(this.focus,this.view,r.identityProvider),new TraitSpliceable(this.selection,this.view,r.identityProvider),new TraitSpliceable(this.anchor,this.view,r.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new DOMFocusController(this,this.view)),(typeof r.keyboardSupport!="boolean"||r.keyboardSupport)&&(this.keyboardController=new KeyboardController(this,this.view,r),this.disposables.add(this.keyboardController)),r.keyboardNavigationLabelProvider){const f=r.keyboardNavigationDelegate||DefaultKeyboardNavigationDelegate;this.typeNavigationController=new TypeNavigationController(this,this.view,r.keyboardNavigationLabelProvider,r.keyboardNavigationEventFilter??(()=>!0),f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(r),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new ListView(e,t,i,s)}createMouseController(e){return new MouseController(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)==null||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)==null||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new ListError(this.user,`Invalid start index: ${e}`);if(t<0)throw new ListError(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new ListError(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return firstOrDefault(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new ListError(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const r=this.focus.get(),o=this.findNextIndex(r.length>0?r[0]+e:0,t,s);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const r=this.focus.get(),o=this.findPreviousIndex(r.length>0?r[0]-e:0,t,s);o>-1&&this.setFocus([o],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const r=this.findPreviousIndex(i,!1,t);r>-1&&s!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=this.view.getScrollTop();let o=r+this.view.renderHeight;i>s&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==r&&(this.setFocus([]),await timeout(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const r=i(),o=this.view.getScrollTop()+r;o===0?s=this.view.indexAt(o):s=this.view.indexAfter(o-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const l=this.findNextIndex(s,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([s],e)}else{const l=o;this.view.setScrollTop(o-this.view.renderHeight-r),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await timeout(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(isNumber$3(t)){const a=o-this.view.renderHeight+i;this.view.setScrollTop(a*clamp(t,0,1)+r-i)}else{const a=r+o,l=s+this.view.renderHeight;r=l||(r=l&&o>=this.view.renderHeight?this.view.setScrollTop(r-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new ListError(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const o=r-this.view.renderHeight+t;return Math.abs((i+t-s)/o)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var t;const e=this.focus.get();if(e.length>0){let i;(t=this.accessibilityProvider)!=null&&t.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}__decorate$2k([memoize],List.prototype,"onDidChangeFocus",null);__decorate$2k([memoize],List.prototype,"onDidChangeSelection",null);__decorate$2k([memoize],List.prototype,"onContextMenu",null);__decorate$2k([memoize],List.prototype,"onKeyDown",null);__decorate$2k([memoize],List.prototype,"onDidFocus",null);__decorate$2k([memoize],List.prototype,"onDidBlur",null);const selectBoxCustom="",$$b=$$e,SELECT_OPTION_ENTRY_TEMPLATE_ID="selectOption.entry.template";class SelectListRenderer{get templateId(){return SELECT_OPTION_ENTRY_TEMPLATE_ID}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=append$1(e,$$b(".option-text")),t.detail=append$1(e,$$b(".option-detail")),t.decoratorRight=append$1(e,$$b(".option-decorator-right")),t}renderElement(e,t,i){const s=i,r=e.text,o=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=r,s.detail.textContent=o||"",s.decoratorRight.innerText=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const os=class os extends Disposable{constructor(e,t,i,s,r){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=r||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=os.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new Emitter$1,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return SELECT_OPTION_ENTRY_TEMPLATE_ID}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=$$e(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=append$1(this.selectDropDownContainer,$$b(".select-box-details-pane"));const t=append$1(this.selectDropDownContainer,$$b(".select-box-dropdown-container-width-control")),i=append$1(t,$$b(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",append$1(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=createStyleSheet(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(addDisposableListener(this.selectDropDownContainer,EventType$1.DRAG_START,s=>{EventHelper.stop(s,!0)}))}registerListeners(){this._register(addStandardDisposableListener(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(addDisposableListener(this.selectElement,EventType$1.CLICK,t=>{EventHelper.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(addDisposableListener(this.selectElement,EventType$1.MOUSE_DOWN,t=>{EventHelper.stop(t)}));let e;this._register(addDisposableListener(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(addDisposableListener(this.selectElement,"touchend",t=>{EventHelper.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(addDisposableListener(this.selectElement,EventType$1.KEY_DOWN,t=>{const i=new StandardKeyboardEvent(t);let s=!1;isMacintosh?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),EventHelper.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){equals$1(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)==null||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=asCssValueWithDefault(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=getWindow(this.selectElement),i=getDomNodePagePosition(this.selectElement),s=getWindow(this.selectElement).getComputedStyle(this.selectElement),r=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),o=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-os.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const f=this._hasDetails?this._cachedMaxDetailsHeight:0,g=u+r+f,m=Math.floor((o-r-f)/this.getHeight()),_=Math.floor((a-r-f)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topm&&this.options.length>m?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topo&&(u=m*this.getHeight())}else g>a&&(u=_*this.getHeight());return this.selectList.layout(u),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=u+r+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+r+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((r,o)=>{const a=r.detail?r.detail.length:0,l=r.decoratorRight?r.decoratorRight.length:0,c=r.text.length+a+l;c>s&&(i=o,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=getTotalWidth(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=append$1(e,$$b(".select-box-dropdown-list-container")),this.listRenderer=new SelectListRenderer,this.selectList=this._register(new List("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let r=s.text;return s.detail&&(r+=`. ${s.detail}`),s.decoratorRight&&(r+=`. ${s.decoratorRight}`),s.description&&(r+=`. ${s.description}`),r},getWidgetAriaLabel:()=>localize({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>isMacintosh?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new DomEmitter(this.selectDropDownListContainer,"keydown")),i=Event$1.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(r=>new StandardKeyboardEvent(r)));this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===3))(this.onEnter,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===2))(this.onEnter,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===9))(this.onEscape,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===16))(this.onUpArrow,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===18))(this.onDownArrow,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===12))(this.onPageDown,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===11))(this.onPageUp,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===14))(this.onHome,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode===13))(this.onEnd,this)),this._register(Event$1.chain(i,s=>s.filter(r=>r.keyCode>=21&&r.keyCode<=56||r.keyCode>=85&&r.keyCode<=113))(this.onCharacter,this)),this._register(addDisposableListener(this.selectList.getHTMLElement(),EventType$1.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(addDisposableListener(this.selectDropDownContainer,EventType$1.FOCUS_OUT,s=>{!this._isVisible||isAncestor$1(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;EventHelper.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),r=i.classList.contains("option-disabled");s>=0&&s{for(let o=0;othis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(EventHelper.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){EventHelper.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){EventHelper.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){EventHelper.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=KeyCodeUtils.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(addDisposableListener(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(addStandardDisposableListener(this.selectElement,"click",e=>{EventHelper.stop(e,!0)})),this._register(addStandardDisposableListener(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(addStandardDisposableListener(this.selectElement,"keydown",e=>{let t=!1;isMacintosh?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!equals$1(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ActionRunner)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Gesture.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,isFirefox&&this._register(addDisposableListener(e,EventType$1.DRAG_START,s=>{var r;return(r=s.dataTransfer)==null?void 0:r.setData(DataTransfers.TEXT,this._action.label)}))),this._register(addDisposableListener(t,EventType.Tap,s=>this.onClick(s,!0))),this._register(addDisposableListener(t,EventType$1.MOUSE_DOWN,s=>{i||EventHelper.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),isMacintosh&&this._register(addDisposableListener(t,EventType$1.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(addDisposableListener(t,EventType$1.CLICK,s=>{EventHelper.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(addDisposableListener(t,EventType$1.DBLCLICK,s=>{EventHelper.stop(s,!0)})),[EventType$1.MOUSE_UP,EventType$1.MOUSE_OUT].forEach(s=>{this._register(addDisposableListener(t,s,r=>{EventHelper.stop(r),t.classList.remove("active")}))})}onClick(e,t=!1){var s;EventHelper.stop(e,!0);const i=isUndefinedOrNull(this._context)?(s=this.options)!=null&&s.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}updateTooltip(){var t;if(!this.element)return;const e=this.getTooltip()??"";if(this.updateAriaLabel(),(t=this.options.hoverDelegate)!=null&&t.showNativeHover)this.element.title=e;else if(!this.customHover&&e!==""){const i=this.options.hoverDelegate??getDefaultHoverDelegate("element");this.customHover=this._store.add(getBaseLayerHoverDelegate().setupManagedHover(i,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class ActionViewItem extends BaseActionViewItem{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),assertType(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Separator.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=localize({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)==null||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)==null||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)==null||t.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class SelectActionViewItem extends BaseActionViewItem{constructor(e,t,i,s,r,o,a){super(e,t),this.selectBox=new SelectBox(i,s,r,o,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)==null||e.focus()}blur(){var e;(e=this.selectBox)==null||e.blur()}render(e){this.selectBox.render(e)}}const dropdown="";class BaseDropdown extends ActionRunner{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new Emitter$1),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=append$1(e,$$e(".monaco-dropdown")),this._label=append$1(this._element,$$e(".dropdown-label"));let i=t.labelRenderer;i||(i=r=>(r.textContent=t.label||"",null));for(const r of[EventType$1.CLICK,EventType$1.MOUSE_DOWN,EventType.Tap])this._register(addDisposableListener(this.element,r,o=>EventHelper.stop(o,!0)));for(const r of[EventType$1.MOUSE_DOWN,EventType.Tap])this._register(addDisposableListener(this._label,r,o=>{isMouseEvent(o)&&(o.detail>1||o.button!==0)||(this.visible?this.hide():this.show())}));this._register(addDisposableListener(this._label,EventType$1.KEY_UP,r=>{const o=new StandardKeyboardEvent(r);(o.equals(3)||o.equals(10))&&(EventHelper.stop(r,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Gesture.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class DropdownMenu extends BaseDropdown{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class DropdownMenuActionViewItem extends BaseActionViewItem{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new Emitter$1),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=r=>{this.element=append$1(r,$$e("a.action-label"));let o=[];return typeof this.options.classNames=="string"?o=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(o=this.options.classNames),o.find(a=>a==="icon")||o.push("codicon"),this.element.classList.add(...o),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._action.label&&this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate??getDefaultHoverDelegate("mouse"),this.element,this._action.label)),this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new DropdownMenu(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(r=>{var o;(o=this.element)==null||o.setAttribute("aria-expanded",`${r}`),this._onDidChangeVisibility.fire(r)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const r=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return r.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)==null||e.show()}updateEnabled(){var t,i;const e=!this.action.enabled;(t=this.actionItem)==null||t.classList.toggle("disabled",e),(i=this.element)==null||i.classList.toggle("disabled",e)}}const menuEntryActionViewItem="";function isLocalizedString(n){return n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function isICommandActionToggleInfo(n){return n?n.condition!==void 0:!1}var StorageHint;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(StorageHint||(StorageHint={}));var StorageState;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(StorageState||(StorageState={}));const Vh=class Vh extends Disposable{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new PauseableEmitter),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=StorageState.None,this.cache=new Map,this.flushDelayer=this._register(new ThrottledDelayer(Vh.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)==null||t.forEach((s,r)=>this.acceptExternal(r,s)),(i=e.deleted)==null||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===StorageState.Closed)return;let i=!1;isUndefinedOrNull(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return isUndefinedOrNull(i)?t:i}getBoolean(e,t){const i=this.get(e);return isUndefinedOrNull(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return isUndefinedOrNull(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===StorageState.Closed)return;if(isUndefinedOrNull(t))return this.delete(e,i);const s=isObject(t)||Array.isArray(t)?stringify$1(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===StorageState.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())==null||t()})}async doFlush(e){return this.options.hint===StorageHint.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}};Vh.DEFAULT_FLUSH_DELAY=100;let Storage=Vh;class InMemoryStorageDatabase{constructor(){this.onDidChangeItemsExternal=Event$1.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)==null||t.forEach((s,r)=>this.items.set(r,s)),(i=e.delete)==null||i.forEach(s=>this.items.delete(s))}}const TARGET_KEY="__$__targetStorageMarker",IStorageService=createDecorator("storageService");var WillSaveStateReason;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(WillSaveStateReason||(WillSaveStateReason={}));function loadKeyTargets(n){const e=n.get(TARGET_KEY);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Wh=class Wh extends Disposable{constructor(e={flushInterval:Wh.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new PauseableEmitter),this._onDidChangeTarget=this._register(new PauseableEmitter),this._onWillSaveState=this._register(new Emitter$1),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return Event$1.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===TARGET_KEY){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getNumber(e,i)}store(e,t,i,s,r=!1){if(isUndefinedOrNull(t)){this.remove(e,i,r);return}this.withPausedEmitters(()=>{var o;this.updateKeyTarget(e,i,s),(o=this.getStorage(i))==null||o.set(e,t,r)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))==null||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var o,a;const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,(o=this.getStorage(t))==null||o.set(TARGET_KEY,JSON.stringify(r),s)):typeof r[e]=="number"&&(delete r[e],(a=this.getStorage(t))==null||a.set(TARGET_KEY,JSON.stringify(r),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?loadKeyTargets(t):Object.create(null)}};Wh.DEFAULT_FLUSH_INTERVAL=60*1e3;let AbstractStorageService=Wh;class InMemoryStorageService extends AbstractStorageService{constructor(){super(),this.applicationStorage=this._register(new Storage(new InMemoryStorageDatabase,{hint:StorageHint.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Storage(new InMemoryStorageDatabase,{hint:StorageHint.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Storage(new InMemoryStorageDatabase,{hint:StorageHint.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function overrideStyles(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?asCssVariable(s):void 0}return t}const defaultKeybindingLabelStyles={keybindingLabelBackground:asCssVariable(keybindingLabelBackground),keybindingLabelForeground:asCssVariable(keybindingLabelForeground),keybindingLabelBorder:asCssVariable(keybindingLabelBorder),keybindingLabelBottomBorder:asCssVariable(keybindingLabelBottomBorder),keybindingLabelShadow:asCssVariable(widgetShadow)},defaultButtonStyles={buttonForeground:asCssVariable(buttonForeground),buttonSeparator:asCssVariable(buttonSeparator),buttonBackground:asCssVariable(buttonBackground),buttonHoverBackground:asCssVariable(buttonHoverBackground),buttonSecondaryForeground:asCssVariable(buttonSecondaryForeground),buttonSecondaryBackground:asCssVariable(buttonSecondaryBackground),buttonSecondaryHoverBackground:asCssVariable(buttonSecondaryHoverBackground),buttonBorder:asCssVariable(buttonBorder)},defaultProgressBarStyles={progressBarBackground:asCssVariable(progressBarBackground)},defaultToggleStyles={inputActiveOptionBorder:asCssVariable(inputActiveOptionBorder),inputActiveOptionForeground:asCssVariable(inputActiveOptionForeground),inputActiveOptionBackground:asCssVariable(inputActiveOptionBackground)};asCssVariable(radioActiveForeground),asCssVariable(radioActiveBackground),asCssVariable(radioActiveBorder),asCssVariable(radioInactiveForeground),asCssVariable(radioInactiveBackground),asCssVariable(radioInactiveBorder),asCssVariable(radioInactiveHoverBackground);asCssVariable(checkboxBackground),asCssVariable(checkboxBorder),asCssVariable(checkboxForeground);asCssVariable(editorWidgetBackground),asCssVariable(editorWidgetForeground),asCssVariable(widgetShadow),asCssVariable(contrastBorder),asCssVariable(problemsErrorIconForeground),asCssVariable(problemsWarningIconForeground),asCssVariable(problemsInfoIconForeground),asCssVariable(textLinkForeground);const defaultInputBoxStyles={inputBackground:asCssVariable(inputBackground),inputForeground:asCssVariable(inputForeground),inputBorder:asCssVariable(inputBorder),inputValidationInfoBorder:asCssVariable(inputValidationInfoBorder),inputValidationInfoBackground:asCssVariable(inputValidationInfoBackground),inputValidationInfoForeground:asCssVariable(inputValidationInfoForeground),inputValidationWarningBorder:asCssVariable(inputValidationWarningBorder),inputValidationWarningBackground:asCssVariable(inputValidationWarningBackground),inputValidationWarningForeground:asCssVariable(inputValidationWarningForeground),inputValidationErrorBorder:asCssVariable(inputValidationErrorBorder),inputValidationErrorBackground:asCssVariable(inputValidationErrorBackground),inputValidationErrorForeground:asCssVariable(inputValidationErrorForeground)},defaultFindWidgetStyles={listFilterWidgetBackground:asCssVariable(listFilterWidgetBackground),listFilterWidgetOutline:asCssVariable(listFilterWidgetOutline),listFilterWidgetNoMatchesOutline:asCssVariable(listFilterWidgetNoMatchesOutline),listFilterWidgetShadow:asCssVariable(listFilterWidgetShadow),inputBoxStyles:defaultInputBoxStyles,toggleStyles:defaultToggleStyles},defaultCountBadgeStyles={badgeBackground:asCssVariable(badgeBackground),badgeForeground:asCssVariable(badgeForeground),badgeBorder:asCssVariable(contrastBorder)};asCssVariable(breadcrumbsBackground),asCssVariable(breadcrumbsForeground),asCssVariable(breadcrumbsFocusForeground),asCssVariable(breadcrumbsFocusForeground),asCssVariable(breadcrumbsActiveSelectionForeground);const defaultListStyles={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:asCssVariable(listFocusBackground),listFocusForeground:asCssVariable(listFocusForeground),listFocusOutline:asCssVariable(listFocusOutline),listActiveSelectionBackground:asCssVariable(listActiveSelectionBackground),listActiveSelectionForeground:asCssVariable(listActiveSelectionForeground),listActiveSelectionIconForeground:asCssVariable(listActiveSelectionIconForeground),listFocusAndSelectionOutline:asCssVariable(listFocusAndSelectionOutline),listFocusAndSelectionBackground:asCssVariable(listActiveSelectionBackground),listFocusAndSelectionForeground:asCssVariable(listActiveSelectionForeground),listInactiveSelectionBackground:asCssVariable(listInactiveSelectionBackground),listInactiveSelectionIconForeground:asCssVariable(listInactiveSelectionIconForeground),listInactiveSelectionForeground:asCssVariable(listInactiveSelectionForeground),listInactiveFocusBackground:asCssVariable(listInactiveFocusBackground),listInactiveFocusOutline:asCssVariable(listInactiveFocusOutline),listHoverBackground:asCssVariable(listHoverBackground),listHoverForeground:asCssVariable(listHoverForeground),listDropOverBackground:asCssVariable(listDropOverBackground),listDropBetweenBackground:asCssVariable(listDropBetweenBackground),listSelectionOutline:asCssVariable(activeContrastBorder),listHoverOutline:asCssVariable(activeContrastBorder),treeIndentGuidesStroke:asCssVariable(treeIndentGuidesStroke),treeInactiveIndentGuidesStroke:asCssVariable(treeInactiveIndentGuidesStroke),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:asCssVariable(scrollbarShadow),tableColumnsBorder:asCssVariable(tableColumnsBorder),tableOddRowsBackgroundColor:asCssVariable(tableOddRowsBackgroundColor)};function getListStyles(n){return overrideStyles(n,defaultListStyles)}const defaultSelectBoxStyles={selectBackground:asCssVariable(selectBackground),selectListBackground:asCssVariable(selectListBackground),selectForeground:asCssVariable(selectForeground),decoratorRightForeground:asCssVariable(pickerGroupForeground),selectBorder:asCssVariable(selectBorder),focusBorder:asCssVariable(focusBorder),listFocusBackground:asCssVariable(quickInputListFocusBackground),listInactiveSelectionIconForeground:asCssVariable(quickInputListFocusIconForeground),listFocusForeground:asCssVariable(quickInputListFocusForeground),listFocusOutline:asCssVariableWithDefault(activeContrastBorder,Color.transparent.toString()),listHoverBackground:asCssVariable(listHoverBackground),listHoverForeground:asCssVariable(listHoverForeground),listHoverOutline:asCssVariable(activeContrastBorder),selectListBorder:asCssVariable(editorWidgetBorder),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},defaultMenuStyles={shadowColor:asCssVariable(widgetShadow),borderColor:asCssVariable(menuBorder),foregroundColor:asCssVariable(menuForeground),backgroundColor:asCssVariable(menuBackground),selectionForegroundColor:asCssVariable(menuSelectionForeground),selectionBackgroundColor:asCssVariable(menuSelectionBackground),selectionBorderColor:asCssVariable(menuSelectionBorder),separatorColor:asCssVariable(menuSeparatorBackground),scrollbarShadow:asCssVariable(scrollbarShadow),scrollbarSliderBackground:asCssVariable(scrollbarSliderBackground),scrollbarSliderHoverBackground:asCssVariable(scrollbarSliderHoverBackground),scrollbarSliderActiveBackground:asCssVariable(scrollbarSliderActiveBackground)};var __decorate$2j=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2g=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function createAndFillInContextMenuActions(n,e,t,i){let s,r,o;if(Array.isArray(n))o=n,s=e,r=t;else{const c=e;o=n.getActions(c),s=t,r=i}const a=ModifierKeyEmitter.getInstance(),l=a.keyStatus.altKey||(isWindows||isLinux)&&a.keyStatus.shiftKey;fillInActions(o,s,l,r?c=>c===r:c=>c==="navigation")}function createAndFillInActionBarActions(n,e,t,i,s,r){let o,a,l,c,d;if(Array.isArray(n))d=n,o=e,a=t,l=i,c=s;else{const f=e;d=n.getActions(f),o=t,a=i,l=s,c=r}fillInActions(d,o,!1,typeof a=="string"?f=>f===a:a,l,c)}function fillInActions(n,e,t,i=o=>o==="navigation",s=()=>!1,r=!1){let o,a;Array.isArray(e)?(o=e,a=e):(o=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let u;i(c)?(u=o,u.length>0&&r&&u.push(new Separator)):(u=a,u.length>0&&u.push(new Separator));for(let f of d){t&&(f=f instanceof MenuItemAction&&f.alt?f.alt:f);const g=u.push(f);f instanceof SubmenuAction&&l.add({group:c,action:f,index:g-1})}}for(const{group:c,action:d,index:u}of l){const f=i(c)?o:a,g=d.actions;s(d,c,f.length)&&f.splice(u,1,...g)}}let MenuEntryActionViewItem=class extends ActionViewItem{constructor(e,t,i,s,r,o,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._options=t,this._keybindingService=i,this._notificationService=s,this._contextKeyService=r,this._themeService=o,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new MutableDisposable),this._altKey=ModifierKeyEmitter.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var r;const s=!!((r=this._menuItemAction.alt)!=null&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(addDisposableListener(e,"mouseleave",s=>{t=!1,i()})),this._register(addDisposableListener(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var r;const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?localize("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&((r=this._menuItemAction.alt)!=null&&r.enabled)){const o=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?localize("titleAndKb","{0} ({1})",o,l):o;s=localize("titleAndKbAndAlt",`{0} +[{1}] {2}`,s,UILabelProvider.modifierLabels[OS$1].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&isICommandActionToggleInfo(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(ThemeIcon.isThemeIcon(s)){const r=ThemeIcon.asClassNameArray(s);i.classList.add(...r),this._itemClassDispose.value=toDisposable(()=>{i.classList.remove(...r)})}else i.style.backgroundImage=isDark(this._themeService.getColorTheme().type)?asCSSUrl(s.dark):asCSSUrl(s.light),i.classList.add("icon"),this._itemClassDispose.value=combinedDisposable(toDisposable(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};MenuEntryActionViewItem=__decorate$2j([__param$2g(2,IKeybindingService),__param$2g(3,INotificationService),__param$2g(4,IContextKeyService),__param$2g(5,IThemeService),__param$2g(6,IContextMenuService),__param$2g(7,IAccessibilityService)],MenuEntryActionViewItem);class TextOnlyMenuEntryActionViewItem extends MenuEntryActionViewItem{render(e){var t;this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",((t=this._options)==null?void 0:t.useComma)??!1)}updateLabel(){var t;const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const i=TextOnlyMenuEntryActionViewItem._symbolPrintEnter(e);(t=this._options)!=null&&t.conversational?this.label.textContent=localize({key:"content2",comment:['A label with keybindg like "ESC to dismiss"']},"{1} to {0}",this._action.label,i):this.label.textContent=localize({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){var t;return(t=e.getLabel())==null?void 0:t.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let SubmenuEntryActionViewItem=class extends DropdownMenuActionViewItem{constructor(e,t,i,s,r){const o={...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!1,classNames:(t==null?void 0:t.classNames)??(ThemeIcon.isThemeIcon(e.item.icon)?ThemeIcon.asClassName(e.item.icon):void 0),keybindingProvider:(t==null?void 0:t.keybindingProvider)??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,o),this._keybindingService=i,this._contextMenuService=s,this._themeService=r}render(e){super.render(e),assertType(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ThemeIcon.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=isDark(this._themeService.getColorTheme().type)?asCSSUrl(i.dark):asCSSUrl(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};SubmenuEntryActionViewItem=__decorate$2j([__param$2g(2,IKeybindingService),__param$2g(3,IContextMenuService),__param$2g(4,IThemeService)],SubmenuEntryActionViewItem);let DropdownWithDefaultActionViewItem=class extends BaseActionViewItem{constructor(e,t,i,s,r,o,a,l){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=r,this._menuService=o,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(f=>d===f.id)),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(MenuEntryActionViewItem,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const u={keybindingProvider:f=>this._keybindingService.lookupKeybinding(f.id),...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!0,classNames:(t==null?void 0:t.classNames)??["codicon","codicon-chevron-down"],actionRunner:(t==null?void 0:t.actionRunner)??new ActionRunner};this._dropdown=new DropdownMenuActionViewItem(e,e.actions,this._contextMenuService,u),this._register(this._dropdown.actionRunner.onDidRun(f=>{f.action instanceof MenuItemAction&&this.update(f.action)}))}update(e){var t;(t=this._options)!=null&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(MenuEntryActionViewItem,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends ActionRunner{async runAction(i,s){await i.run(void 0)}},this._container&&this._defaultAction.render(prepend$1(this._container,$$e(".action-container")))}_getDefaultActionKeybindingLabel(e){var i;let t;if((i=this._options)!=null&&i.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(t=`(${s.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=$$e(".action-container");this._defaultAction.render(append$1(this._container,t)),this._register(addDisposableListener(t,EventType$1.KEY_DOWN,s=>{const r=new StandardKeyboardEvent(s);r.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),r.stopPropagation())}));const i=$$e(".dropdown-action-container");this._dropdown.render(append$1(this._container,i)),this._register(addDisposableListener(i,EventType$1.KEY_DOWN,s=>{var o;const r=new StandardKeyboardEvent(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)==null||o.focus(),r.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}dispose(){this._defaultAction.dispose(),this._dropdown.dispose(),super.dispose()}};DropdownWithDefaultActionViewItem=__decorate$2j([__param$2g(2,IKeybindingService),__param$2g(3,INotificationService),__param$2g(4,IContextMenuService),__param$2g(5,IMenuService),__param$2g(6,IInstantiationService),__param$2g(7,IStorageService)],DropdownWithDefaultActionViewItem);let SubmenuEntrySelectActionViewItem=class extends SelectActionViewItem{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Separator.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,defaultSelectBoxStyles,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=asCssVariable(selectBorder)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};SubmenuEntrySelectActionViewItem=__decorate$2j([__param$2g(1,IContextViewService)],SubmenuEntrySelectActionViewItem);function createActionViewItem(n,e,t){return e instanceof MenuItemAction?n.createInstance(MenuEntryActionViewItem,e,t):e instanceof SubmenuItemAction?e.item.isSelection?n.createInstance(SubmenuEntrySelectActionViewItem,e):e.item.rememberDefaultAction?n.createInstance(DropdownWithDefaultActionViewItem,e,{...t,persistLastActionId:!0}):n.createInstance(SubmenuEntryActionViewItem,e,t):void 0}class ActionBar extends Disposable{constructor(e,t={}){var r,o;super(),this._actionRunnerDisposables=this._register(new DisposableStore),this.viewItemDisposables=this._register(new DisposableMap),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new Emitter$1),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Emitter$1({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Emitter$1),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new Emitter$1),this.onWillRun=this._onWillRun.event,this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:((r=this.options.triggerKeys)==null?void 0:r.keyDown)??!1,keys:((o=this.options.triggerKeys)==null?void 0:o.keys)??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(createInstantHoverDelegate()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ActionRunner,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(a=>this._onDidRun.fire(a))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(a=>this._onWillRun.fire(a))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case 0:i=[15],s=[17];break;case 1:i=[16],s=[18],this.domNode.className+=" vertical";break}this._register(addDisposableListener(this.domNode,EventType$1.KEY_DOWN,a=>{const l=new StandardKeyboardEvent(a);let c=!0;const d=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(l.equals(i[0])||l.equals(i[1]))?c=this.focusPrevious():s&&(l.equals(s[0])||l.equals(s[1]))?c=this.focusNext():l.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():l.equals(14)?c=this.focusFirst():l.equals(13)?c=this.focusLast():l.equals(2)&&d instanceof BaseActionViewItem&&d.trapsArrowNavigation?c=this.focusNext(void 0,!0):this.isTriggerKeyEvent(l)?this._triggerKeys.keyDown?this.doTrigger(l):this.triggerKeyDown=!0:c=!1,c&&(l.preventDefault(),l.stopPropagation())})),this._register(addDisposableListener(this.domNode,EventType$1.KEY_UP,a=>{const l=new StandardKeyboardEvent(a);this.isTriggerKeyEvent(l)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(l)),l.preventDefault(),l.stopPropagation()):(l.equals(2)||l.equals(1026)||l.equals(16)||l.equals(18)||l.equals(15)||l.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(trackFocus(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(getActiveElement()===this.domNode||!isAncestor$1(getActiveElement(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof BaseActionViewItem&&i.isEnabled());t instanceof BaseActionViewItem&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof BaseActionViewItem&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])==null?void 0:t.action;if(isHTMLElement(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const o=document.createElement("li");o.className="action-item",o.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(r,l)),a||(a=new ActionViewItem(this.context,r,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,addDisposableListener(o,EventType$1.CONTEXT_MENU,c=>{EventHelper.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(o),this.focusable&&a instanceof BaseActionViewItem&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(o),this.viewItems.push(a)):(this.actionsList.insertBefore(o,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=dispose(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),clearNode(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(r=>r.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let s;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,s=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!s.isEnabled()||s.action.id===Separator.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Separator.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var r,o;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])==null||r.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;isFunction$2(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&isFunction$2(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===Separator.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((o=s.showHover)==null||o.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof BaseActionViewItem){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=dispose(this.viewItems),this.getContainer().remove(),super.dispose()}}const MENU_MNEMONIC_REGEX=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,MENU_ESCAPED_MNEMONIC_REGEX=/(&)?(&)([^\s&])/g;var HorizontalDirection;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(HorizontalDirection||(HorizontalDirection={}));var VerticalDirection;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(VerticalDirection||(VerticalDirection={}));class Menu extends ActionBar{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const r=document.createElement("div");r.classList.add("monaco-menu"),r.setAttribute("role","presentation"),super(r,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...isMacintosh||isLinux?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=r,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(Gesture.addTarget(r)),this._register(addDisposableListener(r,EventType$1.KEY_DOWN,c=>{new StandardKeyboardEvent(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(addDisposableListener(r,EventType$1.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){EventHelper.stop(c,!0);const u=this.mnemonics.get(d);if(u.length===1&&(u[0]instanceof SubmenuMenuActionViewItem&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(c)),u.length>1){const f=u.shift();f&&f.container&&(this.focusItemByElement(f.container),u.push(f)),this.mnemonics.set(d,u)}}})),isLinux&&this._register(addDisposableListener(r,EventType$1.KEY_DOWN,c=>{const d=new StandardKeyboardEvent(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),EventHelper.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),EventHelper.stop(c,!0))})),this._register(addDisposableListener(this.domNode,EventType$1.MOUSE_OUT,c=>{const d=c.relatedTarget;isAncestor$1(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(addDisposableListener(this.actionsList,EventType$1.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!isAncestor$1(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(d),u!==this.focusedItem&&this.updateFocus()}}})),this._register(Gesture.addTarget(this.actionsList)),this._register(addDisposableListener(this.actionsList,EventType.Tap,c=>{let d=c.initialTarget;if(!(!d||!isAncestor$1(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(d),u!==this.focusedItem&&this.updateFocus()}}}));const o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new DomScrollableElement(r,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(addDisposableListener(r,EventType.Change,c=>{EventHelper.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(addDisposableListener(a,EventType$1.MOUSE_UP,c=>{c.preventDefault()}));const l=getWindow(e);r.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>{var u;return(u=i.submenuIds)!=null&&u.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof Separator&&(d===t.length-1||d===0||t[d-1]instanceof Separator))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof MenuSeparatorActionViewItem)).forEach((c,d,u)=>{c.updatePositionInSet(d+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(isInShadowDOM(e)?this.styleSheet=createStyleSheet(e):(Menu.globalStyleSheet||(Menu.globalStyleSheet=createStyleSheet()),this.styleSheet=Menu.globalStyleSheet)),this.styleSheet.textContent=getMenuWidgetCSS(t,isInShadowDOM(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",r=t.borderColor?`1px solid ${t.borderColor}`:"",o="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius=o,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(addDisposableListener(this.element,EventType$1.MOUSE_UP,r=>{if(EventHelper.stop(r,!0),isFirefox){if(new StandardMouseEvent(getWindow(this.element),r).rightButton)return;this.onClick(r)}else setTimeout(()=>{this.onClick(r)},0)})),this._register(addDisposableListener(this.element,EventType$1.CONTEXT_MENU,r=>{EventHelper.stop(r,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=append$1(this.element,$$e("a.action-menu-item")),this._action.id===Separator.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=append$1(this.item,$$e("span.menu-item-check"+ThemeIcon.asCSSSelector(Codicon.menuSelection))),this.check.setAttribute("role","none"),this.label=append$1(this.item,$$e("span.action-label")),this.options.label&&this.options.keybinding&&(append$1(this.item,$$e("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)==null||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){clearNode(this.label);let t=stripIcons(this.action.label);if(t){const i=cleanMnemonic(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=MENU_MNEMONIC_REGEX.exec(t);if(s){t=escape$1(t),MENU_ESCAPED_MNEMONIC_REGEX.lastIndex=0;let r=MENU_ESCAPED_MNEMONIC_REGEX.exec(t);for(;r&&r[1];)r=MENU_ESCAPED_MNEMONIC_REGEX.exec(t);const o=a=>a.replace(/&&/g,"&");r?this.label.append(ltrim(o(t.substr(0,r.index))," "),$$e("u",{"aria-hidden":"true"},r[3]),rtrim(o(t.substr(r.index+r[0].length))," ")):this.label.innerText=o(t).trim(),(e=this.item)==null||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",r=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=r),this.check&&(this.check.style.color=t??"")}}class SubmenuMenuActionViewItem extends BaseMenuActionViewItem{constructor(e,t,i,s,r){super(e,e,s,r),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new DisposableStore),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:HorizontalDirection.Right,vertical:VerticalDirection.Below},this.showScheduler=new RunOnceScheduler(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new RunOnceScheduler(()=>{this.element&&!isAncestor$1(getActiveElement(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=append$1(this.item,$$e("span.submenu-indicator"+ThemeIcon.asCSSSelector(Codicon.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(addDisposableListener(this.element,EventType$1.KEY_UP,t=>{const i=new StandardKeyboardEvent(t);(i.equals(17)||i.equals(3))&&(EventHelper.stop(t,!0),this.createSubmenu(!0))})),this._register(addDisposableListener(this.element,EventType$1.KEY_DOWN,t=>{const i=new StandardKeyboardEvent(t);getActiveElement()===this.item&&(i.equals(17)||i.equals(3))&&EventHelper.stop(t,!0)})),this._register(addDisposableListener(this.element,EventType$1.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(addDisposableListener(this.element,EventType$1.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(addDisposableListener(this.element,EventType$1.FOCUS_OUT,t=>{this.element&&!isAncestor$1(getActiveElement(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){EventHelper.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const r={top:0,left:0};return r.left=layout(e.width,t.width,{position:s.horizontal===HorizontalDirection.Right?0:1,offset:i.left,size:i.width}),r.left>=i.left&&r.left{new StandardKeyboardEvent(d).equals(15)&&(EventHelper.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(addDisposableListener(this.submenuContainer,EventType$1.KEY_DOWN,d=>{new StandardKeyboardEvent(d).equals(15)&&EventHelper.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)==null||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class MenuSeparatorActionViewItem extends ActionViewItem{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function cleanMnemonic(n){const e=MENU_MNEMONIC_REGEX,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function formatRule(n){const e=getCodiconFontCharacters()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function getMenuWidgetCSS(n,e){let t=` +.monaco-menu { + font-size: 13px; + border-radius: 5px; + min-width: 160px; +} + +${formatRule(Codicon.menuSelection)} +${formatRule(Codicon.menuSubmenu)} + +.monaco-menu .monaco-action-bar { + text-align: right; + overflow: hidden; + white-space: nowrap; +} + +.monaco-menu .monaco-action-bar .actions-container { + display: flex; + margin: 0 auto; + padding: 0; + width: 100%; + justify-content: flex-end; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: inline-block; +} + +.monaco-menu .monaco-action-bar.reverse .actions-container { + flex-direction: row-reverse; +} + +.monaco-menu .monaco-action-bar .action-item { + cursor: pointer; + display: inline-block; + transition: transform 50ms ease; + position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */ +} + +.monaco-menu .monaco-action-bar .action-item.disabled { + cursor: default; +} + +.monaco-menu .monaco-action-bar .action-item .icon, +.monaco-menu .monaco-action-bar .action-item .codicon { + display: inline-block; +} + +.monaco-menu .monaco-action-bar .action-item .codicon { + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar .action-label { + font-size: 11px; + margin-right: 4px; +} + +.monaco-menu .monaco-action-bar .action-item.disabled .action-label, +.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { + color: var(--vscode-disabledForeground); +} + +/* Vertical actions */ + +.monaco-menu .monaco-action-bar.vertical { + text-align: left; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + display: block; + border-bottom: 1px solid var(--vscode-menu-separatorBackground); + padding-top: 1px; + padding: 30px; +} + +.monaco-menu .secondary-actions .monaco-action-bar .action-label { + margin-left: 6px; +} + +/* Action Items */ +.monaco-menu .monaco-action-bar .action-item.select-container { + overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ + flex: 1; + max-width: 170px; + min-width: 60px; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10px; +} + +.monaco-menu .monaco-action-bar.vertical { + margin-left: 0; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .actions-container { + display: block; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + padding: 0; + transform: none; + display: flex; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.active { + transform: none; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + flex: 1 1 auto; + display: flex; + height: 2em; + align-items: center; + position: relative; + margin: 0 4px; + border-radius: 4px; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { + opacity: unset; +} + +.monaco-menu .monaco-action-bar.vertical .action-label { + flex: 1 1 auto; + text-decoration: none; + padding: 0 1em; + background: none; + font-size: 12px; + line-height: 1; +} + +.monaco-menu .monaco-action-bar.vertical .keybinding, +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + display: inline-block; + flex: 2 1 auto; + padding: 0 1em; + text-align: right; + font-size: 12px; + line-height: 1; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { + font-size: 16px !important; + display: flex; + align-items: center; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { + margin-left: auto; + margin-right: -20px; +} + +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding, +.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { + opacity: 0.4; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { + display: inline-block; + box-sizing: border-box; + margin: 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-item { + position: static; + overflow: visible; +} + +.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { + position: absolute; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + width: 100%; + height: 0px !important; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { + padding: 0.7em 1em 0.1em 1em; + font-weight: bold; + opacity: 1; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:hover { + color: inherit; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + position: absolute; + visibility: hidden; + width: 1em; + height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { + visibility: visible; + display: flex; + align-items: center; + justify-content: center; +} + +/* Context Menu */ + +.context-view.monaco-menu-container { + outline: 0; + border: none; + animation: fadeIn 0.083s linear; + -webkit-app-region: no-drag; +} + +.context-view.monaco-menu-container :focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical:focus, +.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { + outline: 0; +} + +.hc-black .context-view.monaco-menu-container, +.hc-light .context-view.monaco-menu-container, +:host-context(.hc-black) .context-view.monaco-menu-container, +:host-context(.hc-light) .context-view.monaco-menu-container { + box-shadow: none; +} + +.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused, +.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused, +:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { + background: none; +} + +/* Vertical Action Bar Styles */ + +.monaco-menu .monaco-action-bar.vertical { + padding: 4px 0; +} + +.monaco-menu .monaco-action-bar.vertical .action-menu-item { + height: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator), +.monaco-menu .monaco-action-bar.vertical .keybinding { + font-size: inherit; + padding: 0 2em; + max-height: 100%; +} + +.monaco-menu .monaco-action-bar.vertical .menu-item-check { + font-size: inherit; + width: 2em; +} + +.monaco-menu .monaco-action-bar.vertical .action-label.separator { + font-size: inherit; + margin: 5px 0 !important; + padding: 0; + border-radius: 0; +} + +.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { + margin-left: 0; + margin-right: 0; +} + +.monaco-menu .monaco-action-bar.vertical .submenu-indicator { + font-size: 60%; + padding: 0 1.8em; +} + +.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator, +:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { + height: 100%; + mask-size: 10px 10px; + -webkit-mask-size: 10px 10px; +} + +.monaco-menu .action-item { + cursor: default; +}`;if(e){t+=` + /* Arrows */ + .monaco-scrollable-element > .scrollbar > .scra { + cursor: pointer; + font-size: 11px !important; + } + + .monaco-scrollable-element > .visible { + opacity: 1; + + /* Background rule added for IE9 - to allow clicks on dom node */ + background:rgba(0,0,0,0); + + transition: opacity 100ms linear; + } + .monaco-scrollable-element > .invisible { + opacity: 0; + pointer-events: none; + } + .monaco-scrollable-element > .invisible.fade { + transition: opacity 800ms linear; + } + + /* Scrollable Content Inset Shadow */ + .monaco-scrollable-element > .shadow { + position: absolute; + display: none; + } + .monaco-scrollable-element > .shadow.top { + display: block; + top: 0; + left: 3px; + height: 3px; + width: 100%; + } + .monaco-scrollable-element > .shadow.left { + display: block; + top: 3px; + left: 0; + height: 100%; + width: 3px; + } + .monaco-scrollable-element > .shadow.top-left-corner { + display: block; + top: 0; + left: 0; + height: 3px; + width: 3px; + } + `;const i=n.scrollbarShadow;i&&(t+=` + .monaco-scrollable-element > .shadow.top { + box-shadow: ${i} 0 6px 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.left { + box-shadow: ${i} 6px 0 6px -6px inset; + } + + .monaco-scrollable-element > .shadow.top.left { + box-shadow: ${i} 6px 6px 6px -6px inset; + } + `);const s=n.scrollbarSliderBackground;s&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider { + background: ${s}; + } + `);const r=n.scrollbarSliderHoverBackground;r&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider:hover { + background: ${r}; + } + `);const o=n.scrollbarSliderActiveBackground;o&&(t+=` + .monaco-scrollable-element > .scrollbar > .slider.active { + background: ${o}; + } + `)}return t}class ContextMenuHandler{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=getActiveElement();let i;const s=isHTMLElement(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:r=>{var d;this.lastContainer=r;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(r.className+=" "+o),this.options.blockMouse&&(this.block=r.appendChild($$e(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=addDisposableListener(this.block,EventType$1.MOUSE_DOWN,u=>u.stopPropagation()));const a=new DisposableStore,l=e.actionRunner||new ActionRunner;l.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new Menu(r,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},defaultMenuStyles),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=getWindow(r);return a.add(addDisposableListener(c,EventType$1.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(addDisposableListener(c,EventType$1.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const f=new StandardMouseEvent(c,u);let g=f.target;if(!f.rightButton){for(;g;){if(g===r)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),combinedDisposable(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:r=>{var o,a,l;(o=e.onHide)==null||o.call(e,!!r),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(getActiveElement()===this.lastContainer||isAncestor$1(getActiveElement(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!isCancellationError(e.error)&&this.notificationService.error(e.error)}}var __decorate$2i=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2f=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ContextMenuService=class extends Disposable{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new ContextMenuHandler(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,r,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=r,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new Emitter$1),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new Emitter$1)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=ContextMenuMenuDelegate.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),ModifierKeyEmitter.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};ContextMenuService=__decorate$2i([__param$2f(0,ITelemetryService),__param$2f(1,INotificationService),__param$2f(2,IContextViewService),__param$2f(3,IKeybindingService),__param$2f(4,IMenuService),__param$2f(5,IContextKeyService)],ContextMenuService);var ContextMenuMenuDelegate;(function(n){function e(i){return i&&i.menuId instanceof MenuId}function t(i,s,r){if(!e(i))return i;const{menuId:o,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{const c=[];if(o){const d=s.getMenuActions(o,l??r,a);createAndFillInContextMenuActions(d,c)}return i.getActions?Separator.join(i.getActions(),c):c}}}n.transform=t})(ContextMenuMenuDelegate||(ContextMenuMenuDelegate={}));var EditorOpenSource;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(EditorOpenSource||(EditorOpenSource={}));var __decorate$2h=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let CommandOpener=class{constructor(e){this._commandService=e}async open(e,t){if(!matchesScheme(e,Schemas.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=URI.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=parse$4(decodeURIComponent(e.query))}catch{try{i=parse$4(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};CommandOpener=__decorate$2h([__param$2e(0,ICommandService)],CommandOpener);let EditorOpener=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=URI.parse(e));const{selection:i,uri:s}=extractSelection(e);return e=s,e.scheme===Schemas.file&&(e=normalizePath(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?EditorOpenSource.USER:EditorOpenSource.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};EditorOpener=__decorate$2h([__param$2e(0,ICodeEditorService)],EditorOpener);let OpenerService=class{constructor(e,t){this._openers=new LinkedList,this._validators=new LinkedList,this._resolvers=new LinkedList,this._resolvedUriTargets=new ResourceMap(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new LinkedList,this._defaultExternalOpener={openExternal:async i=>(matchesSomeScheme(i,Schemas.http,Schemas.https)?windowOpenNoOpener(i):mainWindow.location.href=i,!0)},this._openers.push({open:async(i,s)=>s!=null&&s.openExternal||matchesSomeScheme(i,Schemas.mailto,Schemas.http,Schemas.https,Schemas.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new CommandOpener(t)),this._openers.push(new EditorOpener(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){const i=typeof e=="string"?URI.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const r of this._validators)if(!await r.shouldOpen(s,t))return!1;for(const r of this._openers)if(await r.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?URI.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let r;if(typeof e=="string"&&i.toString()===s.toString()?r=e:r=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const o=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(r,{sourceUri:i,preferredOpenerId:o},CancellationToken.None))return!0}return this._defaultExternalOpener.openExternal(r,{sourceUri:i},CancellationToken.None)}dispose(){this._validators.clear()}};OpenerService=__decorate$2h([__param$2e(0,ICodeEditorService),__param$2e(1,ICommandService)],OpenerService);const IEditorWorkerService=createDecorator("editorWorkerService");var MarkerSeverity$1;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(MarkerSeverity$1||(MarkerSeverity$1={}));(function(n){function e(o,a){return a-o}n.compare=e;const t=Object.create(null);t[n.Error]=localize("sev.error","Error"),t[n.Warning]=localize("sev.warning","Warning"),t[n.Info]=localize("sev.info","Info");function i(o){return t[o]||""}n.toString=i;function s(o){switch(o){case Severity$2.Error:return n.Error;case Severity$2.Warning:return n.Warning;case Severity$2.Info:return n.Info;case Severity$2.Ignore:return n.Hint}}n.fromSeverity=s;function r(o){switch(o){case n.Error:return Severity$2.Error;case n.Warning:return Severity$2.Warning;case n.Info:return Severity$2.Info;case n.Hint:return Severity$2.Ignore}}n.toSeverity=r})(MarkerSeverity$1||(MarkerSeverity$1={}));var IMarkerData;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,r){const o=[e];return s.source?o.push(s.source.replace("¦","\\¦")):o.push(e),s.code?typeof s.code=="string"?o.push(s.code.replace("¦","\\¦")):o.push(s.code.value.replace("¦","\\¦")):o.push(e),s.severity!==void 0&&s.severity!==null?o.push(MarkerSeverity$1.toString(s.severity)):o.push(e),s.message&&r?o.push(s.message.replace("¦","\\¦")):o.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?o.push(s.startLineNumber.toString()):o.push(e),s.startColumn!==void 0&&s.startColumn!==null?o.push(s.startColumn.toString()):o.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?o.push(s.endLineNumber.toString()):o.push(e),s.endColumn!==void 0&&s.endColumn!==null?o.push(s.endColumn.toString()):o.push(e),o.push(e),o.join("¦")}n.makeKeyOptionalMessage=i})(IMarkerData||(IMarkerData={}));const IMarkerService=createDecorator("markerService"),editorLineHighlight=registerColor("editor.lineHighlightBackground",null,localize("lineHighlight","Background color for the highlight of line at the cursor position.")),editorLineHighlightBorder=registerColor("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:contrastBorder},localize("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));registerColor("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},localize("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("rangeHighlightBorder","Background color of the border around highlighted ranges."));registerColor("editor.symbolHighlightBackground",{dark:editorFindMatchHighlight,light:editorFindMatchHighlight,hcDark:null,hcLight:null},localize("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("symbolHighlightBorder","Background color of the border around highlighted symbols."));const editorCursorForeground=registerColor("editorCursor.foreground",{dark:"#AEAFAD",light:Color.black,hcDark:Color.white,hcLight:"#0F4A85"},localize("caret","Color of the editor cursor.")),editorCursorBackground=registerColor("editorCursor.background",null,localize("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),editorMultiCursorPrimaryForeground=registerColor("editorMultiCursor.primary.foreground",editorCursorForeground,localize("editorMultiCursorPrimaryForeground","Color of the primary editor cursor when multiple cursors are present.")),editorMultiCursorPrimaryBackground=registerColor("editorMultiCursor.primary.background",editorCursorBackground,localize("editorMultiCursorPrimaryBackground","The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),editorMultiCursorSecondaryForeground=registerColor("editorMultiCursor.secondary.foreground",editorCursorForeground,localize("editorMultiCursorSecondaryForeground","Color of secondary editor cursors when multiple cursors are present.")),editorMultiCursorSecondaryBackground=registerColor("editorMultiCursor.secondary.background",editorCursorBackground,localize("editorMultiCursorSecondaryBackground","The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),editorWhitespaces=registerColor("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},localize("editorWhitespaces","Color of whitespace characters in the editor.")),editorLineNumbers=registerColor("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:Color.white,hcLight:"#292929"},localize("editorLineNumbers","Color of editor line numbers.")),deprecatedEditorIndentGuides=registerColor("editorIndentGuide.background",editorWhitespaces,localize("editorIndentGuides","Color of the editor indentation guides."),!1,localize("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),deprecatedEditorActiveIndentGuides=registerColor("editorIndentGuide.activeBackground",editorWhitespaces,localize("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,localize("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),editorIndentGuide1=registerColor("editorIndentGuide.background1",deprecatedEditorIndentGuides,localize("editorIndentGuides1","Color of the editor indentation guides (1).")),editorIndentGuide2=registerColor("editorIndentGuide.background2","#00000000",localize("editorIndentGuides2","Color of the editor indentation guides (2).")),editorIndentGuide3=registerColor("editorIndentGuide.background3","#00000000",localize("editorIndentGuides3","Color of the editor indentation guides (3).")),editorIndentGuide4=registerColor("editorIndentGuide.background4","#00000000",localize("editorIndentGuides4","Color of the editor indentation guides (4).")),editorIndentGuide5=registerColor("editorIndentGuide.background5","#00000000",localize("editorIndentGuides5","Color of the editor indentation guides (5).")),editorIndentGuide6=registerColor("editorIndentGuide.background6","#00000000",localize("editorIndentGuides6","Color of the editor indentation guides (6).")),editorActiveIndentGuide1=registerColor("editorIndentGuide.activeBackground1",deprecatedEditorActiveIndentGuides,localize("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),editorActiveIndentGuide2=registerColor("editorIndentGuide.activeBackground2","#00000000",localize("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),editorActiveIndentGuide3=registerColor("editorIndentGuide.activeBackground3","#00000000",localize("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),editorActiveIndentGuide4=registerColor("editorIndentGuide.activeBackground4","#00000000",localize("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),editorActiveIndentGuide5=registerColor("editorIndentGuide.activeBackground5","#00000000",localize("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),editorActiveIndentGuide6=registerColor("editorIndentGuide.activeBackground6","#00000000",localize("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),deprecatedEditorActiveLineNumber=registerColor("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("editorActiveLineNumber","Color of editor active line number"),!1,localize("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));registerColor("editorLineNumber.activeForeground",deprecatedEditorActiveLineNumber,localize("editorActiveLineNumber","Color of editor active line number"));const editorDimmedLineNumber=registerColor("editorLineNumber.dimmedForeground",null,localize("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));registerColor("editorRuler.foreground",{dark:"#5A5A5A",light:Color.lightgrey,hcDark:Color.white,hcLight:"#292929"},localize("editorRuler","Color of the editor rulers."));registerColor("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},localize("editorCodeLensForeground","Foreground color of editor CodeLens"));registerColor("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},localize("editorBracketMatchBackground","Background color behind matching brackets"));registerColor("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:contrastBorder,hcLight:contrastBorder},localize("editorBracketMatchBorder","Color for matching brackets boxes"));const editorOverviewRulerBorder=registerColor("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},localize("editorOverviewRulerBorder","Color of the overview ruler border.")),editorOverviewRulerBackground=registerColor("editorOverviewRuler.background",null,localize("editorOverviewRulerBackground","Background color of the editor overview ruler."));registerColor("editorGutter.background",editorBackground,localize("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));registerColor("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:Color.fromHex("#fff").transparent(.8),hcLight:contrastBorder},localize("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const editorUnnecessaryCodeOpacity=registerColor("editorUnnecessaryCode.opacity",{dark:Color.fromHex("#000a"),light:Color.fromHex("#0007"),hcDark:null,hcLight:null},localize("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));registerColor("editorGhostText.border",{dark:null,light:null,hcDark:Color.fromHex("#fff").transparent(.8),hcLight:Color.fromHex("#292929").transparent(.8)},localize("editorGhostTextBorder","Border color of ghost text in the editor."));const ghostTextForeground=registerColor("editorGhostText.foreground",{dark:Color.fromHex("#ffffff56"),light:Color.fromHex("#0007"),hcDark:null,hcLight:null},localize("editorGhostTextForeground","Foreground color of the ghost text in the editor."));registerColor("editorGhostText.background",null,localize("editorGhostTextBackground","Background color of the ghost text in the editor."));const rulerRangeDefault=new Color(new RGBA(0,122,204,.6)),overviewRulerRangeHighlight=registerColor("editorOverviewRuler.rangeHighlightForeground",rulerRangeDefault,localize("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerError=registerColor("editorOverviewRuler.errorForeground",{dark:new Color(new RGBA(255,18,18,.7)),light:new Color(new RGBA(255,18,18,.7)),hcDark:new Color(new RGBA(255,50,50,1)),hcLight:"#B5200D"},localize("overviewRuleError","Overview ruler marker color for errors.")),overviewRulerWarning=registerColor("editorOverviewRuler.warningForeground",{dark:editorWarningForeground,light:editorWarningForeground,hcDark:editorWarningBorder,hcLight:editorWarningBorder},localize("overviewRuleWarning","Overview ruler marker color for warnings.")),overviewRulerInfo=registerColor("editorOverviewRuler.infoForeground",{dark:editorInfoForeground,light:editorInfoForeground,hcDark:editorInfoBorder,hcLight:editorInfoBorder},localize("overviewRuleInfo","Overview ruler marker color for infos.")),editorBracketHighlightingForeground1=registerColor("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},localize("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground2=registerColor("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},localize("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground3=registerColor("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},localize("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground4=registerColor("editorBracketHighlight.foreground4","#00000000",localize("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground5=registerColor("editorBracketHighlight.foreground5","#00000000",localize("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),editorBracketHighlightingForeground6=registerColor("editorBracketHighlight.foreground6","#00000000",localize("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),editorBracketHighlightingUnexpectedBracketForeground=registerColor("editorBracketHighlight.unexpectedBracket.foreground",{dark:new Color(new RGBA(255,18,18,.8)),light:new Color(new RGBA(255,18,18,.8)),hcDark:"new Color(new RGBA(255, 50, 50, 1))",hcLight:"#B5200D"},localize("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),editorBracketPairGuideBackground1=registerColor("editorBracketPairGuide.background1","#00000000",localize("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground2=registerColor("editorBracketPairGuide.background2","#00000000",localize("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground3=registerColor("editorBracketPairGuide.background3","#00000000",localize("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground4=registerColor("editorBracketPairGuide.background4","#00000000",localize("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground5=registerColor("editorBracketPairGuide.background5","#00000000",localize("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),editorBracketPairGuideBackground6=registerColor("editorBracketPairGuide.background6","#00000000",localize("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground1=registerColor("editorBracketPairGuide.activeBackground1","#00000000",localize("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground2=registerColor("editorBracketPairGuide.activeBackground2","#00000000",localize("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground3=registerColor("editorBracketPairGuide.activeBackground3","#00000000",localize("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground4=registerColor("editorBracketPairGuide.activeBackground4","#00000000",localize("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground5=registerColor("editorBracketPairGuide.activeBackground5","#00000000",localize("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),editorBracketPairGuideActiveBackground6=registerColor("editorBracketPairGuide.activeBackground6","#00000000",localize("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));registerColor("editorUnicodeHighlight.border",editorWarningForeground,localize("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));registerColor("editorUnicodeHighlight.background",editorWarningBackground,localize("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));registerThemingParticipant((n,e)=>{const t=n.getColor(editorBackground),i=n.getColor(editorLineHighlight),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});function diffSets(n,e){const t=[],i=[];for(const s of n)e.has(s)||t.push(s);for(const s of e)n.has(s)||i.push(s);return{removed:t,added:i}}function intersection(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var __decorate$2g=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2d=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let MarkerDecorationsService=class extends Disposable{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new Emitter$1),this._markerDecorations=new ResourceMap,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new MarkerDecorations(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Schemas.inMemory||e.uri.scheme===Schemas.internal||e.uri.scheme===Schemas.vscode)&&((i=this._markerService)==null||i.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};MarkerDecorationsService=__decorate$2g([__param$2d(0,IModelService),__param$2d(1,IMarkerService)],MarkerDecorationsService);class MarkerDecorations extends Disposable{constructor(e){super(),this.model=e,this._map=new BidirectionalMap,this._register(toDisposable(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=diffSets(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),r=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),o=this.model.deltaDecorations(s,r);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const r=e.getWordAtPosition(i.getStartPosition());r&&(i=new Range$2(i.startLineNumber,r.startColumn,i.endLineNumber,r.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}const IMarkerDecorationsService=createDecorator("markerDecorationsService");class CursorColumns{static _nextVisibleColumn(e,t,i){return e===9?CursorColumns.nextRenderTabStop(t,i):isFullWidthCharacter(e)||isEmojiImprecise(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const s=Math.min(t-1,e.length),r=e.substring(0,s),o=new GraphemeIterator(r);let a=0;for(;!o.eol();){const l=getNextCodePoint(r,s,o.offset);o.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const s=e.length,r=new GraphemeIterator(e);let o=0,a=1;for(;!r.eol();){const l=getNextCodePoint(e,s,r.offset);r.nextGraphemeLength();const c=this._nextVisibleColumn(l,o,i),d=r.offset+1;if(c>=t){const u=t-o;return c-t=factor&&(t=t-n%factor),t}function sumLengths(n,e){return n.reduce((t,i)=>lengthAdd(t,e(i)),lengthZero)}function lengthEquals(n,e){return n===e}function lengthDiffNonNegative(n,e){const t=n,i=e;if(i-t<=0)return lengthZero;const r=Math.floor(t/factor),o=Math.floor(i/factor),a=i-o*factor;if(r===o){const l=t-r*factor;return toLength(0,a-l)}else return toLength(o-r,a)}function lengthLessThan(n,e){return n=e}function positionToLength(n){return toLength(n.lineNumber-1,n.column-1)}function lengthsToRange(n,e){const t=n,i=Math.floor(t/factor),s=t-i*factor,r=e,o=Math.floor(r/factor),a=r-o*factor;return new Range$2(i+1,s+1,o+1,a+1)}function lengthOfString(n){const e=splitLines(n);return toLength(e.length-1,e[e.length-1].length)}class TextEditInfo{static fromModelContentChanges(e){return e.map(i=>{const s=Range$2.lift(i.range);return new TextEditInfo(positionToLength(s.getStartPosition()),positionToLength(s.getEndPosition()),lengthOfString(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${lengthToObj(this.startOffset)}...${lengthToObj(this.endOffset)}) -> ${lengthToObj(this.newLength)}`}}class BeforeEditPositionMapper{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>TextEditInfoCache.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:lengthDiffNonNegative(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?toLength(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):toLength(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=lengthToObj(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?toLength(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):toLength(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(s===0){const o=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=lengthDiff(e,t,this.lineIdx,this.lineCharOffset);return new Token$1(s,0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(s))}}class FastTokenizer{constructor(e,t){this.text=e,this._offset=lengthZero,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| +`,"gi"):null,r=[];let o,a=0,l=0,c=0,d=0;const u=[];for(let m=0;m<60;m++)u.push(new Token$1(toLength(0,m),0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(toLength(0,m))));const f=[];for(let m=0;m<60;m++)f.push(new Token$1(toLength(1,m),0,-1,SmallImmutableSet.getEmpty(),new TextAstNode(toLength(1,m))));if(s)for(s.lastIndex=0;(o=s.exec(e))!==null;){const m=o.index,_=o[0];if(_===` +`)a++,l=m+1;else{if(c!==m){let v;if(d===a){const C=m-c;if(CprepareBracketForRegExp(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function prepareBracketForRegExp(n){let e=escapeRegExpCharacters(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class LanguageAgnosticBracketTokens{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=BracketTokens.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function concat23Trees(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const o=e,a=n[o].listHeight;for(e++;e=2?concat23TreesOfSameHeight(o===0&&e===n.length?n:n.slice(o,e),!1):n[o]}let i=t(),s=t();if(!s)return i;for(let o=t();o;o=t())heightDiff(i,s)<=heightDiff(s,o)?(i=concat(i,s),s=o):s=concat(s,o);return concat(i,s)}function concat23TreesOfSameHeight(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function heightDiff(n,e){return Math.abs(n.listHeight-e.listHeight)}function concat(n,e){return n.listHeight===e.listHeight?ListAstNode.create23(n,e,null,!1):n.listHeight>e.listHeight?append(n,e):prepend(e,n)}function append(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let r=i.length-1;r>=0;r--){const o=i[r];s?o.childrenLength>=3?s=ListAstNode.create23(o.unappendChild(),s,null,!1):(o.appendChildOfSameHeight(s),s=void 0):o.handleChildrenChanged()}return s?ListAstNode.create23(n,s,null,!1):n}function prepend(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let r=i.length-1;r>=0;r--){const o=i[r];s?o.childrenLength>=3?s=ListAstNode.create23(s,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(s),s=void 0):o.handleChildrenChanged()}return s?ListAstNode.create23(s,n,null,!1):n}class NodeReader{constructor(e){this.lastOffset=lengthZero,this.nextNodes=[e],this.offsets=[lengthZero],this.idxs=[]}readLongestNodeAt(e,t){if(lengthLessThan(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=lastOrUndefined(this.nextNodes);if(!i)return;const s=lastOrUndefined(this.offsets);if(lengthLessThan(e,s))return;if(lengthLessThan(s,e))if(lengthAdd(s,i.length)<=e)this.nextNodeAfterCurrent();else{const r=getNextChildIdx(i);r!==-1?(this.nextNodes.push(i.getChild(r)),this.offsets.push(s),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const r=getNextChildIdx(i);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(r)),this.offsets.push(s),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=lastOrUndefined(this.offsets),t=lastOrUndefined(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=lastOrUndefined(this.nextNodes),s=getNextChildIdx(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(lengthAdd(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function getNextChildIdx(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function lastOrUndefined(n){return n.length>0?n[n.length-1]:void 0}function parseDocument(n,e,t,i){return new Parser(n,e,t,i).parseDocument()}class Parser{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new NodeReader(i):void 0,this.positionMapper=new BeforeEditPositionMapper(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(SmallImmutableSet.getEmpty(),0);return e||(e=ListAstNode.getEmpty()),e}parseList(e,t){const i=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const o=this.tokenizer.peek();if(!o||o.kind===2&&o.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||i.push(r)}return this.oldNodeReader?concat23Trees(i):concat23TreesOfSameHeight(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!lengthIsZero(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!lengthLessThan(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new InvalidBracketAstNode(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new TextAstNode(i.length);const s=e.merge(i.bracketIds),r=this.parseList(s,t+1),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),PairAstNode.create(i.astNode,r,o.astNode)):PairAstNode.create(i.astNode,r,null)}default:throw new Error("unexpected")}}}function combineTextEditInfos(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new ArrayQueue(toLengthMapping(n)),i=toLengthMapping(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function r(c){if(c===void 0){const u=t.takeWhile(f=>!0)||[];return s&&u.unshift(s),u}const d=[];for(;s&&!lengthIsZero(c);){const[u,f]=s.splitAt(c);d.push(u),c=lengthDiffNonNegative(u.lengthAfter,c),s=f??t.dequeue()}return lengthIsZero(c)||d.push(new LengthMapping(!1,c,c)),d}const o=[];function a(c,d,u){if(o.length>0&&lengthEquals(o[o.length-1].endOffset,c)){const f=o[o.length-1];o[o.length-1]=new TextEditInfo(f.startOffset,d,lengthAdd(f.newLength,u))}else o.push({startOffset:c,endOffset:d,newLength:u})}let l=lengthZero;for(const c of i){const d=r(c.lengthBefore);if(c.modified){const u=sumLengths(d,g=>g.lengthBefore),f=lengthAdd(l,u);a(l,f,c.lengthAfter),l=f}else for(const u of d){const f=l;l=lengthAdd(l,u.lengthBefore),u.modified&&a(f,l,u.lengthAfter)}}return o}class LengthMapping{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=lengthDiffNonNegative(e,this.lengthAfter);return lengthEquals(t,lengthZero)?[this,void 0]:this.modified?[new LengthMapping(this.modified,this.lengthBefore,e),new LengthMapping(this.modified,lengthZero,t)]:[new LengthMapping(this.modified,e,e),new LengthMapping(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${lengthToObj(this.lengthBefore)} -> ${lengthToObj(this.lengthAfter)}`}}function toLengthMapping(n){const e=[];let t=lengthZero;for(const i of n){const s=lengthDiffNonNegative(t,i.startOffset);lengthIsZero(s)||e.push(new LengthMapping(!1,s,s));const r=lengthDiffNonNegative(i.startOffset,i.endOffset);e.push(new LengthMapping(!0,r,i.newLength)),t=i.endOffset}return e}class BracketPairsTree extends Disposable{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new Emitter$1,this.denseKeyProvider=new DenseKeyProvider,this.brackets=new LanguageAgnosticBracketTokens(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new FastTokenizer(this.textModel.getValue(),i);this.initialAstWithoutTokens=parseDocument(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new TextEditInfo(toLength(i.fromLineNumber-1,0),toLength(i.toLineNumber,0),toLength(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=TextEditInfo.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=combineTextEditInfos(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=combineTextEditInfos(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,r=new TextBufferTokenizer(this.textModel,this.brackets);return parseDocument(r,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=toLength(e.startLineNumber-1,e.startColumn-1),s=toLength(e.endLineNumber-1,e.endColumn-1);return new CallbackIterable(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens;collectBrackets(o,lengthZero,o.length,i,s,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=positionToLength(e.getStartPosition()),s=positionToLength(e.getEndPosition());return new CallbackIterable(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new CollectBracketPairsContext(r,t,this.textModel);collectBracketPairs(o,lengthZero,o.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return getFirstBracketAfter(t,lengthZero,t.length,positionToLength(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return getFirstBracketBefore(t,lengthZero,t.length,positionToLength(e))}}function getFirstBracketBefore(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const r of n.children)t=lengthAdd(e,r.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=s.length-1;r>=0;r--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=s[r];if(lengthLessThan(o,i)){const l=getFirstBracketBefore(n.children[r],o,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=lengthsToRange(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function getFirstBracketAfter(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=lengthAdd(e,s.length),lengthLessThan(i,t)){const r=getFirstBracketAfter(s,e,t,i);if(r)return r}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=lengthsToRange(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function collectBrackets(n,e,t,i,s,r,o,a,l,c,d=!1){if(o>200)return!0;e:for(;;)switch(n.kind){case 4:{const u=n.childrenLength;for(let f=0;f200)return!0;let l=!0;if(n.kind===2){let d=0;if(a){let g=a.get(n.openingBracket.text);g===void 0&&(g=0),d=g,g++,a.set(n.openingBracket.text,g)}const u=lengthAdd(e,n.openingBracket.length);let f=-1;if(r.includeMinIndentation&&(f=n.computeMinIndentation(e,r.textModel)),l=r.push(new BracketPairWithMinIndentationInfo(lengthsToRange(e,t),lengthsToRange(e,u),n.closingBracket?lengthsToRange(lengthAdd(u,((c=n.child)==null?void 0:c.length)||lengthZero),t):void 0,o,d,n,f)),e=u,l&&n.child){const g=n.child;if(t=lengthAdd(e,g.length),lengthLessThanEqual(e,s)&&lengthGreaterThanEqual(t,i)&&(l=collectBracketPairs(g,e,t,i,s,r,o+1,a),!l))return!1}a==null||a.set(n.openingBracket.text,d)}else{let d=e;for(const u of n.children){const f=d;if(d=lengthAdd(d,u.length),lengthLessThanEqual(f,s)&&lengthLessThanEqual(i,d)&&(l=collectBracketPairs(u,f,d,i,s,r,o,a),!l))return!1}}return l}class BracketPairsTextModelPart extends Disposable{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new MutableDisposable),this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){var t;(!e.languageId||(t=this.bracketPairsTree.value)!=null&&t.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)==null||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)==null||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new DisposableStore;this.bracketPairsTree.value=createDisposableRef(e.add(new BracketPairsTree(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!1))||CallbackIterable.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)==null?void 0:t.object.getBracketPairsInRange(e,!0))||CallbackIterable.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)==null?void 0:i.object.getBracketsInRange(e,t))||CallbackIterable.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(Range$2.fromPositions(t,t)).findLast(l=>o.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[o];return l?stripBracketSearchCanceled(this._findMatchingBracketUp(l,s,createTimeBasedContinueBracketSearchPredicate(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(Range$2.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(compareBy(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,Range$2.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=createTimeBasedContinueBracketSearchPredicate(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const r=t.getCount(),o=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=s-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(ignoreBracketsInToken(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=s+1;c=l)break;if(ignoreBracketsInToken(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),r=this.textModel.getLineContent(i),o=s.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(o)).brackets;if(a&&!ignoreBracketsInToken(s.getStandardTokenType(o))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,o),d=null;for(;;){const u=BracketsUtils.findNextBracketInRange(a.forwardRegex,i,r,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const f=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,a.textIsBracket[f],a.textIsOpenBracket[f],t);if(g){if(g instanceof BracketSearchCanceled)return null;d=g}}l=u.endColumn-1}if(d)return d}if(o>0&&s.getStartOffset(o)===e.column-1){const l=o-1,c=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(l)).brackets;if(c&&!ignoreBracketsInToken(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),f=BracketsUtils.findPrevBracketInRange(c.reversedRegex,i,r,d,u);if(f&&f.startColumn<=e.column&&e.column<=f.endColumn){const g=r.substring(f.startColumn-1,f.endColumn-1).toLowerCase(),m=this._matchFoundBracket(f,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(m)return m instanceof BracketSearchCanceled?null:m}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const r=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return r?r instanceof BracketSearchCanceled?r:[e,r]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,r=e.reversedRegex;let o=-1,a=0;const l=(c,d,u,f)=>{for(;;){if(i&&++a%100===0&&!i())return BracketSearchCanceled.INSTANCE;const g=BracketsUtils.findPrevBracketInRange(r,c,d,u,f);if(!g)break;const m=d.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(m)?o++:e.isClose(m)&&o--,o===0)return g;f=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),f=this.textModel.getLineContent(c);let g=u-1,m=f.length,_=f.length;c===t.lineNumber&&(g=d.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let v=!0;for(;g>=0;g--){const C=d.getLanguageId(g)===s&&!ignoreBracketsInToken(d.getStandardTokenType(g));if(C)v?m=d.getStartOffset(g):(m=d.getStartOffset(g),_=d.getEndOffset(g));else if(v&&m!==_){const S=l(c,f,m,_);if(S)return S}v=C}if(v&&m!==_){const C=l(c,f,m,_);if(C)return C}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,r=e.forwardRegex;let o=1,a=0;const l=(d,u,f,g)=>{for(;;){if(i&&++a%100===0&&!i())return BracketSearchCanceled.INSTANCE;const m=BracketsUtils.findNextBracketInRange(r,d,u,f,g);if(!m)break;const _=u.substring(m.startColumn-1,m.endColumn-1).toLowerCase();if(e.isOpen(_)?o++:e.isClose(_)&&o--,o===0)return m;f=m.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),f=u.getCount(),g=this.textModel.getLineContent(d);let m=0,_=0,v=0;d===t.lineNumber&&(m=u.findTokenIndexAtOffset(t.column-1),_=t.column-1,v=t.column-1);let C=!0;for(;m=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,f=d.length,g=d.length;if(a===t.lineNumber){u=l.findTokenIndexAtOffset(t.column-1),f=t.column-1,g=t.column-1;const _=l.getLanguageId(u);i!==_&&(i=_,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let m=!0;for(;u>=0;u--){const _=l.getLanguageId(u);if(i!==_){if(s&&r&&m&&f!==g){const C=BracketsUtils.findPrevBracketInRange(s.reversedRegex,a,d,f,g);if(C)return this._toFoundBracket(r,C);m=!1}i=_,s=this.languageConfigurationService.getLanguageConfiguration(i).brackets,r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const v=!!s&&!ignoreBracketsInToken(l.getStandardTokenType(u));if(v)m?f=l.getStartOffset(u):(f=l.getStartOffset(u),g=l.getEndOffset(u));else if(r&&s&&m&&f!==g){const C=BracketsUtils.findPrevBracketInRange(s.reversedRegex,a,d,f,g);if(C)return this._toFoundBracket(r,C)}m=v}if(r&&s&&m&&f!==g){const _=BracketsUtils.findPrevBracketInRange(s.reversedRegex,a,d,f,g);if(_)return this._toFoundBracket(r,_)}}return null}findNextBracket(e){var a;const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((a=this.bracketPairsTree.value)==null?void 0:a.object.getFirstBracketAfter(t))||null;const i=this.textModel.getLineCount();let s=null,r=null,o=null;for(let l=t.lineNumber;l<=i;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let f=0,g=0,m=0;if(l===t.lineNumber){f=c.findTokenIndexAtOffset(t.column-1),g=t.column-1,m=t.column-1;const v=c.getLanguageId(f);s!==v&&(s=v,r=this.languageConfigurationService.getLanguageConfiguration(s).brackets,o=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let _=!0;for(;f_.closingBracketRange!==void 0&&_.range.strictContainsRange(g));return m?[m.openingBracketRange,m.closingBracketRange]:null}const s=createTimeBasedContinueBracketSearchPredicate(t),r=this.textModel.getLineCount(),o=new Map;let a=[];const l=(g,m)=>{if(!o.has(g)){const _=[];for(let v=0,C=m?m.brackets.length:0;v{for(;;){if(s&&++c%100===0&&!s())return BracketSearchCanceled.INSTANCE;const S=BracketsUtils.findNextBracketInRange(g.forwardRegex,m,_,v,C);if(!S)break;const w=_.substring(S.startColumn-1,S.endColumn-1).toLowerCase(),L=g.textIsBracket[w];if(L&&(L.isOpen(w)?a[L.index]++:L.isClose(w)&&a[L.index]--,a[L.index]===-1))return this._matchFoundBracket(S,L,!1,s);v=S.endColumn-1}return null};let u=null,f=null;for(let g=i.lineNumber;g<=r;g++){const m=this.textModel.tokenization.getLineTokens(g),_=m.getCount(),v=this.textModel.getLineContent(g);let C=0,S=0,w=0;if(g===i.lineNumber){C=m.findTokenIndexAtOffset(i.column-1),S=i.column-1,w=i.column-1;const I=m.getLanguageId(C);u!==I&&(u=I,f=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,f))}let L=!0;for(;C<_;C++){const I=m.getLanguageId(C);if(u!==I){if(f&&L&&S!==w){const R=d(f,g,v,S,w);if(R)return stripBracketSearchCanceled(R);L=!1}u=I,f=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,f)}const N=!!f&&!ignoreBracketsInToken(m.getStandardTokenType(C));if(N)L||(S=m.getStartOffset(C)),w=m.getEndOffset(C);else if(f&&L&&S!==w){const R=d(f,g,v,S,w);if(R)return stripBracketSearchCanceled(R)}L=N}if(f&&L&&S!==w){const I=d(f,g,v,S,w);if(I)return stripBracketSearchCanceled(I)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const s=e.getBracketInfo(i);return s?{range:t,bracketInfo:s}:null}}function createDisposableRef(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function createTimeBasedContinueBracketSearchPredicate(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}const Hh=class Hh{constructor(){this._searchCanceledBrand=void 0}};Hh.INSTANCE=new Hh;let BracketSearchCanceled=Hh;function stripBracketSearchCanceled(n){return n instanceof BracketSearchCanceled?null:n}class ColorizedBracketPairsDecorationProvider extends Disposable{constructor(e){super(),this.textModel=e,this.colorProvider=new ColorProvider,this.onDidChangeEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Range$2(1,1,this.textModel.getLineCount(),1),e,t):[]}}class ColorProvider{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}registerThemingParticipant((n,e)=>{const t=[editorBracketHighlightingForeground1,editorBracketHighlightingForeground2,editorBracketHighlightingForeground3,editorBracketHighlightingForeground4,editorBracketHighlightingForeground5,editorBracketHighlightingForeground6],i=new ColorProvider;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(editorBracketHighlightingUnexpectedBracketForeground)}; }`);const s=t.map(r=>n.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=s[r%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});function escapeNewLine(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class TextChange{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${escapeNewLine(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${escapeNewLine(this.oldText)}")`:`(replace@${this.oldPosition} "${escapeNewLine(this.oldText)}" with "${escapeNewLine(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;writeUInt32BE(e,s,i),i+=4;for(let r=0;r0&&(this.changes=compressConsecutiveTextChanges(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(writeUInt32BE(e,t?t.length:0,i),i+=4,t)for(const s of t)writeUInt32BE(e,s.selectionStartLineNumber,i),i+=4,writeUInt32BE(e,s.selectionStartColumn,i),i+=4,writeUInt32BE(e,s.positionLineNumber,i),i+=4,writeUInt32BE(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=readUInt32BE(e,t);t+=4;for(let r=0;rt.toString()).join(", ")}matchesResource(e){return(URI.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof SingleModelEditStackData}append(e,t,i,s,r){this._data instanceof SingleModelEditStackData&&this._data.append(e,t,i,s,r)}close(){this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize())}open(){this._data instanceof SingleModelEditStackData||(this._data=SingleModelEditStackData.deserialize(this._data))}undo(){if(URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize());const e=SingleModelEditStackData.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(URI.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize());const e=SingleModelEditStackData.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof SingleModelEditStackData&&(this._data=this._data.serialize()),this._data.byteLength+168}}class MultiModelEditStackElement{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const r=uriGetComparisonKey(s.resource);this._editStackElementsMap.set(r,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=uriGetComparisonKey(e);return this._editStackElementsMap.has(t)}setModel(e){const t=uriGetComparisonKey(URI.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=uriGetComparisonKey(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,r){const o=uriGetComparisonKey(e.uri);this._editStackElementsMap.get(o).append(e,t,i,s,r)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=uriGetComparisonKey(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${basename$1(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function getModelEOL(n){return n.getEOL()===` +`?0:1}function isEditStackElement(n){return n?n instanceof SingleModelEditStackElement||n instanceof MultiModelEditStackElement:!1}class EditStack{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);isEditStackElement(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);isEditStackElement(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(isEditStackElement(i)&&i.canAppend(this._model))return i;const s=new SingleModelEditStackElement(localize("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],getModelEOL(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const r=this._getOrCreateEditStackElement(e,s),o=this._model.applyEdits(t,!0),a=EditStack._computeCursorState(i,o),l=o.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),r.append(this._model,l.map(c=>c.textChange),getModelEOL(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return onUnexpectedError(i),null}}}class TextModelPart extends Disposable{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function computeIndentLevel(n,e){let t=0,i=0;const s=n.length;for(;is)throw new BugIndicatingError("Illegal value for lineNumber");const r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.offSide);let a=-2,l=-1,c=-2,d=-1;const u=R=>{if(a!==-1&&(a===-2||a>R-1)){a=-1,l=-1;for(let T=R-2;T>=0;T--){const A=this._computeIndentLevel(T);if(A>=0){a=T,l=A;break}}}if(c===-2){c=-1,d=-1;for(let T=R;T=0){c=T,d=A;break}}}};let f=-2,g=-1,m=-2,_=-1;const v=R=>{if(f===-2){f=-1,g=-1;for(let T=R-2;T>=0;T--){const A=this._computeIndentLevel(T);if(A>=0){f=T,g=A;break}}}if(m!==-1&&(m===-2||m=0){m=T,_=A;break}}}};let C=0,S=!0,w=0,L=!0,I=0,N=0;for(let R=0;S||L;R++){const T=e-R,A=e+R;R>1&&(T<1||T1&&(A>s||A>i)&&(L=!1),R>5e4&&(S=!1,L=!1);let F=-1;if(S&&T>=1){const W=this._computeIndentLevel(T-1);W>=0?(c=T-1,d=W,F=Math.ceil(W/this.textModel.getOptions().indentSize)):(u(T),F=this._getIndentLevelForWhitespaceLine(o,l,d))}let B=-1;if(L&&A<=s){const W=this._computeIndentLevel(A-1);W>=0?(f=A-1,g=W,B=Math.ceil(W/this.textModel.getOptions().indentSize)):(v(A),B=this._getIndentLevelForWhitespaceLine(o,g,_))}if(R===0){N=F;continue}if(R===1){if(A<=s&&B>=0&&N+1===B){S=!1,C=A,w=A,I=B;continue}if(T>=1&&F>=0&&F-1===N){L=!1,C=T,w=T,I=F;continue}if(C=e,w=e,I=N,I===0)return{startLineNumber:C,endLineNumber:w,indent:I}}S&&(F>=I?C=T:S=!1),L&&(B>=I?w=A:L=!1)}return{startLineNumber:C,endLineNumber:w,indent:I}}getLinesBracketGuides(e,t,i,s){var u;const r=[];for(let f=e;f<=t;f++)r.push([]);const o=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Range$2(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){const f=(e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(Range$2.fromPositions(i)).toArray()).filter(g=>Range$2.strictContainsPosition(g.range,i));l=(u=findLast(f,g=>o))==null?void 0:u.range}const c=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new BracketPairGuidesClassNames;for(const f of a){if(!f.closingBracketRange)continue;const g=l&&f.range.equalsRange(l);if(!g&&!s.includeInactive)continue;const m=d.getInlineClassName(f.nestingLevel,f.nestingLevelOfEqualBracketType,c)+(s.highlightActive&&g?" "+d.activeClassName:""),_=f.openingBracketRange.getStartPosition(),v=f.closingBracketRange.getStartPosition(),C=s.horizontalGuides===HorizontalGuidesState.Enabled||s.horizontalGuides===HorizontalGuidesState.EnabledForActive&&g;if(f.range.startLineNumber===f.range.endLineNumber){C&&r[f.range.startLineNumber-e].push(new IndentGuide(-1,f.openingBracketRange.getEndPosition().column,m,new IndentGuideHorizontalLine(!1,v.column),-1,-1));continue}const S=this.getVisibleColumnFromPosition(v),w=this.getVisibleColumnFromPosition(f.openingBracketRange.getStartPosition()),L=Math.min(w,S,f.minVisibleColumnIndentation+1);let I=!1;firstNonWhitespaceIndex(this.textModel.getLineContent(f.closingBracketRange.startLineNumber))=e&&w>L&&r[_.lineNumber-e].push(new IndentGuide(L,-1,m,new IndentGuideHorizontalLine(!1,_.column),-1,-1)),v.lineNumber<=t&&S>L&&r[v.lineNumber-e].push(new IndentGuide(L,-1,m,new IndentGuideHorizontalLine(!I,v.column),-1,-1)))}for(const f of r)f.sort((g,m)=>g.visibleColumn-m.visibleColumn);return r}getVisibleColumnFromPosition(e){return CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),r=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(r&&r.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let f=e;f<=t;f++){const g=f-e,m=this._computeIndentLevel(f-1);if(m>=0){l=f-1,c=m,a[g]=Math.ceil(m/s.indentSize);continue}if(l===-2){l=-1,c=-1;for(let _=f-2;_>=0;_--){const v=this._computeIndentLevel(_);if(v>=0){l=_,c=v;break}}}if(d!==-1&&(d===-2||d=0){d=_,u=v;break}}}a[g]=this._getIndentLevelForWhitespaceLine(o,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:t0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(o-l);if(d===0){s.spacesDiff=u,u>0&&0<=l-1&&l-10?s++:L>1&&r++,spacesDiff(o,a,v,w,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const N=u.spacesDiff;N<=c&&d[N]++,o=v,a=w}let f=t;s!==r&&(f=s{const v=d[_];v>m&&(m=v,g=_)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:f,tabSize:g}}function getNodeColor(n){return(n.metadata&1)>>>0}function setNodeColor(n,e){n.metadata=n.metadata&254|e<<0}function getNodeIsVisited(n){return(n.metadata&2)>>>1===1}function setNodeIsVisited(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function getNodeIsForValidation(n){return(n.metadata&4)>>>2===1}function setNodeIsForValidation(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function getNodeIsInGlyphMargin(n){return(n.metadata&64)>>>6===1}function setNodeIsInGlyphMargin(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function getNodeStickiness(n){return(n.metadata&24)>>>3}function _setNodeStickiness(n,e){n.metadata=n.metadata&231|e<<3}function getCollapseOnReplaceEdit(n){return(n.metadata&32)>>>5===1}function setCollapseOnReplaceEdit(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class IntervalNode{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,setNodeColor(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,setNodeIsForValidation(this,!1),setNodeIsInGlyphMargin(this,!1),_setNodeStickiness(this,1),setCollapseOnReplaceEdit(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,setNodeIsVisited(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;const t=this.options.className;setNodeIsForValidation(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),setNodeIsInGlyphMargin(this,this.options.glyphMarginClassName!==null),_setNodeStickiness(this,this.options.stickiness),setCollapseOnReplaceEdit(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const SENTINEL$1=new IntervalNode(null,0,0);SENTINEL$1.parent=SENTINEL$1;SENTINEL$1.left=SENTINEL$1;SENTINEL$1.right=SENTINEL$1;setNodeColor(SENTINEL$1,0);class IntervalTree{constructor(){this.root=SENTINEL$1,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,r,o){return this.root===SENTINEL$1?[]:intervalSearch(this,e,t,i,s,r,o)}search(e,t,i,s){return this.root===SENTINEL$1?[]:search(this,e,t,i,s)}collectNodesFromOwner(e){return collectNodesFromOwner(this,e)}collectNodesPostOrder(){return collectNodesPostOrder(this)}insert(e){rbTreeInsert(this,e),this._normalizeDeltaIfNecessary()}delete(e){rbTreeDelete(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const r=i.start+s,o=i.end+s;i.setCachedOffsets(r,o,t)}acceptReplace(e,t,i,s){const r=searchForEditing(this,e,e+t);for(let o=0,a=r.length;ot||i===1?!1:i===2?!0:e}function nodeAcceptEdit(n,e,t,i,s){const r=getNodeStickiness(n),o=r===0||r===2,a=r===1||r===2,l=t-e,c=i,d=Math.min(l,c),u=n.start;let f=!1;const g=n.end;let m=!1;e<=u&&g<=t&&getCollapseOnReplaceEdit(n)&&(n.start=e,f=!0,n.end=e,m=!0);{const v=s?1:l>0?2:0;!f&&adjustMarkerBeforeColumn(u,o,e,v)&&(f=!0),!m&&adjustMarkerBeforeColumn(g,a,e,v)&&(m=!0)}if(d>0&&!s){const v=l>c?2:0;!f&&adjustMarkerBeforeColumn(u,o,e+d,v)&&(f=!0),!m&&adjustMarkerBeforeColumn(g,a,e+d,v)&&(m=!0)}{const v=s?1:0;!f&&adjustMarkerBeforeColumn(u,o,t,v)&&(n.start=e+c,f=!0),!m&&adjustMarkerBeforeColumn(g,a,t,v)&&(n.end=e+c,m=!0)}const _=c-l;f||(n.start=Math.max(0,u+_)),m||(n.end=Math.max(0,g+_)),n.start>n.end&&(n.end=n.start)}function searchForEditing(n,e,t){let i=n.root,s=0,r=0,o=0,a=0;const l=[];let c=0;for(;i!==SENTINEL$1;){if(getNodeIsVisited(i)){setNodeIsVisited(i.left,!1),setNodeIsVisited(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!getNodeIsVisited(i.left)){if(r=s+i.maxEnd,rt){setNodeIsVisited(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(o,a,0),l[c++]=i),setNodeIsVisited(i,!0),i.right!==SENTINEL$1&&!getNodeIsVisited(i.right)){s+=i.delta,i=i.right;continue}}return setNodeIsVisited(n.root,!1),l}function noOverlapReplace(n,e,t,i){let s=n.root,r=0,o=0,a=0;const l=i-(t-e);for(;s!==SENTINEL$1;){if(getNodeIsVisited(s)){setNodeIsVisited(s.left,!1),setNodeIsVisited(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),recomputeMaxEnd(s),s=s.parent;continue}if(!getNodeIsVisited(s.left)){if(o=r+s.maxEnd,ot){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),setNodeIsVisited(s,!0);continue}if(setNodeIsVisited(s,!0),s.right!==SENTINEL$1&&!getNodeIsVisited(s.right)){r+=s.delta,s=s.right;continue}}setNodeIsVisited(n.root,!1)}function collectNodesFromOwner(n,e){let t=n.root;const i=[];let s=0;for(;t!==SENTINEL$1;){if(getNodeIsVisited(t)){setNodeIsVisited(t.left,!1),setNodeIsVisited(t.right,!1),t=t.parent;continue}if(t.left!==SENTINEL$1&&!getNodeIsVisited(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),setNodeIsVisited(t,!0),t.right!==SENTINEL$1&&!getNodeIsVisited(t.right)){t=t.right;continue}}return setNodeIsVisited(n.root,!1),i}function collectNodesPostOrder(n){let e=n.root;const t=[];let i=0;for(;e!==SENTINEL$1;){if(getNodeIsVisited(e)){setNodeIsVisited(e.left,!1),setNodeIsVisited(e.right,!1),e=e.parent;continue}if(e.left!==SENTINEL$1&&!getNodeIsVisited(e.left)){e=e.left;continue}if(e.right!==SENTINEL$1&&!getNodeIsVisited(e.right)){e=e.right;continue}t[i++]=e,setNodeIsVisited(e,!0)}return setNodeIsVisited(n.root,!1),t}function search(n,e,t,i,s){let r=n.root,o=0,a=0,l=0;const c=[];let d=0;for(;r!==SENTINEL$1;){if(getNodeIsVisited(r)){setNodeIsVisited(r.left,!1),setNodeIsVisited(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),r=r.parent;continue}if(r.left!==SENTINEL$1&&!getNodeIsVisited(r.left)){r=r.left;continue}a=o+r.start,l=o+r.end,r.setCachedOffsets(a,l,i);let u=!0;if(e&&r.ownerId&&r.ownerId!==e&&(u=!1),t&&getNodeIsForValidation(r)&&(u=!1),s&&!getNodeIsInGlyphMargin(r)&&(u=!1),u&&(c[d++]=r),setNodeIsVisited(r,!0),r.right!==SENTINEL$1&&!getNodeIsVisited(r.right)){o+=r.delta,r=r.right;continue}}return setNodeIsVisited(n.root,!1),c}function intervalSearch(n,e,t,i,s,r,o){let a=n.root,l=0,c=0,d=0,u=0;const f=[];let g=0;for(;a!==SENTINEL$1;){if(getNodeIsVisited(a)){setNodeIsVisited(a.left,!1),setNodeIsVisited(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!getNodeIsVisited(a.left)){if(c=l+a.maxEnd,ct){setNodeIsVisited(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,r);let m=!0;i&&a.ownerId&&a.ownerId!==i&&(m=!1),s&&getNodeIsForValidation(a)&&(m=!1),o&&!getNodeIsInGlyphMargin(a)&&(m=!1),m&&(f[g++]=a)}if(setNodeIsVisited(a,!0),a.right!==SENTINEL$1&&!getNodeIsVisited(a.right)){l+=a.delta,a=a.right;continue}}return setNodeIsVisited(n.root,!1),f}function rbTreeInsert(n,e){if(n.root===SENTINEL$1)return e.parent=SENTINEL$1,e.left=SENTINEL$1,e.right=SENTINEL$1,setNodeColor(e,0),n.root=e,n.root;treeInsert(n,e),recomputeMaxEndWalkToRoot(e.parent);let t=e;for(;t!==n.root&&getNodeColor(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;getNodeColor(i)===1?(setNodeColor(t.parent,0),setNodeColor(i,0),setNodeColor(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,leftRotate$1(n,t)),setNodeColor(t.parent,0),setNodeColor(t.parent.parent,1),rightRotate$1(n,t.parent.parent))}else{const i=t.parent.parent.left;getNodeColor(i)===1?(setNodeColor(t.parent,0),setNodeColor(i,0),setNodeColor(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,rightRotate$1(n,t)),setNodeColor(t.parent,0),setNodeColor(t.parent.parent,1),leftRotate$1(n,t.parent.parent))}return setNodeColor(n.root,0),e}function treeInsert(n,e){let t=0,i=n.root;const s=e.start,r=e.end;for(;;)if(intervalCompare(s,r,i.start+t,i.end+t)<0)if(i.left===SENTINEL$1){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===SENTINEL$1){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=SENTINEL$1,e.right=SENTINEL$1,setNodeColor(e,1)}function rbTreeDelete(n,e){let t,i;if(e.left===SENTINEL$1?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===SENTINEL$1?(t=e.left,i=e):(i=leftest$1(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,setNodeColor(t,0),e.detach(),resetSentinel$1(),recomputeMaxEnd(t),n.root.parent=SENTINEL$1;return}const s=getNodeColor(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,setNodeColor(i,getNodeColor(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==SENTINEL$1&&(i.left.parent=i),i.right!==SENTINEL$1&&(i.right.parent=i)),e.detach(),s){recomputeMaxEndWalkToRoot(t.parent),i!==e&&(recomputeMaxEndWalkToRoot(i),recomputeMaxEndWalkToRoot(i.parent)),resetSentinel$1();return}recomputeMaxEndWalkToRoot(t),recomputeMaxEndWalkToRoot(t.parent),i!==e&&(recomputeMaxEndWalkToRoot(i),recomputeMaxEndWalkToRoot(i.parent));let r;for(;t!==n.root&&getNodeColor(t)===0;)t===t.parent.left?(r=t.parent.right,getNodeColor(r)===1&&(setNodeColor(r,0),setNodeColor(t.parent,1),leftRotate$1(n,t.parent),r=t.parent.right),getNodeColor(r.left)===0&&getNodeColor(r.right)===0?(setNodeColor(r,1),t=t.parent):(getNodeColor(r.right)===0&&(setNodeColor(r.left,0),setNodeColor(r,1),rightRotate$1(n,r),r=t.parent.right),setNodeColor(r,getNodeColor(t.parent)),setNodeColor(t.parent,0),setNodeColor(r.right,0),leftRotate$1(n,t.parent),t=n.root)):(r=t.parent.left,getNodeColor(r)===1&&(setNodeColor(r,0),setNodeColor(t.parent,1),rightRotate$1(n,t.parent),r=t.parent.left),getNodeColor(r.left)===0&&getNodeColor(r.right)===0?(setNodeColor(r,1),t=t.parent):(getNodeColor(r.left)===0&&(setNodeColor(r.right,0),setNodeColor(r,1),leftRotate$1(n,r),r=t.parent.left),setNodeColor(r,getNodeColor(t.parent)),setNodeColor(t.parent,0),setNodeColor(r.left,0),rightRotate$1(n,t.parent),t=n.root));setNodeColor(t,0),resetSentinel$1()}function leftest$1(n){for(;n.left!==SENTINEL$1;)n=n.left;return n}function resetSentinel$1(){SENTINEL$1.parent=SENTINEL$1,SENTINEL$1.delta=0,SENTINEL$1.start=0,SENTINEL$1.end=0}function leftRotate$1(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==SENTINEL$1&&(t.left.parent=e),t.parent=e.parent,e.parent===SENTINEL$1?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,recomputeMaxEnd(e),recomputeMaxEnd(t)}function rightRotate$1(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==SENTINEL$1&&(t.right.parent=e),t.parent=e.parent,e.parent===SENTINEL$1?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,recomputeMaxEnd(e),recomputeMaxEnd(t)}function computeMaxEnd(n){let e=n.end;if(n.left!==SENTINEL$1){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==SENTINEL$1){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function recomputeMaxEnd(n){n.maxEnd=computeMaxEnd(n)}function recomputeMaxEndWalkToRoot(n){for(;n!==SENTINEL$1;){const e=computeMaxEnd(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function intervalCompare(n,e,t,i){return n===t?e-i:n-t}class TreeNode{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==SENTINEL)return leftest(this.right);let e=this;for(;e.parent!==SENTINEL&&e.parent.left!==e;)e=e.parent;return e.parent===SENTINEL?SENTINEL:e.parent}prev(){if(this.left!==SENTINEL)return righttest(this.left);let e=this;for(;e.parent!==SENTINEL&&e.parent.right!==e;)e=e.parent;return e.parent===SENTINEL?SENTINEL:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const SENTINEL=new TreeNode(null,0);SENTINEL.parent=SENTINEL;SENTINEL.left=SENTINEL;SENTINEL.right=SENTINEL;SENTINEL.color=0;function leftest(n){for(;n.left!==SENTINEL;)n=n.left;return n}function righttest(n){for(;n.right!==SENTINEL;)n=n.right;return n}function calculateSize(n){return n===SENTINEL?0:n.size_left+n.piece.length+calculateSize(n.right)}function calculateLF(n){return n===SENTINEL?0:n.lf_left+n.piece.lineFeedCnt+calculateLF(n.right)}function resetSentinel(){SENTINEL.parent=SENTINEL}function leftRotate(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==SENTINEL&&(t.left.parent=e),t.parent=e.parent,e.parent===SENTINEL?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function rightRotate(n,e){const t=e.left;e.left=t.right,t.right!==SENTINEL&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===SENTINEL?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function rbDelete(n,e){let t,i;if(e.left===SENTINEL?(i=e,t=i.right):e.right===SENTINEL?(i=e,t=i.left):(i=leftest(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),resetSentinel(),n.root.parent=SENTINEL;return}const s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,recomputeTreeMetadata(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,recomputeTreeMetadata(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==SENTINEL&&(i.left.parent=i),i.right!==SENTINEL&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,recomputeTreeMetadata(n,i)),e.detach(),t.parent.left===t){const o=calculateSize(t),a=calculateLF(t);if(o!==t.parent.size_left||a!==t.parent.lf_left){const l=o-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=o,t.parent.lf_left=a,updateTreeMetadata(n,t.parent,l,c)}}if(recomputeTreeMetadata(n,t.parent),s){resetSentinel();return}let r;for(;t!==n.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,leftRotate(n,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,rightRotate(n,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,leftRotate(n,t.parent),t=n.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,rightRotate(n,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,leftRotate(n,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,rightRotate(n,t.parent),t=n.root));t.color=0,resetSentinel()}function fixInsert(n,e){for(recomputeTreeMetadata(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,leftRotate(n,e)),e.parent.color=0,e.parent.parent.color=1,rightRotate(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,rightRotate(n,e)),e.parent.color=0,e.parent.parent.color=1,leftRotate(n,e.parent.parent))}n.root.color=0}function updateTreeMetadata(n,e,t,i){for(;e!==n.root&&e!==SENTINEL;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function recomputeTreeMetadata(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=calculateSize(e.left)-e.size_left,i=calculateLF(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const AverageBufferSize=65535;function createUintArray(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class LineStarts{constructor(e,t,i,s,r){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=r}}function createLineStartsFast(n,e=!0){const t=[0];let i=1;for(let s=0,r=n.length;s126)&&(o=!1)}const a=new LineStarts(createUintArray(n),i,s,r,o);return n.length=0,a}class Piece{constructor(e,t,i,s,r){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=r}}class StringBuffer{constructor(e,t){this.buffer=e,this.lineStarts=t}}class PieceTreeSnapshot{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==SENTINEL&&e.iterate(e.root,i=>(i!==SENTINEL&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class PieceTreeSearchCache{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const r of i)r!==null&&s.push(r);this._cache=s}}}class PieceTreeBase{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new StringBuffer("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=SENTINEL,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let r=0,o=e.length;r0){e[r].lineStarts||(e[r].lineStarts=createLineStartsFast(e[r].buffer));const a=new Piece(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),s=this.rbInsertRight(s,a)}this._searchCache=new PieceTreeSearchCache(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=AverageBufferSize,i=t-Math.floor(t/3),s=i*2;let r="",o=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(o<=i||o+d0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new StringBuffer(l,createLineStartsFast(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new PieceTreeSnapshot(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==SENTINEL;)if(s.left!==SENTINEL&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const r=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=r+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==SENTINEL;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const r=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+r.index,r.index===0){const o=this.getOffsetAt(i+1,1),a=s-o;return new Position$1(i+1,a+1)}return new Position$1(i+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===SENTINEL){const r=this.getOffsetAt(i+1,1),o=s-e-r;return new Position$1(i+1,o+1)}else t=t.right;return new Position$1(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=s.substring(r+e.remainder,r+i.piece.length);for(i=i.next();i!==SENTINEL;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=a.substring(l,l+t.remainder);break}else o+=a.substr(l,i.piece.length);i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,r=>{if(r===SENTINEL)return!0;const o=r.piece;let a=o.length;if(a===0)return!0;const l=this._buffers[o.bufferIndex].buffer,c=this._buffers[o.bufferIndex].lineStarts,d=o.start.line,u=o.end.line;let f=c[d]+o.start.column;if(s&&(l.charCodeAt(f)===10&&(f++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(f+a-1)===13?(s=!0,i+=l.substr(f,a-1)):i+=l.substr(f,a),!0;i+=this._EOLNormalized?l.substring(f,Math.max(f,c[d+1]-this._EOLLength)):l.substring(f,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=d+1;gL+m,t.reset(0)):(S=f.buffer,w=L=>L,t.reset(m));do if(v=t.next(S),v){if(w(v.index)>=_)return d;this.positionInBuffer(e,w(v.index)-g,C);const L=this.getLineFeedCnt(e.piece.bufferIndex,r,C),I=C.line===r.line?C.column-r.column+s:C.column+1,N=I+v[0].length;if(u[d++]=createFindMatch(new Range$2(i+L,I,i+L,N),v,l),w(v.index)+v[0].length>=_||d>=c)return d}while(v);return d}findMatchesLineByLine(e,t,i,s){const r=[];let o=0;const a=new Searcher(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,s,o,r),r;let f=e.startLineNumber,g=l.node;for(;g!==c.node;){const _=this.getLineFeedCnt(g.piece.bufferIndex,d,g.piece.end);if(_>=1){const C=this._buffers[g.piece.bufferIndex].lineStarts,S=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),w=C[d.line+_],L=f===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(g,a,f,L,d,this.positionInBuffer(g,w-S),t,i,s,o,r),o>=s)return r;f+=_}const v=f===e.startLineNumber?e.startColumn-1:0;if(f===e.endLineNumber){const C=this.getLineContent(f).substring(v,e.endColumn-1);return o=this._findMatchesInLine(t,a,C,e.endLineNumber,v,o,r,i,s),r}if(o=this._findMatchesInLine(t,a,this.getLineContent(f).substr(v),f,v,o,r,i,s),o>=s)return r;f++,l=this.nodeAt2(f,1),g=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(f===e.endLineNumber){const _=f===e.startLineNumber?e.startColumn-1:0,v=this.getLineContent(f).substring(_,e.endColumn-1);return o=this._findMatchesInLine(t,a,v,e.endLineNumber,_,o,r,i,s),r}const m=f===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(c.node,a,f,m,d,u,t,i,s,o,r),r}_findMatchesInLine(e,t,i,s,r,o,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const f=e.simpleSearch,g=f.length,m=i.length;let _=-g;for(;(_=i.indexOf(f,_+g))!==-1;)if((!d||isValidMatch(d,i,m,_,g))&&(a[o++]=new FindMatch(new Range$2(s,_+1+r,s,_+1+g+r),null),o>=c))return o;return o}let u;t.reset(0);do if(u=t.next(i),u&&(a[o++]=createFindMatch(new Range$2(s,u.index+1+r,s,u.index+1+u[0].length+r),u,l),o>=c))return o;while(u);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==SENTINEL){const{node:s,remainder:r,nodeStartOffset:o}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,c=this.positionInBuffer(s,r);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&o+a.length===e&&t.lengthe){const d=[];let u=new Piece(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,r)===10){const _={line:u.start.line+1,column:0};u=new Piece(u.bufferIndex,_,u.end,this.getLineFeedCnt(u.bufferIndex,_,u.end),u.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,r-1)===13){const _=this.positionInBuffer(s,r-1);this.deleteNodeTail(s,_),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,c);else this.deleteNodeTail(s,c);const f=this.createNewPieces(t);u.length>0&&this.rbInsertRight(s,u);let g=s;for(let m=0;m=0;o--)r=this.rbInsertLeft(r,s[o]);this.validateCRLFWithPrevNode(r),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let r=s;for(let o=1;o=f)c=u+1;else break;return i?(i.line=u,i.column=l-g,null):{line:u,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const r=s[i.line+1],o=s[i.line]+i.column;if(r>o+1)return i.line-t.line;const a=o-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tAverageBufferSize){const d=[];for(;e.length>AverageBufferSize;){const f=e.charCodeAt(AverageBufferSize-1);let g;f===13||f>=55296&&f<=56319?(g=e.substring(0,AverageBufferSize-1),e=e.substring(AverageBufferSize-1)):(g=e.substring(0,AverageBufferSize),e=e.substring(AverageBufferSize));const m=createLineStartsFast(g);d.push(new Piece(this._buffers.length,{line:0,column:0},{line:m.length-1,column:g.length-m[m.length-1]},m.length-1,g.length)),this._buffers.push(new StringBuffer(g,m))}const u=createLineStartsFast(e);return d.push(new Piece(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new StringBuffer(e,u)),d}let t=this._buffers[0].buffer.length;const i=createLineStartsFast(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(u+l,u+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==SENTINEL;){const o=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=o.substring(l,l+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=o.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==SENTINEL;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),r=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const o=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(o!==r)return{index:o,remainder:0}}return{index:r,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,r=i.start.line+t+1;return r>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[r]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,r=this.offsetInBuffer(i.bufferIndex,i.end),o=t,a=this.offsetInBuffer(i.bufferIndex,o),l=this.getLineFeedCnt(i.bufferIndex,i.start,o),c=l-s,d=a-r,u=i.length+d;e.piece=new Piece(i.bufferIndex,i.start,o,l,u),updateTreeMetadata(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,r=this.offsetInBuffer(i.bufferIndex,i.start),o=t,a=this.getLineFeedCnt(i.bufferIndex,o,i.end),l=this.offsetInBuffer(i.bufferIndex,o),c=a-s,d=r-l,u=i.length+d;e.piece=new Piece(i.bufferIndex,o,i.end,a,u),updateTreeMetadata(this,e,d,c)}shrinkNode(e,t,i){const s=e.piece,r=s.start,o=s.end,a=s.length,l=s.lineFeedCnt,c=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,c),u=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,r);e.piece=new Piece(s.bufferIndex,s.start,c,d,u),updateTreeMetadata(this,e,u-a,d-l);const f=new Piece(s.bufferIndex,i,o,this.getLineFeedCnt(s.bufferIndex,i,o),this.offsetInBuffer(s.bufferIndex,o)-this.offsetInBuffer(s.bufferIndex,i)),g=this.rbInsertRight(e,f);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const r=createLineStartsFast(t,!1);for(let g=0;ge)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const r={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(r),r}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==SENTINEL;)if(i.left!==SENTINEL&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const r=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(r+t-1,o),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const r=this.getAccumulatedValue(i,e-i.lf_left-2);if(r+t-1<=i.piece.length)return{node:i,remainder:r+t-1,nodeStartOffset:s};t-=i.piece.length-r;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==SENTINEL;){if(i.piece.lineFeedCnt>0){const r=this.getAccumulatedValue(i,0),o=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,r),nodeStartOffset:o}}else if(i.piece.length>=t-1){const r=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:r}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===SENTINEL||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,r=i[s]+t.start.column;return s===i.length-1||i[s+1]>r+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(r)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===SENTINEL||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let r;e.piece.end.column===0?r={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:r={line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Piece(e.piece.bufferIndex,e.piece.start,r,a,o),updateTreeMetadata(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Piece(t.piece.bufferIndex,l,t.piece.end,d,c),updateTreeMetadata(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r +`);this.rbInsertRight(e,u[0]);for(let f=0;fv.sortIndex-C.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=r,this._mightContainNonBasicASCII=o;const g=this._doApplyEdits(l);let m=null;if(t&&u.length>0){u.sort((_,v)=>v.lineNumber-_.lineNumber),m=[];for(let _=0,v=u.length;_0&&u[_-1].lineNumber===C)continue;const S=u[_].oldContent,w=this.getLineContent(C);w.length===0||w===S||firstNonWhitespaceIndex(w)!==-1||m.push(C)}}return this._onDidChangeContent.fire(),new ApplyEditsResult(f,g,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,r=new Range$2(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let o=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,m=e.length;g0&&l.push(_.text),o=v.endLineNumber,a=v.endColumn}const c=l.join(""),[d,u,f]=countEOL(c);return{sortIndex:0,identifier:e[0].identifier,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:f,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(PieceTreeTextBuffer._sortOpsDescending);const t=[];for(let i=0;i0){const f=l.eolCount+1;f===1?u=new Range$2(c,d,c,d+l.firstLineLength):u=new Range$2(c,d,c+f-1,l.lastLineLength+1)}else u=new Range$2(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),r=l}return t}static _sortOpsAscending(e,t){const i=Range$2.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=Range$2.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class PieceTreeTextBufferFactory{constructor(e,t,i,s,r,o,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=r,this._containsRTL=o,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`:`\r +`:i>t/2?`\r +`:` +`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r +`&&(this._cr>0||this._lf>0)||t===` +`&&(this._cr>0||this._crlf>0)))for(let r=0,o=i.length;r=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=createLineStarts(this._tmpLineStarts,e);this.chunks.push(new StringBuffer(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=containsRTL(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=containsUnusualLineTerminators(e)))}finish(e=!0){return this._finish(),new PieceTreeTextBufferFactory(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=createLineStartsFast(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class FixedArray{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),r=this._store.slice(e+t),o=arrayFill(i,this._default);this._store=s.concat(o,r)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new ContiguousMultilineTokens(e,[t]))}finalize(){return this._tokens}}class TokenizerWithStateStore{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new TrackingTokenizationStateStore(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class TokenizerWithStateStoreAndTextModel extends TokenizerWithStateStore{constructor(e,t,i,s){super(e,t),this._textModel=i,this._languageIdCodec=s}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>t)break;const r=this._textModel.getLineContent(s.lineNumber),o=safeTokenize(this._languageIdCodec,i,this.tokenizationSupport,r,!0,s.startState);e.add(s.lineNumber,o.tokens),this.store.setEndState(s.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const s=this._textModel.getLanguageId(),r=this._textModel.getLineContent(e.lineNumber),o=r.substring(0,e.column-1)+t+r.substring(e.column-1),a=safeTokenize(this._languageIdCodec,s,this.tokenizationSupport,o,!0,i),l=new LineTokens(a.tokens,o,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,r=e.column,o=this.getStartState(s);if(!o)return null;const a=this._textModel.getLineContent(s),l=a.substring(0,r-1)+i+a.substring(r-1+t),c=this._textModel.getLanguageIdAtPosition(s,0),d=safeTokenize(this._languageIdCodec,c,this.tokenizationSupport,l,!0,o);return new LineTokens(d.tokens,l,this._languageIdCodec)}hasAccurateTokensForLine(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class RangePriorityQueueImpl{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new OffsetRange(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new OffsetRange(i.start,e):this._ranges.splice(t,1,new OffsetRange(i.start,e),new OffsetRange(e+1,i.endExclusive))}}addRange(e){OffsetRange.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function safeTokenize(n,e,t,i,s,r){let o=null;if(t)try{o=t.tokenizeEncoded(i,s,r.clone())}catch(a){onUnexpectedError(a)}return o||(o=nullTokenizeEncoded(n.encodeLanguageId(e),r)),LineTokens.convertToEndOffset(o.tokens,i.length),o}class DefaultBackgroundTokenizer{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,runWhenGlobalIdle(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var i;const t=(i=this._tokenizerWithStateStore)==null?void 0:i.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new LineRange$1(e,t))}}class AttachedViews{constructor(){this._onDidChangeVisibleRanges=new Emitter$1,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new AttachedViewImpl(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class AttachedViewImpl{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new LineRange$1(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class AttachedViewHandler extends Disposable{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new RunOnceScheduler(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){equals$1(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class AbstractTokens extends Disposable{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new Emitter$1),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new Emitter$1),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}class TreeSitterTokens extends AbstractTokens{constructor(e,t,i,s){super(t,i,s),this._treeSitterService=e,this._tokenizationSupport=null,this._initialize()}_initialize(){const e=this.getLanguageId();(!this._tokenizationSupport||this._lastLanguageId!==e)&&(this._lastLanguageId=e,this._tokenizationSupport=TreeSitterTokenizationRegistry.get(e))}getLineTokens(e){const t=this._textModel.getLineContent(e);if(this._tokenizationSupport){const i=this._tokenizationSupport.tokenizeEncoded(e,this._textModel);if(i)return new LineTokens(i,t,this._languageIdCodec)}return LineTokens.createEmpty(t,this._languageIdCodec)}resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]}),this._initialize()}handleDidChangeAttached(){}handleDidChangeContent(e){e.isFlush&&this.resetTokenization(!1)}forceTokenization(e){}hasAccurateTokensForLine(e){return!0}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLineWithEdit(e,t,i){return null}get hasTokens(){return this._treeSitterService.getParseResult(this._textModel)!==void 0}}const ITreeSitterParserService=createDecorator("treeSitterParserService"),EMPTY_LINE_TOKENS=new Uint32Array(0).buffer;class ContiguousTokensEditing{static deleteBeginning(e,t){return e===null||e===EMPTY_LINE_TOKENS?e:ContiguousTokensEditing.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===EMPTY_LINE_TOKENS)return e;const i=toUint32Array(e),s=i[i.length-2];return ContiguousTokensEditing.delete(e,t,s)}static delete(e,t,i){if(e===null||e===EMPTY_LINE_TOKENS||t===i)return e;const s=toUint32Array(e),r=s.length>>>1;if(t===0&&s[s.length-2]===i)return EMPTY_LINE_TOKENS;const o=LineTokens.findIndexInTokensArray(s,t),a=o>0?s[o-1<<1]:0,l=s[o<<1];if(id&&(s[c++]=m,s[c++]=s[(g<<1)+1],d=m)}if(c===s.length)return e;const f=new Uint32Array(c);return f.set(s.subarray(0,c),0),f.buffer}static append(e,t){if(t===EMPTY_LINE_TOKENS)return e;if(e===EMPTY_LINE_TOKENS)return t;if(e===null)return e;if(t===null)return null;const i=toUint32Array(e),s=toUint32Array(t),r=s.length>>>1,o=new Uint32Array(i.length+s.length);o.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let o=LineTokens.findIndexInTokensArray(s,t);o>0&&s[o-1<<1]===t&&o--;for(let a=o;a0}getTokens(e,t,i){let s=null;if(t1&&(r=TokenMetadata.getLanguageId(s[1])!==e),!r)return EMPTY_LINE_TOKENS}if(!s||s.length===0){const r=new Uint32Array(2);return r[0]=t,r[1]=getDefaultMetadata(e),r.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=ContiguousTokensEditing.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=ContiguousTokensEditing.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=ContiguousTokensEditing.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=ContiguousTokensEditing.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=ContiguousTokensEditing.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,r=e.length;s>>0}class SparseTokensStore{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const r=t[0].getRange(),o=t[t.length-1].getRange();if(!r||!o)return e;i=e.plusRange(r).plusRange(o)}let s=null;for(let r=0,o=this._pieces.length;ri.endLineNumber){s=s||{index:r};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(r,1),r--,o--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:r};continue}const[l,c]=a.split(i);if(l.isEmpty()){s=s||{index:r};continue}c.isEmpty()||(this._pieces.splice(r,1,l,c),r++,o++,s=s||{index:r})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=arrayInsert(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=SparseTokensStore._findFirstPieceWithLine(i,e),r=i[s].getLineTokens(e);if(!r)return t;const o=t.getCount(),a=r.getCount();let l=0;const c=[];let d=0,u=0;const f=(g,m)=>{g!==u&&(u=g,c[d++]=g,c[d++]=m)};for(let g=0;g>>0,S=~C>>>0;for(;lt)s=r-1;else{for(;r>i&&e[r-1].startLineNumber<=t&&t<=e[r-1].endLineNumber;)r--;return r}}return i}acceptEdit(e,t,i,s,r){for(const o of this._pieces)o.acceptEdit(e,t,i,s,r)}}var __decorate$2f=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2c=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TokenizationTextModelPart_1;let TokenizationTextModelPart=TokenizationTextModelPart_1=class extends TextModelPart{constructor(e,t,i,s,r,o,a){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=s,this._languageService=r,this._languageConfigurationService=o,this._treeSitterService=a,this._semanticTokens=new SparseTokensStore(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new Emitter$1),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Emitter$1),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Emitter$1),this.onDidChangeTokens=this._onDidChangeTokens.event,this._tokensDisposables=this._register(new DisposableStore),this._register(this._languageConfigurationService.onDidChange(l=>{l.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(Event$1.filter(TreeSitterTokenizationRegistry.onDidChange,l=>l.changedLanguages.includes(this._languageId))(()=>{this.createPreferredTokenProvider()})),this.createPreferredTokenProvider()}createGrammarTokens(){return this._register(new GrammarTokens(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews))}createTreeSitterTokens(){return this._register(new TreeSitterTokens(this._treeSitterService,this._languageService.languageIdCodec,this._textModel,()=>this._languageId))}createTokens(e){var i;const t=this._tokens!==void 0;(i=this._tokens)==null||i.dispose(),this._tokens=e?this.createTreeSitterTokens():this.createGrammarTokens(),this._tokensDisposables.clear(),this._tokensDisposables.add(this._tokens.onDidChangeTokens(s=>{this._emitModelTokensChangedEvent(s)})),this._tokensDisposables.add(this._tokens.onDidChangeBackgroundTokenizationState(s=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),t&&this._tokens.resetTokenization()}createPreferredTokenProvider(){TreeSitterTokenizationRegistry.get(this._languageId)?this._tokens instanceof TreeSitterTokens||this.createTokens(!0):this._tokens instanceof GrammarTokens||this.createTokens(!1)}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,r]=countEOL(t.text);this._semanticTokens.acceptEdit(t.range,i,s,r,t.text.length>0?t.text.charCodeAt(0):0)}this._tokens.handleDidChangeContent(e)}handleDidChangeAttached(){this._tokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this._tokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber")}get hasTokens(){return this._tokens.hasTokens}resetTokenization(){this._tokens.resetTokenization()}get backgroundTokenizationState(){return this._tokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this._tokens.forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this._tokens.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this._tokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this._tokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this._tokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this._tokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),r=s.findTokenIndexAtOffset(t.column-1),[o,a]=TokenizationTextModelPart_1._findLanguageBoundaries(s,r),l=getWordAtText(t.column,this.getLanguageConfiguration(s.getLanguageId(r)).getWordDefinition(),i.substring(o,a),o);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(r>0&&o===t.column-1){const[c,d]=TokenizationTextModelPart_1._findLanguageBoundaries(s,r-1),u=getWordAtText(t.column,this.getLanguageConfiguration(s.getLanguageId(r-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)s=e.getStartOffset(o);let r=e.getLineContent().length;for(let o=t,a=e.getCount();o{const o=this.getLanguageId();r.changedLanguages.indexOf(o)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:r,state:o})=>{if(o){let a=this._attachedViewStates.get(r);a||(a=new AttachedViewHandler(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(r,a)),a.handleStateChange(o)}else this._attachedViewStates.deleteAndDispose(r)}))}resetTokenization(e=!0){var r;this._tokens.flush(),(r=this._debugBackgroundTokens)==null||r.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new TrackingTokenizationStateStore(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const t=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const o=TokenizationRegistry.get(this.getLanguageId());if(!o)return[null,null];let a;try{a=o.getInitialState()}catch(l){return onUnexpectedError(l),[null,null]}return[o,a]},[i,s]=t();if(i&&s?this._tokenizer=new TokenizerWithStateStoreAndTextModel(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const o={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var d;if(!this._tokenizer)return;const c=this._tokenizer.store.getFirstInvalidEndStateLineNumber();c!==null&&a>=c&&((d=this._tokenizer)==null||d.store.setEndState(a,l))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,o)),!this._backgroundTokenizer.value&&!this._textModel.isTooLargeForTokenization()&&(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new DefaultBackgroundTokenizer(this._tokenizer,o),this._defaultBackgroundTokenizer.handleChanges()),i!=null&&i.backgroundTokenizerShouldOnlyVerifyTokens&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new ContiguousTokensStore(this._languageIdCodec),this._debugBackgroundStates=new TrackingTokenizationStateStore(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)==null||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)==null||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)==null||e.handleChanges()}handleDidChangeContent(e){var t,i,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const r of e.changes){const[o,a]=countEOL(r.text);this._tokens.acceptEdit(r.range,o,a),(t=this._debugBackgroundTokens)==null||t.acceptEdit(r.range,o,a)}(i=this._debugBackgroundStates)==null||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)==null||s.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=LineRange$1.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var o,a;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new ContiguousMultilineTokensBuilder,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(i,e,t),r=this.setTokens(i.finalize());if(s)for(const l of r.changes)(o=this._backgroundTokenizer.value)==null||o.requestTokens(l.fromLineNumber,l.toLineNumber+1);(a=this._defaultBackgroundTokenizer)==null||a.checkFinished()}forceTokenization(e){var i,s;const t=new ContiguousMultilineTokensBuilder;(i=this._tokenizer)==null||i.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),(s=this._defaultBackgroundTokenizer)==null||s.checkFinished()}hasAccurateTokensForLine(e){return this._tokenizer?this._tokenizer.hasAccurateTokensForLine(e):!0}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}getLineTokens(e){var s;const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const r=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(r)&&((s=this._debugBackgroundTokenizer.value)!=null&&s.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new Position$1(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class ModelRawFlush{constructor(){this.changeType=1}}class LineInjectedText{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const r of t)i+=e.substring(s,r.column-1),s=r.column-1,i+=r.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new LineInjectedText(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new LineInjectedText(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,r){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=r}}class ModelRawLineChanged{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class ModelRawLinesDeleted{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class ModelRawLinesInserted{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class ModelRawEOLChanged{constructor(){this.changeType=5}}class ModelRawContentChangedEvent{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2b=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TextModel_1;function createTextBufferFactory(n){const e=new PieceTreeTextBufferBuilder;return e.acceptChunk(n),e.finish()}function createTextBufferFactoryFromSnapshot(n){const e=new PieceTreeTextBufferBuilder;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function createTextBuffer(n,e){let t;return typeof n=="string"?t=createTextBufferFactory(n):isITextSnapshot(n)?t=createTextBufferFactoryFromSnapshot(n):t=n,t.create(e)}let MODEL_ID$1=0;const LIMIT_FIND_COUNT=999,LONG_LINE_BOUNDARY=1e4;class TextModelSnapshot{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const invalidFunc$1=()=>{throw new Error("Invalid change accessor")};var us;let TextModel=(us=class extends Disposable{static resolveOptions(e,t){if(t.detectIndentation){const i=guessIndentation(e,t.tabSize,t.insertSpaces);return new TextModelResolvedOptions({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new TextModelResolvedOptions(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return combinedDisposable(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,r,o,a,l){super(),this._undoRedoService=r,this._languageService=o,this._languageConfigurationService=a,this.instantiationService=l,this._onWillDispose=this._register(new Emitter$1),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new DidChangeDecorationsEmitter(m=>this.handleBeforeFireDecorationsChangedEvent(m))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new Emitter$1),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Emitter$1),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new Emitter$1),this._eventEmitter=this._register(new DidChangeContentEmitter),this._languageSelectionListener=this._register(new MutableDisposable),this._deltaDecorationCallCnt=0,this._attachedViews=new AttachedViews,MODEL_ID$1++,this.id="$model"+MODEL_ID$1,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=URI.parse("inmemory://model/"+MODEL_ID$1):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:c,disposable:d}=createTextBuffer(e,i.defaultEOL);this._buffer=c,this._bufferDisposable=d,this._options=TextModel_1.resolveOptions(this._buffer,i);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new BracketPairsTextModelPart(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new GuidesTextModelPart(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ColorizedBracketPairsDecorationProvider(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(TokenizationTextModelPart,this,this._bracketPairs,u,this._attachedViews);const f=this._buffer.getLineCount(),g=this._buffer.getValueLengthInRange(new Range$2(1,1,f,this._buffer.getLineLength(f)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=g>TextModel_1.LARGE_FILE_SIZE_THRESHOLD||f>TextModel_1.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=g>TextModel_1.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=g>TextModel_1._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=singleLetterHash(MODEL_ID$1),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new DecorationsTrees,this._commandManager=new EditStack(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u),this._register(this._languageConfigurationService.onDidChange(m=>{this._bracketPairs.handleLanguageConfigurationServiceChange(m),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(m)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new PieceTreeTextBuffer([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Disposable.None}_assertNotDisposed(){if(this._isDisposed)throw new BugIndicatingError("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new InternalModelContentChangeEvent(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw illegalArgument();const{textBuffer:t,disposable:i}=createTextBuffer(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,r,o,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new DecorationsTrees,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ModelRawContentChangedEvent([new ModelRawFlush],this._versionId,!1,!1),this._createContentChanged2(new Range$2(1,1,r,o),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`:` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ModelRawContentChangedEvent([new ModelRawEOLChanged],this._versionId,!1,!1),this._createContentChanged2(new Range$2(1,1,r,o),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const r=this._buffer.getLineLength(s);r>=LONG_LINE_BOUNDARY?t+=r:e+=r}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,r=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new TextModelResolvedOptions({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:r,bracketPairColorizationOptions:o});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=guessIndentation(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),normalizeIndentation(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(UNUSUAL_LINE_TERMINATORS.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new BugIndicatingError("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new TextModelSnapshot(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new BugIndicatingError("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new BugIndicatingError("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let r=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),o=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(r<1)r=1,o=1;else if(r>t)r=t,o=this.getLineMaxColumn(r);else if(o<=1)o=1;else{const u=this.getLineMaxColumn(r);o>=u&&(o=u)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===r&&s===o&&a===c&&l===d&&e instanceof Range$2&&!(e instanceof Selection$1)?e:new Range$2(r,o,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const r=this.getLineMaxColumn(e);if(t>r)return!1;if(i===1){const o=this._buffer.getLineCharCode(e,t-2);if(isHighSurrogate(o))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),r=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),o=this._buffer.getLineCount();if(s<1)return new Position$1(1,1);if(s>o)return new Position$1(o,this.getLineMaxColumn(o));if(r<=1)return new Position$1(s,1);const a=this.getLineMaxColumn(s);if(r>=a)return new Position$1(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,r-2);if(isHighSurrogate(l))return new Position$1(s,r-1)}return new Position$1(s,r)}validatePosition(e){return this._assertNotDisposed(),e instanceof Position$1&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(r,o,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=o>1&&o<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,o-2):0,c=isHighSurrogate(a),d=isHighSurrogate(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Range$2&&!(e instanceof Selection$1)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),r=i.lineNumber,o=i.column,a=s.lineNumber,l=s.column;{const c=o>1?this._buffer.getLineCharCode(r,o-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=isHighSurrogate(c),f=isHighSurrogate(d);return!u&&!f?new Range$2(r,o,a,l):r===a&&o===l?new Range$2(r,o-1,a,l-1):u&&f?new Range$2(r,o-1,a,l+1):u?new Range$2(r,o-1,a,l):new Range$2(r,o,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new Range$2(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,r,o,a=LIMIT_FIND_COUNT){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>Range$2.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,f)=>u.startLineNumber-f.startLineNumber||u.startColumn-f.startColumn);const c=[];c.push(l.reduce((u,f)=>Range$2.areIntersecting(u,f)?u.plusRange(f):(c.push(u),f)));let d;if(!i&&e.indexOf(` +`)<0){const f=new SearchParams(e,i,s,r).parseSearchRequest();if(!f)return[];d=g=>this.findMatchesLineByLine(g,f,o,a)}else d=u=>TextModelSearch.findMatches(this,new SearchParams(e,i,s,r),u,o,a);return c.map(d).reduce((u,f)=>u.concat(f),[])}findNextMatch(e,t,i,s,r,o){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const c=new SearchParams(e,i,s,r).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new Range$2(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),f=this.findMatchesLineByLine(u,c,o,1);return TextModelSearch.findNextMatch(this,new SearchParams(e,i,s,r),a,o),f.length>0||(u=new Range$2(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),f=this.findMatchesLineByLine(u,c,o,1),f.length>0)?f[0]:null}return TextModelSearch.findNextMatch(this,new SearchParams(e,i,s,r),a,o)}findPreviousMatch(e,t,i,s,r,o){this._assertNotDisposed();const a=this.validatePosition(t);return TextModelSearch.findPreviousMatch(this,new SearchParams(e,i,s,r),a,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof ValidAnnotatedEditOperation?e:new ValidAnnotatedEditOperation(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let o=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,_=c.startLineNumber>g.endLineNumber;if(!m&&!_){d=!0;break}}if(!d){o=!1;break}}if(o)for(let a=0,l=this._trimAutoWhitespaceLines.length;am.endLineNumber)&&!(c===m.startLineNumber&&m.startColumn===d&&m.isEmpty()&&_&&_.length>0&&_.charAt(0)===` +`)&&!(c===m.startLineNumber&&m.startColumn===1&&m.isEmpty()&&_&&_.length>0&&_.charAt(_.length-1)===` +`)){u=!1;break}}if(u){const f=new Range$2(c,1,c,d);t.push(new ValidAnnotatedEditOperation(null,f,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const r=e.map(o=>{const a=this.getPositionAt(o.newPosition),l=this.getPositionAt(o.newEnd);return{range:new Range$2(a.lineNumber,a.column,l.lineNumber,l.column),text:o.oldText}});this._applyUndoRedoEdits(r,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const r=e.map(o=>{const a=this.getPositionAt(o.oldPosition),l=this.getPositionAt(o.oldEnd);return{range:new Range$2(a.lineNumber,a.column,l.lineNumber,l.column),text:o.newText}});this._applyUndoRedoEdits(r,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,r,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(r)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),o=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,o.length!==0){for(let c=0,d=o.length;c=0;A--){const F=g+A,B=w+A;T.takeFromEndWhile(G=>G.lineNumber>B);const W=T.takeFromEndWhile(G=>G.lineNumber===B);a.push(new ModelRawLineChanged(F,this.getLineContent(B),W))}if(C<_){const A=g+C;a.push(new ModelRawLinesDeleted(A+1,m))}if(CU.lineNumberU.lineNumber===ee)}a.push(new ModelRawLinesInserted(F+1,g+v,j,G))}l+=S}this._emitContentChangedEvent(new ModelRawContentChangedEvent(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new ModelRawLineChanged(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new ModelInjectedTextChangedEvent(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(r,o)=>this._deltaDecorationsImpl(e,[],[{range:r,options:o}])[0],changeDecoration:(r,o)=>{this._changeDecorationImpl(r,o)},changeDecorationOptions:(r,o)=>{this._changeDecorationOptionsImpl(r,_normalizeOptions(o))},removeDecoration:r=>{this._deltaDecorationsImpl(e,[r],[])},deltaDecorations:(r,o)=>r.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,r,o)};let s=null;try{s=t(i)}catch(r){onUnexpectedError(r)}return i.addDecoration=invalidFunc$1,i.changeDecoration=invalidFunc$1,i.changeDecorationOptions=invalidFunc$1,i.removeDecoration=invalidFunc$1,i.deltaDecorations=invalidFunc$1,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),onUnexpectedError(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:TRACKED_RANGE_OPTIONS[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),a=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),o,a,r),s.setOptions(TRACKED_RANGE_OPTIONS[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,r=!1){const o=this.getLineCount(),a=Math.min(o,Math.max(1,e)),l=Math.min(o,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new Range$2(a,1,l,c),u=this._getDecorationsInRange(d,i,s,r);return pushMany(u,this._decorationProvider.getDecorationsInRange(d,i,s)),u}getDecorationsInRange(e,t=0,i=!1,s=!1,r=!1){const o=this.validateRange(e),a=this._getDecorationsInRange(o,t,i,r);return pushMany(a,this._decorationProvider.getDecorationsInRange(o,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return LineInjectedText.fromDecorations(s).filter(r=>r.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,o,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),o=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),r,o,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),r=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber)}if(i.options.before||t.before){const l=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber)}const o=s!==r,a=isOptionsInjectedText(t)!==isNodeInjectedText(i);o||a?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const r=this.getVersionId(),o=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return indentOfLine(this.getLineContent(e))+1}},TextModel_1=us,us._MODEL_SYNC_LIMIT=50*1024*1024,us.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024,us.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3,us.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024,us.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:EDITOR_MODEL_DEFAULTS.tabSize,indentSize:EDITOR_MODEL_DEFAULTS.indentSize,insertSpaces:EDITOR_MODEL_DEFAULTS.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,largeFileOptimizations:EDITOR_MODEL_DEFAULTS.largeFileOptimizations,bracketPairColorizationOptions:EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions},us);TextModel=TextModel_1=__decorate$2e([__param$2b(4,IUndoRedoService),__param$2b(5,ILanguageService),__param$2b(6,ILanguageConfigurationService),__param$2b(7,IInstantiationService)],TextModel);function indentOfLine(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function isNodeInOverviewRuler(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function isOptionsInjectedText(n){return!!n.after||!!n.before}function isNodeInjectedText(n){return!!n.options.after||!!n.options.before}class DecorationsTrees{constructor(){this._decorationsTree0=new IntervalTree,this._decorationsTree1=new IntervalTree,this._injectedTextDecorationsTree=new IntervalTree}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,r,o){const a=e.getVersionId(),l=this._intervalSearch(t,i,s,r,a,o);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,s,r,o){const a=this._decorationsTree0.intervalSearch(e,t,i,s,r,o),l=this._decorationsTree1.intervalSearch(e,t,i,s,r,o),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,r,o);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,s){const r=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,r,!1);return this._ensureNodesHaveRanges(e,o).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(r=>r.options.showIfCollapsed||!r.range.isEmpty())}getAll(e,t,i,s,r){const o=e.getVersionId(),a=this._search(t,i,s,o,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,r){if(i)return this._decorationsTree1.search(e,t,s,r);{const o=this._decorationsTree0.search(e,t,s,r),a=this._decorationsTree1.search(e,t,s,r),l=this._injectedTextDecorationsTree.search(e,t,s,r);return o.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){isNodeInjectedText(e)?this._injectedTextDecorationsTree.insert(e):isNodeInOverviewRuler(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){isNodeInjectedText(e)?this._injectedTextDecorationsTree.delete(e):isNodeInOverviewRuler(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){isNodeInjectedText(e)?this._injectedTextDecorationsTree.resolveNode(e,t):isNodeInOverviewRuler(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function cleanClassName(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class DecorationOptions{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class ModelDecorationOverviewRulerOptions extends DecorationOptions{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:OverviewRulerLane.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class ModelDecorationGlyphMarginOptions{constructor(e){this.position=(e==null?void 0:e.position)??GlyphMarginLane.Center,this.persistLane=e==null?void 0:e.persistLane}}class ModelDecorationMinimapOptions extends DecorationOptions{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?Color.fromHex(e):t.getColor(e.id)}}class ModelDecorationInjectedTextOptions{static from(e){return e instanceof ModelDecorationInjectedTextOptions?e:new ModelDecorationInjectedTextOptions(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class ModelDecorationOptions{static register(e){return new ModelDecorationOptions(e)}static createDynamic(e){return new ModelDecorationOptions(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?cleanClassName(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?cleanClassName(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new ModelDecorationOverviewRulerOptions(e.overviewRuler):null,this.minimap=e.minimap?new ModelDecorationMinimapOptions(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new ModelDecorationGlyphMarginOptions(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?cleanClassName(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?cleanClassName(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?cleanClassName(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?htmlAttributeEncodeValue(e.linesDecorationsTooltip):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?cleanClassName(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?cleanClassName(e.marginClassName):null,this.inlineClassName=e.inlineClassName?cleanClassName(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?cleanClassName(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?cleanClassName(e.afterContentClassName):null,this.after=e.after?ModelDecorationInjectedTextOptions.from(e.after):null,this.before=e.before?ModelDecorationInjectedTextOptions.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1}}ModelDecorationOptions.EMPTY=ModelDecorationOptions.register({description:"empty"});const TRACKED_RANGE_OPTIONS=[ModelDecorationOptions.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),ModelDecorationOptions.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),ModelDecorationOptions.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),ModelDecorationOptions.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function _normalizeOptions(n){return n instanceof ModelDecorationOptions?n:ModelDecorationOptions.createDynamic(n)}class DidChangeDecorationsEmitter extends Disposable{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new Emitter$1),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)==null||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){var t,i;this._affectsMinimap||(this._affectsMinimap=!!((t=e.minimap)!=null&&t.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!((i=e.overviewRuler)!=null&&i.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class DidChangeContentEmitter extends Disposable{constructor(){super(),this._fastEmitter=this._register(new Emitter$1),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new Emitter$1),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}var __decorate$2d=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2a=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ModelService_1;function MODEL_ID(n){return n.toString()}let ModelData$1=class{constructor(e,t,i){this.model=e,this._modelEventListeners=new DisposableStore,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}};const DEFAULT_EOL=isLinux||isMacintosh?1:2;class DisposedModelInfo{constructor(e,t,i,s,r,o,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=r,this.sha1=o,this.versionId=a,this.alternativeVersionId=l}}var Cl;let ModelService=(Cl=class extends Disposable{constructor(e,t,i,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=s,this._onModelAdded=this._register(new Emitter$1),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Emitter$1),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Emitter$1),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var f;let i=EDITOR_MODEL_DEFAULTS.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const g=parseInt(e.editor.tabSize,10);isNaN(g)||(i=g),i<1&&(i=1)}let s="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const g=parseInt(e.editor.indentSize,10);isNaN(g)||(s=Math.max(g,1))}let r=EDITOR_MODEL_DEFAULTS.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let o=DEFAULT_EOL;const a=e.eol;a===`\r +`?o=2:a===` +`&&(o=1);let l=EDITOR_MODEL_DEFAULTS.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=EDITOR_MODEL_DEFAULTS.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=EDITOR_MODEL_DEFAULTS.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=EDITOR_MODEL_DEFAULTS.bracketPairColorizationOptions;return(f=e.editor)!=null&&f.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:r,detectIndentation:c,defaultEOL:o,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:OS$1===3||OS$1===2?` +`:`\r +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let r=this._modelCreationOptionsByLanguageAndResource[s+t];if(!r){const o=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);r=ModelService_1._readModelOptions({editor:o,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=r}return r}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,r=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const r=this.getCreationOptions(t,i,s),o=this._instantiationService.createInstance(TextModel,e,t,r,i);if(i&&this._disposedModels.has(MODEL_ID(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),f=u.canComputeSHA1(o)?u.computeSHA1(o)===c.sha1:!1;if(f||c.sharesUndoRedoStack){for(const g of d.past)isEditStackElement(g)&&g.matchesResource(i)&&g.setModel(o);for(const g of d.future)isEditStackElement(g)&&g.matchesResource(i)&&g.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,g=>isEditStackElement(g)&&g.matchesResource(i)),f&&(o._overwriteVersionId(c.versionId),o._overwriteAlternativeVersionId(c.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=MODEL_ID(o.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new ModelData$1(o,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let r;return t?r=this._createModelData(e,t,i,s):r=this._createModelData(e,PLAINTEXT_LANGUAGE_ID,i,s),this._onModelAdded.fire(r.model),r.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)isEditStackElement(d)&&d.matchesResource(e.uri)&&(r=!0,o+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)isEditStackElement(d)&&d.matchesResource(e.uri)&&(r=!0,o+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=ModelService_1.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(r)if(!s&&(o>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>isEditStackElement(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new DisposedModelInfo(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,o,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),r=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);ModelService_1._setModelOptionsForModel(e,o,r),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new DefaultModelSHA1Computer}},ModelService_1=Cl,Cl.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,Cl);ModelService=ModelService_1=__decorate$2d([__param$2a(0,IConfigurationService),__param$2a(1,ITextResourcePropertiesService),__param$2a(2,IUndoRedoService),__param$2a(3,IInstantiationService)],ModelService);const zh=class zh{canComputeSHA1(e){return e.getValueLength()<=zh.MAX_MODEL_SIZE}computeSHA1(e){const t=new StringSHA1,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};zh.MAX_MODEL_SIZE=10*1024*1024;let DefaultModelSHA1Computer=zh;const standaloneQuickInput="";var DefaultQuickAccessFilterValue;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(DefaultQuickAccessFilterValue||(DefaultQuickAccessFilterValue={}));const Extensions$2={Quickaccess:"workbench.contributions.quickaccess"};class QuickAccessRegistry{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),toDisposable(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return coalesce([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Registry.add(Extensions$2.Quickaccess,new QuickAccessRegistry);const NO_KEY_MODS={ctrlCmd:!1,alt:!1};var QuickInputHideReason;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(QuickInputHideReason||(QuickInputHideReason={}));var ItemActivation;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(ItemActivation||(ItemActivation={}));var QuickPickFocus;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(QuickPickFocus||(QuickPickFocus={}));var QuickInputButtonLocation;(function(n){n[n.Title=1]="Title",n[n.Inline=2]="Inline"})(QuickInputButtonLocation||(QuickInputButtonLocation={}));const IQuickInputService=createDecorator("quickInputService");var __decorate$2c=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$29=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let QuickAccessController=class extends Disposable{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Registry.as(Extensions$2.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var m,_;const[s,r]=this.getOrInstantiateProvider(e,i==null?void 0:i.enabledProviderPrefixes),o=this.visibleQuickAccess,a=o==null?void 0:o.descriptor;if(o&&r&&a===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(o.picker.value=e),this.adjustValueSelection(o.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let v;if(o&&a&&a!==r){const C=o.value.substr(a.prefix.length);C&&(v=`${r.prefix}${C}`)}if(!v){const C=s==null?void 0:s.defaultFilterValue;C===DefaultQuickAccessFilterValue.LAST?v=this.lastAcceptedPickerValues.get(r):typeof C=="string"&&(v=`${r.prefix}${C}`)}typeof v=="string"&&(e=v)}const l=(m=o==null?void 0:o.picker)==null?void 0:m.valueSelection,c=(_=o==null?void 0:o.picker)==null?void 0:_.value,d=new DisposableStore,u=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));u.value=e,this.adjustValueSelection(u,r,i),u.placeholder=(i==null?void 0:i.placeholder)??(r==null?void 0:r.placeholder),u.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!o,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(u.itemActivation=(i==null?void 0:i.itemActivation)??ItemActivation.SECOND),u.contextKey=r==null?void 0:r.contextKey,u.filterValue=v=>v.substring(r?r.prefix.length:0);let f;t&&(f=new DeferredPromise,d.add(Event$1.once(u.onWillAccept)(v=>{v.veto(),u.hide()}))),d.add(this.registerPickerListeners(u,s,r,e,i));const g=d.add(new CancellationTokenSource$1);if(s&&d.add(s.provide(u,g.token,i==null?void 0:i.providerOptions)),Event$1.once(u.onDidHide)(()=>{u.selectedItems.length===0&&g.cancel(),d.dispose(),f==null||f.complete(u.selectedItems.slice(0))}),u.show(),l&&c===e&&(u.valueSelection=l),t)return f==null?void 0:f.p}adjustValueSelection(e,t,i){let s;i!=null&&i.preserveValue?s=[e.value.length,e.value.length]:s=[(t==null?void 0:t.prefix.length)??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,r){const o=new DisposableStore,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return o.add(toDisposable(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),o.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,r==null?void 0:r.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:r==null?void 0:r.enabledProviderPrefixes,preserveValue:!0,providerOptions:r==null?void 0:r.providerOptions}):a.value=l})),i&&o.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),o}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!(t!=null&&t.includes(i.prefix)))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};QuickAccessController=__decorate$2c([__param$29(0,IQuickInputService),__param$29(1,IInstantiationService)],QuickAccessController);const toggle="";class Toggle extends Widget$1{constructor(e){super(),this._onChange=this._register(new Emitter$1),this.onChange=this._onChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...ThemeIcon.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(getBaseLayerHoverDelegate().setupManagedHover(e.hoverDelegate??getDefaultHoverDelegate("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const quickInput="";var __decorate$2b=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class LinkedText{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}__decorate$2b([memoize],LinkedText.prototype,"toString",null);const LINK_REGEX=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function parseLinkedText(n){const e=[];let t=0,i;for(;i=LINK_REGEX.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,r,,o]=i;o?e.push({label:s,href:r,title:o}):e.push({label:s,href:r}),t=i.index+i[0].length}return t{isEventLike(g)&&EventHelper.stop(g,!0),t.callback(r.href)},c=t.disposables.add(new DomEmitter(a,EventType$1.CLICK)).event,d=t.disposables.add(new DomEmitter(a,EventType$1.KEY_DOWN)).event,u=Event$1.chain(d,g=>g.filter(m=>{const _=new StandardKeyboardEvent(m);return _.equals(10)||_.equals(3)}));t.disposables.add(Gesture.addTarget(a));const f=t.disposables.add(new DomEmitter(a,EventType.Tap)).event;Event$1.any(c,f,u)(l,null,t.disposables),e.appendChild(a)}}var __decorate$2a=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$28=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const inQuickInputContextKeyValue="inQuickInput",InQuickInputContextKey=new RawContextKey(inQuickInputContextKeyValue,!1,localize("inQuickInput","Whether keyboard focus is inside the quick input control")),inQuickInputContext=ContextKeyExpr.has(inQuickInputContextKeyValue),quickInputTypeContextKeyValue="quickInputType",QuickInputTypeContextKey=new RawContextKey(quickInputTypeContextKeyValue,void 0,localize("quickInputType","The type of the currently visible quick input")),endOfQuickInputBoxContextKeyValue="cursorAtEndOfQuickInputBox",EndOfQuickInputBoxContextKey=new RawContextKey(endOfQuickInputBoxContextKeyValue,!1,localize("cursorAtEndOfQuickInputBox","Whether the cursor in the quick input is at the end of the input box")),endOfQuickInputBoxContext=ContextKeyExpr.has(endOfQuickInputBoxContextKeyValue),backButton={iconClass:ThemeIcon.asClassName(Codicon.quickInputBack),tooltip:localize("quickInput.back","Back"),handle:-1},Uh=class Uh extends Disposable{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=Uh.noPromptMessage,this._severity=Severity$2.Ignore,this.onDidTriggerButtonEmitter=this._register(new Emitter$1),this.onDidHideEmitter=this._register(new Emitter$1),this.onWillHideEmitter=this._register(new Emitter$1),this.onDisposeEmitter=this._register(new Emitter$1),this.visibleDisposables=this._register(new DisposableStore),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!isIOS;this._ignoreFocusOut=e&&!isIOS,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===backButton),this._rightButtons=e.filter(t=>t!==backButton&&t.location!==QuickInputButtonLocation.Inline),this._inlineButtons=e.filter(t=>t.location===QuickInputButtonLocation.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=QuickInputHideReason.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=QuickInputHideReason.Other){this.onWillHideEmitter.fire({reason:e})}update(){var s;if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?reset$1(this.ui.widget,this._widget):reset$1(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new TimeoutTimer,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this._leftButtons.map((l,c)=>quickInputButtonToAction(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(r,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const o=this._rightButtons.map((l,c)=>quickInputButtonToAction(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(o,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const a=this._inlineButtons.map((l,c)=>quickInputButtonToAction(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.inlineActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=((s=this.toggles)==null?void 0:s.filter(o=>o instanceof Toggle))??[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,reset$1(this.ui.message),renderQuickInputDescription(i,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?localize("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Severity$2.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};Uh.noPromptMessage=localize("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");let QuickInput=Uh;const Kh=class Kh extends QuickInput{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Emitter$1),this.onWillAcceptEmitter=this._register(new Emitter$1),this.onDidAcceptEmitter=this._register(new Emitter$1),this.onDidCustomEmitter=this._register(new Emitter$1),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=ItemActivation.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Emitter$1),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Emitter$1),this.onDidTriggerItemButtonEmitter=this._register(new Emitter$1),this.onDidTriggerSeparatorButtonEmitter=this._register(new Emitter$1),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new EventBufferer,this.type="quickPick",this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?NO_KEY_MODS:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(QuickPickFocus.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&equals$1(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&equals$1(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(isMouseEvent(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&equals$1(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return addDisposableListener(this.ui.container,EventType$1.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new StandardKeyboardEvent(e),i=t.keyCode;this._quickNavigate.keybindings.some(o=>{const a=o.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder||Kh.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case ItemActivation.NONE:this._itemActivation=ItemActivation.FIRST;break;case ItemActivation.SECOND:this.ui.list.focus(QuickPickFocus.Second),this._itemActivation=ItemActivation.FIRST;break;case ItemActivation.LAST:this.ui.list.focus(QuickPickFocus.Last),this._itemActivation=ItemActivation.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(QuickPickFocus.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(e??!1))}};Kh.DEFAULT_ARIA_LABEL=localize("quickInputBox.ariaLabel","Type to narrow down results.");let QuickPick=Kh,InputBox$1=class extends QuickInput{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new Emitter$1),this.onDidAcceptEmitter=this._register(new Emitter$1),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}},QuickInputHoverDelegate=class extends WorkbenchHoverDelegate{constructor(e,t){super("element",!1,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(isHTMLElement(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};QuickInputHoverDelegate=__decorate$2a([__param$28(0,IConfigurationService),__param$28(1,IHoverService)],QuickInputHoverDelegate);const button="";Color.white.toString(),Color.white.toString();class Button extends Disposable{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new Emitter$1),this._onDidEscape=this._register(new Emitter$1),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Gesture.addTarget(this._element)),[EventType$1.CLICK,EventType.Tap].forEach(r=>{this._register(addDisposableListener(this._element,r,o=>{if(!this.enabled){EventHelper.stop(o);return}this._onDidClick.fire(o)}))}),this._register(addDisposableListener(this._element,EventType$1.KEY_DOWN,r=>{const o=new StandardKeyboardEvent(r);let a=!1;this.enabled&&(o.equals(3)||o.equals(10))?(this._onDidClick.fire(r),a=!0):o.equals(9)&&(this._onDidEscape.fire(r),this._element.blur(),a=!0),a&&EventHelper.stop(o,!0)})),this._register(addDisposableListener(this._element,EventType$1.MOUSE_OVER,r=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(addDisposableListener(this._element,EventType$1.MOUSE_OUT,r=>{this.updateBackground(!1)})),this.focusTracker=this._register(trackFocus(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of renderLabelWithIcons(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var s;if(this._label===e||isMarkdownString(this._label)&&isMarkdownString(e)&&markdownStringEqual(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(isMarkdownString(e)){const r=renderMarkdown(e,{inline:!0});r.dispose();const o=(s=r.element.querySelector("p"))==null?void 0:s.innerHTML;if(o){const a=sanitize$1(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});t.innerHTML=a}else reset$1(t)}else this.options.supportIcons?reset$1(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=renderStringAsPlaintext(e)),this.setTitle(i),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",i),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...ThemeIcon.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate??getDefaultHoverDelegate("mouse"),this._element,e)):this._hover&&this._hover.update(e)}}const countBadge="";class CountBadge{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=append$1(e,$$e(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=format$1(this.countFormat,this.count),this.element.title=format$1(this.titleFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const progressbar="",CSS_DONE="done",CSS_ACTIVE="active",CSS_INFINITE="infinite",CSS_INFINITE_LONG_RUNNING="infinite-long-running",CSS_DISCRETE="discrete",jh=class jh extends Disposable{constructor(e,t){super(),this.progressSignal=this._register(new MutableDisposable),this.workedVal=0,this.showDelayedScheduler=this._register(new RunOnceScheduler(()=>show(this.element),0)),this.longRunningScheduler=this._register(new RunOnceScheduler(()=>this.infiniteLongRunning(),jh.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(CSS_ACTIVE,CSS_INFINITE,CSS_INFINITE_LONG_RUNNING,CSS_DISCRETE),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(CSS_DONE),this.element.classList.contains(CSS_INFINITE)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(CSS_DISCRETE,CSS_DONE,CSS_INFINITE_LONG_RUNNING),this.element.classList.add(CSS_ACTIVE,CSS_INFINITE),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(CSS_INFINITE_LONG_RUNNING)}getContainer(){return this.element}};jh.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let ProgressBar=jh;const NLS_CASE_SENSITIVE_TOGGLE_LABEL=localize("caseDescription","Match Case"),NLS_WHOLE_WORD_TOGGLE_LABEL=localize("wordsDescription","Match Whole Word"),NLS_REGEX_TOGGLE_LABEL=localize("regexDescription","Use Regular Expression");class CaseSensitiveToggle extends Toggle{constructor(e){super({icon:Codicon.caseSensitive,title:NLS_CASE_SENSITIVE_TOGGLE_LABEL+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??getDefaultHoverDelegate("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class WholeWordsToggle extends Toggle{constructor(e){super({icon:Codicon.wholeWord,title:NLS_WHOLE_WORD_TOGGLE_LABEL+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??getDefaultHoverDelegate("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class RegexToggle extends Toggle{constructor(e){super({icon:Codicon.regex,title:NLS_REGEX_TOGGLE_LABEL+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??getDefaultHoverDelegate("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ArrayNavigator{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class HistoryNavigator{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new ArrayNavigator(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const inputBox="",$$a=$$e;class InputBox extends Widget$1{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Emitter$1),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=append$1(e,$$a(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",r=append$1(this.element,$$a(".ibwrapper"));if(this.input=append$1(r,$$a(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=append$1(r,$$a("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new ScrollableElement(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),append$1(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const o=this._register(new DomEmitter(e.ownerDocument,"selectionchange")),a=Event$1.filter(o.event,()=>{const l=e.ownerDocument.getSelection();return(l==null?void 0:l.anchorNode)===r});this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new ActionBar(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover?this.hover.update(e):this.hover=this._register(getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"),this.input,e))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:getTotalHeight(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return isActiveElement(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&equals(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${asCssValueWithDefault(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=getTotalWidth(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{if(!this.message)return null;e=append$1(s,$$a(".monaco-inputbox-container")),t();const r={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?renderFormattedText(this.message.content,r):renderText(this.message.content,r);o.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return o.style.backgroundColor=a.background??"",o.style.color=a.foreground??"",o.style.border=a.border?`1px solid ${a.border}`:"",append$1(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=localize("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=localize("alertWarningMessage","Warning: {0}",this.message.content):i=localize("alertInfoMessage","Info: {0}",this.message.content),alert$1(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${asCssValueWithDefault(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=getTotalHeight(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,r=t.value;i!==null&&s!==null&&(this.value=r.substr(0,i)+e+r.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)==null||e.dispose(),super.dispose()}}class HistoryInputBox extends InputBox{constructor(e,t,i){const s=localize({key:"history.inputbox.hint.suffix.noparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field ends in a closing parenthesis ")", for example "Filter (e.g. text, !exclude)". The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," or {0} for history","⇅"),r=localize({key:"history.inputbox.hint.suffix.inparens",comment:['Text is the suffix of an input field placeholder coming after the action the input field performs, this will be used when the input field does NOT end in a closing parenthesis (eg. "Find"). The character inserted into the final string is ⇅ to represent the up and down arrow keys.']}," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new Emitter$1),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Emitter$1),this.onDidBlur=this._onDidBlur.event,this.history=new HistoryNavigator(i.history,100);const o=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:r,l=this.placeholder+a;i.showPlaceholderOnFocus&&!isActiveElement(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||o()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>o()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(r)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",status(this.value?this.value:localize("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,status(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const findInput="",NLS_DEFAULT_LABEL$1=localize("defaultLabel","input");class FindInput extends Widget$1{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new MutableDisposable),this.additionalToggles=[],this._onDidOptionChange=this._register(new Emitter$1),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Emitter$1),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new Emitter$1),this._onKeyUp=this._register(new Emitter$1),this._onCaseSensitiveKeyDown=this._register(new Emitter$1),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new Emitter$1),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||NLS_DEFAULT_LABEL$1,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",r=i.appendWholeWordsLabel||"",o=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new HistoryInputBox(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles}));const u=this._register(createInstantHoverDelegate());if(this.showCommonFindToggles){this.regex=this._register(new RegexToggle({appendTitle:o,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.regex.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(g=>{this._onRegexKeyDown.fire(g)})),this.wholeWords=this._register(new WholeWordsToggle({appendTitle:r,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.wholeWords.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new CaseSensitiveToggle({appendTitle:s,isChecked:!1,hoverDelegate:u,...i.toggleStyles})),this._register(this.caseSensitive.onChange(g=>{this._onDidOptionChange.fire(g),!g&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(g=>{this._onCaseSensitiveKeyDown.fire(g)}));const f=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,g=>{if(g.equals(15)||g.equals(17)||g.equals(9)){const m=f.indexOf(this.domNode.ownerDocument.activeElement);if(m>=0){let _=-1;g.equals(17)?_=(m+1)%f.length:g.equals(15)&&(m===0?_=f.length-1:_=m-1),g.equals(9)?(f[m].blur(),this.inputBox.focus()):_>=0&&f[_].focus(),EventHelper.stop(g,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(addDisposableListener(this.inputBox.inputElement,"compositionstart",f=>{this.imeSessionInProgress=!0})),this._register(addDisposableListener(this.inputBox.inputElement,"compositionend",f=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)==null||e.enable(),(t=this.wholeWords)==null||t.enable(),(i=this.caseSensitive)==null||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)==null||e.disable(),(t=this.wholeWords)==null||t.disable(),(i=this.caseSensitive)==null||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new DisposableStore;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(((t=this.caseSensitive)==null?void 0:t.width())??0)+(((i=this.wholeWords)==null?void 0:i.width())??0)+(((s=this.regex)==null?void 0:s.width())??0)+this.additionalToggles.reduce((r,o)=>r+o.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e;return((e=this.caseSensitive)==null?void 0:e.checked)??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e;return((e=this.wholeWords)==null?void 0:e.checked)??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e;return((e=this.regex)==null?void 0:e.checked)??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)==null||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const $$9=$$e;class QuickInputBox extends Disposable{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=r=>addStandardDisposableListener(this.findInput.inputBox.inputElement,EventType$1.KEY_DOWN,r),this.onDidChange=r=>this.findInput.onDidChange(r),this.container=append$1(this.parent,$$9(".quick-input-box")),this.findInput=this._register(new FindInput(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Severity$2.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Severity$2.Info?1:e===Severity$2.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Severity$2.Info?1:e===Severity$2.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class PagedRenderer{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Disposable.None}}renderElement(e,t,i,s){var l;if((l=i.disposable)==null||l.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const o=new CancellationTokenSource$1,a=r.resolve(e,o.token);i.disposable={dispose:()=>o.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class PagedAccessibilityProvider{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function fromPagedListOptions(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new PagedAccessibilityProvider(n,e.accessibilityProvider)}}class PagedList{constructor(e,t,i,s,r={}){const o=()=>this.model,a=s.map(l=>new PagedRenderer(l,o));this.list=new List(e,t,i,a,fromPagedListOptions(o,r))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Event$1.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return Event$1.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return Event$1.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,range$2(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const sash="";var __decorate$29=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};const DEBUG=!1;var OrthogonalEdge;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(OrthogonalEdge||(OrthogonalEdge={}));let globalSize=4;const onDidChangeGlobalSize=new Emitter$1;let globalHoverDelay=300;const onDidChangeHoverDelay=new Emitter$1;class MouseEventFactory{constructor(e){this.el=e,this.disposables=new DisposableStore}get onPointerMove(){return this.disposables.add(new DomEmitter(getWindow(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new DomEmitter(getWindow(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}__decorate$29([memoize],MouseEventFactory.prototype,"onPointerMove",null);__decorate$29([memoize],MouseEventFactory.prototype,"onPointerUp",null);class GestureEventFactory{get onPointerMove(){return this.disposables.add(new DomEmitter(this.el,EventType.Change)).event}get onPointerUp(){return this.disposables.add(new DomEmitter(this.el,EventType.End)).event}constructor(e){this.el=e,this.disposables=new DisposableStore}dispose(){this.disposables.dispose()}}__decorate$29([memoize],GestureEventFactory.prototype,"onPointerMove",null);__decorate$29([memoize],GestureEventFactory.prototype,"onPointerUp",null);class OrthogonalPointerEventFactory{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}__decorate$29([memoize],OrthogonalPointerEventFactory.prototype,"onPointerMove",null);__decorate$29([memoize],OrthogonalPointerEventFactory.prototype,"onPointerUp",null);const PointerEventsDisabledCssClass="pointer-events-disabled";class Sash extends Disposable{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=append$1(this.el,$$e(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(toDisposable(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Sash.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new DomEmitter(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Sash.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=append$1(this.el,$$e(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(toDisposable(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Sash.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new DomEmitter(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Sash.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=globalHoverDelay,this.hoverDelayer=this._register(new Delayer(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new Emitter$1),this._onDidStart=this._register(new Emitter$1),this._onDidChange=this._register(new Emitter$1),this._onDidReset=this._register(new Emitter$1),this._onDidEnd=this._register(new Emitter$1),this.orthogonalStartSashDisposables=this._register(new DisposableStore),this.orthogonalStartDragHandleDisposables=this._register(new DisposableStore),this.orthogonalEndSashDisposables=this._register(new DisposableStore),this.orthogonalEndDragHandleDisposables=this._register(new DisposableStore),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=append$1(e,$$e(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),isMacintosh&&this.el.classList.add("mac");const s=this._register(new DomEmitter(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new MouseEventFactory(e)),this));const r=this._register(new DomEmitter(this.el,"dblclick")).event;this._register(r(this.onPointerDoublePress,this));const o=this._register(new DomEmitter(this.el,"mouseenter")).event;this._register(o(()=>Sash.onMouseEnter(this)));const a=this._register(new DomEmitter(this.el,"mouseleave")).event;this._register(a(()=>Sash.onMouseLeave(this))),this._register(Gesture.addTarget(this.el));const l=this._register(new DomEmitter(this.el,EventType.Start)).event;this._register(l(u=>this.onPointerStart(u,new GestureEventFactory(this.el)),this));const c=this._register(new DomEmitter(this.el,EventType.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=globalSize,this._register(onDidChangeGlobalSize.event(u=>{this.size=u,this.layout()}))),this._register(onDidChangeHoverDelay.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",DEBUG),this.layout()}onPointerStart(e,t){EventHelper.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const m=this.getOrthogonalSash(e);m&&(i=!0,e.__orthogonalSashEvent=!0,m.onPointerStart(e,new OrthogonalPointerEventFactory(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new OrthogonalPointerEventFactory(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const m of s)m.classList.add(PointerEventsDisabledCssClass);const r=e.pageX,o=e.pageY,a=e.altKey,l={startX:r,currentX:r,startY:o,currentY:o,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=createStyleSheet(this.el),d=()=>{let m="";i?m="all-scroll":this.orientation===1?this.state===1?m="s-resize":this.state===2?m="n-resize":m=isMacintosh?"row-resize":"ns-resize":this.state===1?m="e-resize":this.state===2?m="w-resize":m=isMacintosh?"col-resize":"ew-resize",c.textContent=`* { cursor: ${m} !important; }`},u=new DisposableStore;d(),i||this.onDidEnablementChange.event(d,null,u);const f=m=>{EventHelper.stop(m,!1);const _={startX:r,currentX:m.pageX,startY:o,currentY:m.pageY,altKey:a};this._onDidChange.fire(_)},g=m=>{EventHelper.stop(m,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const _ of s)_.classList.remove(PointerEventsDisabledCssClass)};t.onPointerMove(f,null,u),t.onPointerUp(g,null,u),u.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Sash.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Sash.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Sash.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!isHTMLElement(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const splitview="",defaultStyles={separatorBorder:Color.transparent};class ViewItem{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;if(e!==this.visible){e?(this.size=clamp(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(s=(i=this.view).setVisible)==null||s.call(i,e)}catch(r){console.error("Splitview: Failed to set visible view"),console.error(r)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class VerticalViewItem extends ViewItem{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class HorizontalViewItem extends ViewItem{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var State;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(State||(State={}));var Sizing;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(Sizing||(Sizing={}));class SplitView extends Disposable{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=State.Idle,this._onDidSashChange=this._register(new Emitter$1),this._onDidSashReset=this._register(new Emitter$1),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=append$1(this.el,$$e(".sash-container")),this.viewContainer=$$e(".split-view-container"),this.scrollable=this._register(new Scrollable({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>scheduleAtNextAnimationFrame(getWindow(this.el),s)})),this.scrollableElement=this._register(new SmoothScrollableElement(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new DomEmitter(this.viewContainer,"scroll")).event;this._register(i(s=>{const r=this.scrollableElement.getScrollPosition(),o=Math.abs(this.viewContainer.scrollLeft-r.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-r.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(o!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:o,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),append$1(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||defaultStyles),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,r)=>{const o=isUndefined$1(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,o,r,!0)}),this._contentSize=this.viewItems.reduce((s,r)=>s+r.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let r=0;r0&&(o.size=clamp(Math.round(a*e/s),o.minimumSize,o.maximumSize))}}else{const s=range$2(this.viewItems.length),r=s.filter(a=>this.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,r,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),r=combinedDisposable(addDisposableListener(this.el.ownerDocument.body,"keydown",a=>o(this.sashDragState.current,a.altKey)),addDisposableListener(this.el.ownerDocument.body,"keyup",()=>o(this.sashDragState.current,!1))),o=(a,l)=>{const c=this.viewItems.map(m=>m.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const _=this.viewItems[s];d=(_.minimumSize-_.size)/2,u=(_.maximumSize-_.size)/2}else{const _=this.viewItems[s+1];d=(_.size-_.maximumSize)/2,u=(_.size-_.minimumSize)/2}let f,g;if(!l){const m=range$2(s,-1),_=range$2(s+1,this.viewItems.length),v=m.reduce((T,A)=>T+(this.viewItems[A].minimumSize-c[A]),0),C=m.reduce((T,A)=>T+(this.viewItems[A].viewMaximumSize-c[A]),0),S=_.length===0?Number.POSITIVE_INFINITY:_.reduce((T,A)=>T+(c[A]-this.viewItems[A].minimumSize),0),w=_.length===0?Number.NEGATIVE_INFINITY:_.reduce((T,A)=>T+(c[A]-this.viewItems[A].viewMaximumSize),0),L=Math.max(v,w),I=Math.min(S,C),N=this.findFirstSnapIndex(m),R=this.findFirstSnapIndex(_);if(typeof N=="number"){const T=this.viewItems[N],A=Math.floor(T.viewMinimumSize/2);f={index:N,limitDelta:T.visible?L-A:L+A,size:T.size}}if(typeof R=="number"){const T=this.viewItems[R],A=Math.floor(T.viewMinimumSize/2);g={index:R,limitDelta:T.visible?I+A:I-A,size:T.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:f,snapAfter:g,disposable:r}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:r,minDelta:o,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,s,void 0,void 0,o,a,l,c);if(r){const f=t===this.sashItems.length-1,g=this.viewItems.map(w=>w.size),m=f?t:t+1,_=this.viewItems[m],v=_.size-_.maximumSize,C=_.size-_.minimumSize,S=f?t-1:t+1;this.resize(S,-u,g,void 0,void 0,v,C)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=clamp(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==State.Idle)throw new Error("Cant modify splitview");this.state=State.Busy;try{const i=range$2(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],r=i.filter(a=>this.viewItems[a].priority===2),o=this.viewItems[e];t=Math.round(t),t=clamp(t,o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(s,r)}finally{this.state=State.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=clamp(i,a.minimumSize,a.maximumSize);const s=range$2(this.viewItems.length),r=s.filter(a=>this.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);this.relayout(r,o)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==State.Idle)throw new Error("Cant modify splitview");this.state=State.Busy;try{const r=$$e(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(i));const o=e.onDidChange(f=>this.onViewChange(d,f)),a=toDisposable(()=>r.remove()),l=combinedDisposable(o,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new VerticalViewItem(r,e,c,l):new HorizontalViewItem(r,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const f={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},g=this.orientation===0?new Sash(this.sashContainer,{getHorizontalSashTop:T=>this.getSashPosition(T),getHorizontalSashWidth:this.getSashOrthogonalSize},{...f,orientation:1}):new Sash(this.sashContainer,{getVerticalSashLeft:T=>this.getSashPosition(T),getVerticalSashHeight:this.getSashOrthogonalSize},{...f,orientation:0}),m=this.orientation===0?T=>({sash:g,start:T.startY,current:T.currentY,alt:T.altKey}):T=>({sash:g,start:T.startX,current:T.currentX,alt:T.altKey}),v=Event$1.map(g.onDidStart,m)(this.onSashStart,this),S=Event$1.map(g.onDidChange,m)(this.onSashChange,this),L=Event$1.map(g.onDidEnd,()=>this.sashItems.findIndex(T=>T.sash===g))(this.onSashEnd,this),I=g.onDidReset(()=>{const T=this.sashItems.findIndex(G=>G.sash===g),A=range$2(T,-1),F=range$2(T+1,this.viewItems.length),B=this.findFirstSnapIndex(A),W=this.findFirstSnapIndex(F);typeof B=="number"&&!this.viewItems[B].visible||typeof W=="number"&&!this.viewItems[W].visible||this._onDidSashReset.fire(T)}),N=combinedDisposable(v,S,L,I,g),R={sash:g,disposable:N};this.sashItems.splice(i-1,0,R)}r.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=State.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,r)=>s+r.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,r,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=range$2(e,-1),u=range$2(e+1,this.viewItems.length);if(r)for(const R of r)pushToStart(d,R),pushToStart(u,R);if(s)for(const R of s)pushToEnd(d,R),pushToEnd(u,R);const f=d.map(R=>this.viewItems[R]),g=d.map(R=>i[R]),m=u.map(R=>this.viewItems[R]),_=u.map(R=>i[R]),v=d.reduce((R,T)=>R+(this.viewItems[T].minimumSize-i[T]),0),C=d.reduce((R,T)=>R+(this.viewItems[T].maximumSize-i[T]),0),S=u.length===0?Number.POSITIVE_INFINITY:u.reduce((R,T)=>R+(i[T]-this.viewItems[T].minimumSize),0),w=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((R,T)=>R+(i[T]-this.viewItems[T].maximumSize),0),L=Math.max(v,w,o),I=Math.min(S,C,a);let N=!1;if(l){const R=this.viewItems[l.index],T=t>=l.limitDelta;N=T!==R.visible,R.setVisible(T,l.size)}if(!N&&c){const R=this.viewItems[c.index],T=ta+l.size,0);let i=this.size-t;const s=range$2(this.viewItems.length-1,-1),r=s.filter(a=>this.viewItems[a].priority===1),o=s.filter(a=>this.viewItems[a].priority===2);for(const a of o)pushToStart(s,a);for(const a of r)pushToEnd(s,a);typeof e=="number"&&pushToEnd(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const r=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const o=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:S&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)==null||e.disposable.dispose(),dispose(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}const table="",qh=class qh{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=qh.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(r=>[r.templateId,r]));this.renderers=[];for(const r of e){const o=s.get(r.templateId);if(!o)throw new Error(`Table cell renderer for template id ${r.templateId} not found.`);this.renderers.push(o)}}renderTemplate(e){const t=append$1(e,$$e(".monaco-table-tr")),i=[],s=[];for(let o=0;othis.disposables.add(new ColumnHeader(d,u))),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new SplitView(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new TableListRenderer(s,r,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new List(e,this.domNode,asListVirtualDelegate(i),[c],o)),Event$1.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=s.reduce((g,m)=>g+m.weight,0),f=s[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,f)},null,this.disposables),this.styleElement=createStyleSheet(this.domNode),this.style(unthemedListStyles)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { + top: ${this.virtualDelegate.headerRowHeight+1}px; + height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); + }`),this.styleElement.textContent=t.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};Gh.InstanceCount=0;let Table=Gh;var ObjectTreeElementCollapseState;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(ObjectTreeElementCollapseState||(ObjectTreeElementCollapseState={}));var TreeMouseEventTarget;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(TreeMouseEventTarget||(TreeMouseEventTarget={}));class TreeError extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class WeakMapper{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function isFilterResult(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function getVisibleState(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function isCollapsibleStateUpdate(n){return typeof n.collapsible=="boolean"}class IndexTreeModel{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new EventBufferer,this._onDidChangeCollapseState=new Emitter$1,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Emitter$1,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Emitter$1,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Delayer(MicrotaskDelay),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.allowNonCollapsibleParents=s.allowNonCollapsibleParents??!1,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Iterable.empty(),s={}){if(e.length===0)throw new TreeError(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=Iterable.empty(),r,o=r.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,r);const l=[...s],c=t[t.length-1],d=new LcsDiff({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,r);const u=t.slice(0,-1),f=(_,v,C)=>{if(o>0)for(let S=0;SC.originalStart-v.originalStart))f(g,m,g-(_.originalStart+_.originalLength)),g=_.originalStart,m=_.modifiedStart-c,this.spliceSimple([...u,g],_.originalLength,Iterable.slice(l,m,m+_.modifiedLength),r);f(g,m,g)}spliceSimple(e,t,i=Iterable.empty(),{onDidCreateNode:s,onDidDeleteNode:r,diffIdentityProvider:o}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],f=Iterable.map(i,I=>this.createTreeNode(I,a,a.visible?1:0,c,u,s)),g=e[e.length-1];let m=0;for(let I=g;I>=0&&Io.getId(I.element).toString())):a.lastDiffIds=a.children.map(I=>o.getId(I.element).toString()):a.lastDiffIds=void 0;let w=0;for(const I of S)I.visible&&w++;if(w!==0)for(let I=g+_.length;IN+(R.visible?R.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,C-I),this.list.splice(l,I,u)}if(S.length>0&&r){const I=N=>{r(N),N.children.forEach(I)};S.forEach(I)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:S});let L=a;for(;L;){if(L.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}L=L.parent}}rerender(e){if(e.length===0)throw new TreeError(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const r={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:r}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,s,r,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!isCollapsibleStateUpdate(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return o}_setListNodeCollapseState(e,t,i,s){const r=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!r)return r;const o=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=o-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),r}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(isCollapsibleStateUpdate(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!isCollapsibleStateUpdate(t)&&t.recursive)for(const r of e.children)s=this._setNodeCollapseState(r,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,r,o){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&r.push(a);const c=e.children||Iterable.empty(),d=s&&l!==0&&!a.collapsed;let u=0,f=1;for(const g of c){const m=this.createTreeNode(g,a,l,d,r,o);a.children.push(m),f+=m.renderNodeCount,m.visible&&(m.visibleChildIndex=u++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=f):(a.renderNodeCount=0,s&&r.pop()),o==null||o(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let r;if(e!==this.root){if(r=this._filterNode(e,t),r===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||r!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,r,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=r===2?a:r===1,e.visibility=r),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):isFilterResult(i)?(e.filterData=i.data,getVisibleState(i.visibility)):(e.filterData=void 0,getVisibleState(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new TreeError(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:r}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new TreeError(this.user,"Invalid tree location");const a=t.children[o];return{node:a,listIndex:i,revealed:s,visible:r&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,r=!0){const[o,...a]=e;if(o<0||o>t.children.length)throw new TreeError(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function asTreeDragAndDropData(n){return n instanceof ElementsDragAndDropData?new TreeElementsDragAndDropData(n):n}class TreeNodeListDragAndDrop{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Disposable.None,this.disposables=new DisposableStore}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,asTreeDragAndDropData(e),t)}onDragOver(e,t,i,s,r,o=!0){const a=this.dnd.onDragOver(asTreeDragAndDropData(e),t&&t.element,i,s,r),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=disposableTimeout(()=>{const g=this.modelProvider(),m=g.getNodeLocation(t);g.isCollapsed(m)&&g.setCollapsed(m,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!o){const g=typeof a=="boolean"?a:a.accept,m=typeof a=="boolean"?void 0:a.effect;return{accept:g,effect:m,feedback:[i]}}return a}if(a.bubble===1){const g=this.modelProvider(),m=g.getNodeLocation(t),_=g.getParentNodeLocation(m),v=g.getNode(_),C=_&&g.getListIndex(_);return this.onDragOver(e,v,C,s,r,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),u=c.getListIndex(d),f=c.getListRenderCount(d);return{...a,feedback:range$2(u,u+f)}}drop(e,t,i,s,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(asTreeDragAndDropData(e),t&&t.element,i,s,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function asListOptions(n,e){return e&&{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new TreeNodeListDragAndDrop(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element})},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})}},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getSetSize(t){const i=n(),s=i.getNodeLocation(t),r=i.getParentNodeLocation(s);return i.getNode(r).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}}}class ComposedTreeDelegate{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)==null||s.call(i,e.element,t)}}var RenderIndentGuides;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(RenderIndentGuides||(RenderIndentGuides={}));class EventCollection{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new DisposableStore,this.onDidChange=Event$1.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const zd=class zd{constructor(e,t,i,s,r,o={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=r,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=zd.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Disposable.None,this.disposables=new DisposableStore,this.templateId=e.templateId,this.updateOptions(o),Event$1.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)==null||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=clamp(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==RenderIndentGuides.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new DisposableStore;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=append$1(e,$$e(".monaco-tl-row")),i=append$1(t,$$e(".monaco-tl-indent")),s=append$1(t,$$e(".monaco-tl-twistie")),r=append$1(t,$$e(".monaco-tl-contents")),o=this.renderer.renderTemplate(r);return{container:e,indent:i,twistie:s,indentGuidesDisposable:Disposable.None,templateData:o}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){var r,o;i.indentGuidesDisposable.dispose(),(o=(r=this.renderer).disposeElement)==null||o.call(r,e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=zd.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(clearNode(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new DisposableStore,s=this.modelProvider();for(;;){const r=s.getNodeLocation(e),o=s.getParentNodeLocation(r);if(!o)break;const a=s.getNode(o),l=$$e(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(toDisposable(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const r=i.getNodeLocation(s);try{const o=i.getParentNodeLocation(r);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):o&&t.add(i.getNode(o))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,r=>r.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,r=>r.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),dispose(this.disposables)}};zd.DefaultIndent=8;let TreeRenderer=zd;class FindFilter{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new DisposableStore,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const o=this._filter.filter(e,t);if(typeof o=="boolean"?i=o?1:0:isFilterResult(o)?i=getVisibleState(o.visibility):i=o,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:FuzzyScore.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),r=Array.isArray(s)?s:[s];for(const o of r){const a=o&&o.toString();if(typeof a>"u")return{data:FuzzyScore.Default,visibility:i};let l;if(this.tree.findMatchType===TreeFindMatchType.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=fuzzyScore(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,r.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===TreeFindMode.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:FuzzyScore.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){dispose(this.disposables)}}var TreeFindMode;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(TreeFindMode||(TreeFindMode={}));var TreeFindMatchType;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(TreeFindMatchType||(TreeFindMatchType={}));let FindController$1=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,r,o={}){this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=r,this.options=o,this._pattern="",this.width=0,this._onDidChangeMode=new Emitter$1,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new Emitter$1,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new Emitter$1,this._onDidChangeOpenState=new Emitter$1,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new DisposableStore,this.disposables=new DisposableStore,this._mode=e.options.defaultFindMode??TreeFindMode.Highlight,this._matchType=e.options.defaultFindMatchType??TreeFindMatchType.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var t,i,s;const e=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&e?(alert$1(localize("replFindNoResults","No results")),this.tree.options.showNotFoundMessage??!0?(t=this.widget)==null||t.showMessage({type:2,content:localize("not found","No elements found.")}):(i=this.widget)==null||i.showMessage({type:2})):((s=this.widget)==null||s.clearMessage(),this.pattern&&alert$1(localize("replFindResults","{0} results",this.filter.matchCount)))}shouldAllowFocus(e){return!this.widget||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!FuzzyScore.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)==null||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function stickyScrollNodeStateEquals(n,e){return n.position===e.position&&stickyScrollNodeEquals(n,e)}function stickyScrollNodeEquals(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class StickyScrollState{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return equals$1(this.stickyNodes,e.stickyNodes,stickyScrollNodeStateEquals)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!equals$1(this.stickyNodes,e.stickyNodes,stickyScrollNodeEquals)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class DefaultStickyScrollDelegate{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let StickyScrollController$1=class extends Disposable{constructor(e,t,i,s,r,o={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=r,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(o);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=o.stickyScrollDelegate??new DefaultStickyScrollDelegate,this._widget=this._register(new StickyScrollWidget$1(i.getScrollableElement(),i,e,s,r,o.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(e===0?t=this.view.firstVisibleIndex:t=this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(0);if(!e||this.tree.scrollTop===0){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,r=this.getNextStickyNode(i,void 0,s);for(;r&&(t.push(r),s+=r.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(r),!i)));)r=this.getNextStickyNode(i,r.node,s);const o=this.constrainStickyNodes(t);return o.length?new StickyScrollState(o):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),r=t;return this.view.scrollTop===s-r}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:r}=this.getNodeRange(e),o=this.calculateStickyNodePosition(r,t,i);return{node:e,position:o,height:i,startIndex:s,endIndex:r}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const r=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||r.position+r.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),r=i+s-1;return{startIndex:i,endIndex:r}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let r=0;r0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];if(this._previousState&&e.animationStateChanged(this._previousState))this._previousElements[this._previousState.count-1].style.top=`${s.position}px`;else{this._previousStateDisposables.clear();const r=Array(e.count);for(let o=e.count-1;o>=0;o--){const a=e.stickyNodes[o],{element:l,disposable:c}=this.createElement(a,o,e.count);r[o]=l,this._rootDomNode.appendChild(l),this._previousStateDisposables.add(c)}this.stickyScrollFocus.updateElements(r,e),this._previousElements=r}this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}createElement(e,t,i){const s=e.startIndex,r=document.createElement("div");r.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(r.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(r.style.lineHeight=`${e.height}px`),r.classList.add("monaco-tree-sticky-row"),r.classList.add("monaco-list-row"),r.setAttribute("data-index",`${s}`),r.setAttribute("data-parity",s%2===0?"even":"odd"),r.setAttribute("id",this.view.getElementID(s));const o=this.setAccessibilityAttributes(r,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(f=>f.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(r);l.renderElement(c,e.startIndex,d,e.height);const u=toDisposable(()=>{o.dispose(),l.disposeElement(c,e.startIndex,d,e.height),l.disposeTemplate(d),r.remove()});return{element:r,disposable:u}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return Disposable.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const r=this.accessibilityProvider.getAriaLabel(t),o=r&&typeof r!="string"?r:constObservable(r),a=autorun(c=>{const d=c.readObservable(o);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof r=="string"||r&&e.setAttribute("aria-label",r.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class StickyScrollFocus extends Disposable{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new Emitter$1,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new Emitter$1,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(addDisposableListener(this.container,"focus",()=>this.onFocus())),this._register(addDisposableListener(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!isStickyScrollContainer(t)&&!isStickyScrollElement(t)){this.focusedLast()&&this.view.domFocus();return}if(!isKeyboardEvent$1(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const o=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)==null?void 0:l.element)});if(o===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(o);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,r=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:r,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!isStickyScrollContainer(t)&&!isStickyScrollElement(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=clamp(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,r=this.view.getElementTop(e),o=s?s.position+s.height+i.height:i.height;this.view.scrollTop=r-o}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function asTreeMouseEvent$1(n){let e=TreeMouseEventTarget.Unknown;return hasParentWithClass(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=TreeMouseEventTarget.Twistie:hasParentWithClass(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=TreeMouseEventTarget.Element:hasParentWithClass(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=TreeMouseEventTarget.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function asTreeContextMenuEvent(n){const e=isStickyScrollContainer(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function dfs$1(n,e){e(n),n.children.forEach(t=>dfs$1(t,e))}class Trait{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&equals$1(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>dfs$1(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>dfs$1(l,s));const r=new Map,o=l=>r.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>dfs$1(l,o));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=r.get(c);u&&u.visible&&a.push(u)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class TreeNodeListMouseController extends MouseController{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(isButton(e.browserEvent.target)||isInputElement(e.browserEvent.target)||isMonacoEditor(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,r=isStickyScrollElement(e.browserEvent.target);let o=!1;if(r?o=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,r)this.handleStickyScrollMouseEvent(e,t);else{if(o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!r||s)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s){e.browserEvent.isHandledByList=!0;return}}r||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(isMonacoCustomToggle(e.browserEvent.target)||isActionItem(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),r=this.list.getElementTop(s),o=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=r-o,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!isStickyScrollContainer(t)&&!isStickyScrollElement(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!isStickyScrollContainer(t)&&!isStickyScrollElement(t)){super.onContextMenu(e);return}}}class TreeNodeList extends List{constructor(e,t,i,s,r,o,a,l){super(e,t,i,s,l),this.focusTrait=r,this.selectionTrait=o,this.anchorTrait=a}createMouseController(e){return new TreeNodeListMouseController(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],r=[];let o;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&r.push(e+l),this.anchorTrait.has(a)&&(o=e+l)}),s.length>0&&super.setFocus(distinct([...super.getFocus(),...s])),r.length>0&&super.setSelection(distinct([...super.getSelection(),...r])),typeof o=="number"&&super.setAnchor(o)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class AbstractTree{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Event$1.filter(Event$1.map(this.view.onMouseDblClick,asTreeMouseEvent$1),e=>e.target!==TreeMouseEventTarget.Filter)}get onMouseOver(){return Event$1.map(this.view.onMouseOver,asTreeMouseEvent$1)}get onMouseOut(){return Event$1.map(this.view.onMouseOut,asTreeMouseEvent$1)}get onContextMenu(){var e;return Event$1.any(Event$1.filter(Event$1.map(this.view.onContextMenu,asTreeContextMenuEvent),t=>!t.isStickyScroll),((e=this.stickyScrollController)==null?void 0:e.onContextMenu)??Event$1.None)}get onPointer(){return Event$1.map(this.view.onPointer,asTreeMouseEvent$1)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Event$1.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e;return((e=this.findController)==null?void 0:e.mode)??TreeFindMode.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e;return((e=this.findController)==null?void 0:e.matchType)??TreeFindMatchType.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,r={}){this._user=e,this._options=r,this.eventBufferer=new EventBufferer,this.onDidChangeFindOpenState=Event$1.None,this.onDidChangeStickyScrollFocused=Event$1.None,this.disposables=new DisposableStore,this._onWillRefilter=new Emitter$1,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Emitter$1,this.treeDelegate=new ComposedTreeDelegate(i);const o=new Relay,a=new Relay,l=this.disposables.add(new EventCollection(a.event)),c=new SetMap;this.renderers=s.map(m=>new TreeRenderer(m,()=>this.model,o.event,l,c,r));for(const m of this.renderers)this.disposables.add(m);let d;r.keyboardNavigationLabelProvider&&(d=new FindFilter(this,r.keyboardNavigationLabelProvider,r.filter),r={...r,filter:d},this.disposables.add(d)),this.focus=new Trait(()=>this.view.getFocusedElements()[0],r.identityProvider),this.selection=new Trait(()=>this.view.getSelectedElements()[0],r.identityProvider),this.anchor=new Trait(()=>this.view.getAnchorElement(),r.identityProvider),this.view=new TreeNodeList(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...asListOptions(()=>this.model,r),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.model=this.createModel(e,this.view,r),o.input=this.model.onDidChangeCollapseState;const u=Event$1.forEach(this.model.onDidSplice,m=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(m),this.selection.onDidModelSplice(m)})},this.disposables);u(()=>null,null,this.disposables);const f=this.disposables.add(new Emitter$1),g=this.disposables.add(new Delayer(0));if(this.disposables.add(Event$1.any(u,this.focus.onDidChange,this.selection.onDidChange)(()=>{g.trigger(()=>{const m=new Set;for(const _ of this.focus.getNodes())m.add(_);for(const _ of this.selection.getNodes())m.add(_);f.fire([...m.values()])})})),a.input=f.event,r.keyboardSupport!==!1){const m=Event$1.chain(this.view.onKeyDown,_=>_.filter(v=>!isInputElement(v.target)).map(v=>new StandardKeyboardEvent(v)));Event$1.chain(m,_=>_.filter(v=>v.keyCode===15))(this.onLeftArrow,this,this.disposables),Event$1.chain(m,_=>_.filter(v=>v.keyCode===17))(this.onRightArrow,this,this.disposables),Event$1.chain(m,_=>_.filter(v=>v.keyCode===10))(this.onSpace,this,this.disposables)}if((r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider){const m=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new FindController$1(this,this.model,this.view,d,r.contextViewProvider,m),this.focusNavigationFilter=_=>this.findController.shouldAllowFocus(_),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=Event$1.None,this.onDidChangeFindMatchType=Event$1.None;r.enableStickyScroll&&(this.stickyScrollController=new StickyScrollController$1(this,this.model,this.view,this.renderers,this.treeDelegate,r),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=createStyleSheet(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===RenderIndentGuides.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)==null||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===RenderIndentGuides.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new StickyScrollController$1(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=Event$1.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)==null||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;(e=this.stickyScrollController)!=null&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),isNumber$3(t)&&((i=this.findController)==null||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const r=asCssValueWithDefault(e.listFocusAndSelectionOutline,asCssValueWithDefault(e.listSelectionOutline,e.listFocusOutline??""));r&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(r=>this.model.getNode(r));this.selection.set(i,t);const s=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setSelection(s,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(r=>this.model.getNode(r));this.focus.set(i,t);const s=e.map(r=>this.model.getListIndex(r)).filter(r=>r>-1);this.view.setFocus(s,t,!0)})}focusNext(e=1,t=!1,i,s=isKeyboardEvent$1(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}focusPrevious(e=1,t=!1,i,s=isKeyboardEvent$1(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,s)}focusNextPage(e,t=isKeyboardEvent$1(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=isKeyboardEvent$1(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i;return((i=this.stickyScrollController)==null?void 0:i.height)??0})}focusLast(e,t=isKeyboardEvent$1(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=isKeyboardEvent$1(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const s=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,s)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const o=this.model.getParentNodeLocation(s);if(!o)return;const a=this.model.getListIndex(o);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[o]=this.view.getFocus(),a=o+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),r=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,r)}dispose(){var e;dispose(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose()}}class ObjectTreeModel{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new IndexTreeModel(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,r){return i.sorter.compare(s.element,r.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Iterable.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=Iterable.empty(),i){const s=new Set,r=new Set,o=l=>{var d;if(l.element===null)return;const c=l;if(s.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const u=this.identityProvider.getId(c.element).toString();r.add(u),this.nodesByIdentity.set(u,c)}(d=i.onDidCreateNode)==null||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(s.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const u=this.identityProvider.getId(c.element).toString();r.has(u)||this.nodesByIdentity.delete(u)}(d=i.onDidDeleteNode)==null||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:o,onDidDeleteNode:a})}preserveCollapseState(e=Iterable.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Iterable.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const o=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(o)}if(!i){let o;return typeof t.collapsed>"u"?o=void 0:t.collapsed===ObjectTreeElementCollapseState.Collapsed||t.collapsed===ObjectTreeElementCollapseState.PreserveOrCollapsed?o=!0:t.collapsed===ObjectTreeElementCollapseState.Expanded||t.collapsed===ObjectTreeElementCollapseState.PreserveOrExpanded?o=!1:o=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:o}}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let r;return typeof t.collapsed>"u"||t.collapsed===ObjectTreeElementCollapseState.PreserveOrCollapsed||t.collapsed===ObjectTreeElementCollapseState.PreserveOrExpanded?r=i.collapsed:t.collapsed===ObjectTreeElementCollapseState.Collapsed?r=!0:t.collapsed===ObjectTreeElementCollapseState.Expanded?r=!1:r=!!t.collapsed,{...t,collapsible:s,collapsed:r,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new TreeError(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function noCompress(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Iterable.map(Iterable.from(n.children),noCompress),collapsible:n.collapsible,collapsed:n.collapsed}}function compress(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=Iterable.consume(Iterable.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Iterable.map(Iterable.concat(s,i),compress),collapsible:n.collapsible,collapsed:n.collapsed}}function _decompress(n,e=0){let t;return e_decompress(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function decompress(n){return _decompress(n,0)}function splice(n,e,t){return n.element===e?{...n,children:t}:{...n,children:Iterable.map(Iterable.from(n.children),i=>splice(i,e,t))}}const wrapIdentityProvider=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class CompressedObjectTreeModel{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ObjectTreeModel(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=Iterable.empty(),i){const s=i.diffIdentityProvider&&wrapIdentityProvider(i.diffIdentityProvider);if(e===null){const m=Iterable.map(t,this.enabled?compress:noCompress);this._setChildren(null,m,{diffIdentityProvider:s,diffDepth:1/0});return}const r=this.nodes.get(e);if(!r)throw new TreeError(this.user,"Unknown compressed tree node");const o=this.model.getNode(r),a=this.model.getParentNodeLocation(r),l=this.model.getNode(a),c=decompress(o),d=splice(c,e,t),u=(this.enabled?compress:noCompress)(d),f=i.diffIdentityProvider?(m,_)=>i.diffIdentityProvider.getId(m)===i.diffIdentityProvider.getId(_):void 0;if(equals$1(u.element.elements,o.element.elements,f)){this._setChildren(r,u.children||Iterable.empty(),{diffIdentityProvider:s,diffDepth:1});return}const g=l.children.map(m=>m===o?u:m);this._setChildren(l.element,g,{diffIdentityProvider:s,diffDepth:o.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=Iterable.map(i,decompress),r=Iterable.map(s,e?compress:noCompress);this._setChildren(null,r,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,r=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},o=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:r,onDidDeleteNode:o})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new TreeError(this.user,`Tree element not found: ${e}`);return t}}const DefaultElementMapper=n=>n[n.length-1];class CompressedTreeNodeWrapper{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new CompressedTreeNodeWrapper(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function mapList(n,e){return{splice(t,i,s){e.splice(t,i,s.map(r=>n.map(r)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function mapOptions(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}}}class CompressibleObjectTreeModel{get onDidSplice(){return Event$1.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return Event$1.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Event$1.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||DefaultElementMapper;const s=r=>this.elementMapper(r.elements);this.nodeMapper=new WeakMapper(r=>new CompressedTreeNodeWrapper(s,r)),this.model=new CompressedObjectTreeModel(e,mapList(this.nodeMapper,t),mapOptions(s,i))}setChildren(e,t=Iterable.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var __decorate$28=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class ObjectTree extends AbstractTree{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,r={}){super(e,t,i,s,r),this.user=e}setChildren(e,t=Iterable.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new ObjectTreeModel(e,t,i)}}class CompressibleRenderer{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){let r=this.stickyScrollDelegate.getCompressedNode(e);r||(r=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),r.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=r,this.renderer.renderCompressedElements(r,t,i.data,s))}disposeElement(e,t,i,s){var r,o,a,l;i.compressedTreeNode?(o=(r=this.renderer).disposeCompressedElements)==null||o.call(r,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)==null||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}__decorate$28([memoize],CompressibleRenderer.prototype,"compressedTreeNodeProvider",null);class CompressibleStickyScrollDelegate{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let s=0;si||s>=t-1&&tthis,a=new CompressibleStickyScrollDelegate(()=>this.model),l=s.map(c=>new CompressibleRenderer(o,a,c));super(e,t,i,l,{...asObjectTreeOptions$1(o,r),stickyScrollDelegate:a})}setChildren(e,t=Iterable.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new CompressibleObjectTreeModel(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function createAsyncDataTreeNode(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function isAncestor(n,e){return e.parent?e.parent===n?!0:isAncestor(n,e.parent):!1}function intersects(n,e){return n===e||isAncestor(n,e)||isAncestor(e,n)}class AsyncDataTreeNodeWrapper{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new AsyncDataTreeNodeWrapper(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class AsyncDataTreeRenderer{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)),!0):(t.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)),!1)}disposeElement(e,t,i,s){var r,o;(o=(r=this.renderer).disposeElement)==null||o.call(r,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function asTreeEvent(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function asTreeMouseEvent(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class AsyncDataTreeElementsDragAndDropData extends ElementsDragAndDropData{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function asAsyncDataTreeDragAndDropData(n){return n instanceof ElementsDragAndDropData?new AsyncDataTreeElementsDragAndDropData(n):n}class AsyncDataTreeNodeListDragAndDrop{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,asAsyncDataTreeDragAndDropData(e),t)}onDragOver(e,t,i,s,r,o=!0){return this.dnd.onDragOver(asAsyncDataTreeDragAndDropData(e),t&&t.element,i,s,r)}drop(e,t,i,s,r){this.dnd.drop(asAsyncDataTreeDragAndDropData(e),t&&t.element,i,s,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.dnd.dispose()}}function asObjectTreeOptions(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new AsyncDataTreeNodeListDragAndDrop(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!((t=n.accessibilityProvider)!=null&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)}}function dfs(n,e){e(n),n.children.forEach(t=>dfs(t,e))}class AsyncDataTree{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return Event$1.map(this.tree.onDidChangeFocus,asTreeEvent)}get onDidChangeSelection(){return Event$1.map(this.tree.onDidChangeSelection,asTreeEvent)}get onMouseDblClick(){return Event$1.map(this.tree.onMouseDblClick,asTreeMouseEvent)}get onPointer(){return Event$1.map(this.tree.onPointer,asTreeMouseEvent)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,r,o={}){this.user=e,this.dataSource=r,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Emitter$1,this._onDidChangeNodeSlowState=new Emitter$1,this.nodeMapper=new WeakMapper(a=>new AsyncDataTreeNodeWrapper(a)),this.disposables=new DisposableStore,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=typeof o.autoExpandSingleChildren>"u"?!1:o.autoExpandSingleChildren,this.sorter=o.sorter,this.getDefaultCollapseState=a=>o.collapseByDefault?o.collapseByDefault(a)?ObjectTreeElementCollapseState.PreserveOrCollapsed:ObjectTreeElementCollapseState.PreserveOrExpanded:void 0,this.tree=this.createTree(e,t,i,s,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType,this.root=createAsyncDataTreeNode({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,r){const o=new ComposedTreeDelegate(i),a=s.map(c=>new AsyncDataTreeRenderer(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=asObjectTreeOptions(r)||{};return new ObjectTree(e,t,o,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}async _updateChildren(e=this.root.element,t=!0,i=!1,s,r){if(typeof this.root.element>"u")throw new TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Event$1.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(await this.refreshAndRenderNode(o,t,s,r),i)try{this.tree.rerender(o)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new TreeError(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Event$1.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await this.root.refreshPromise,await Event$1.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await this.root.refreshPromise,await Event$1.toPromise(this._onDidRender.event)),s}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new TreeError(this.user,`Data tree node not found: ${e}`);return t}async refreshAndRenderNode(e,t,i,s){await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,s)}async refreshNode(e,t,i){let s;if(this.subTreeRefreshPromises.forEach((r,o)=>{!s&&intersects(o,e)&&(s=r.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let s;e.refreshPromise=new Promise(r=>s=r),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const r=await this.doRefreshNode(e,t,i);e.stale=!1,await Promises.settled(r.map(o=>this.doRefreshSubTree(o,t,i)))}finally{s()}}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Iterable.empty());else{const r=this.doGetChildren(e);if(isIterable(r))s=Promise.resolve(r);else{const o=timeout(800);o.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=r.finally(()=>o.cancel())}}try{const r=await s;return this.setChildren(e,r,t,i)}catch(r){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),isCancellationError(r))return[];throw r}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return isIterable(i)?this.processChildren(i):(t=createCancelablePromise(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(onUnexpectedError))}setChildren(e,t,i,s){const r=[...t];if(e.children.length===0&&r.length===0)return[];const o=new Map,a=new Map;for(const d of e.children)o.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=r.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const _=createAsyncDataTreeNode({element:d,parent:e,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(d)});return u&&_.defaultCollapseState===ObjectTreeElementCollapseState.PreserveOrExpanded&&l.push(_),_}const f=this.identityProvider.getId(d).toString(),g=a.get(f);if(g){const _=g.node;return o.delete(_.element),this.nodes.delete(_.element),this.nodes.set(d,_),_.element=d,_.hasChildren=u,i?g.collapsed?(_.children.forEach(v=>dfs(v,C=>this.nodes.delete(C.element))),_.children.splice(0,_.children.length),_.stale=!0):l.push(_):u&&!g.collapsed&&l.push(_),_}const m=createAsyncDataTreeNode({element:d,parent:e,id:f,hasChildren:u,defaultCollapseState:this.getDefaultCollapseState(d)});return s&&s.viewState.focus&&s.viewState.focus.indexOf(f)>-1&&s.focus.push(m),s&&s.viewState.selection&&s.viewState.selection.indexOf(f)>-1&&s.selection.push(m),(s&&s.viewState.expanded&&s.viewState.expanded.indexOf(f)>-1||u&&m.defaultCollapseState===ObjectTreeElementCollapseState.PreserveOrExpanded)&&l.push(m),m});for(const d of o.values())dfs(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const s=e.children.map(o=>this.asTreeElement(o,t)),r=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(o){return i.diffIdentityProvider.getId(o.element)}}};this.tree.setChildren(e===this.root?null:e,s,r),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Iterable.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class CompressibleAsyncDataTreeNodeWrapper{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new CompressibleAsyncDataTreeNodeWrapper(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class CompressibleAsyncDataTreeRenderer{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)),!0):(t.classList.remove(...ThemeIcon.asClassNameArray(Codicon.treeItemLoading)),!1)}disposeElement(e,t,i,s){var r,o;(o=(r=this.renderer).disposeElement)==null||o.call(r,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var r,o;(o=(r=this.renderer).disposeCompressedElements)==null||o.call(r,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=dispose(this.disposables)}}function asCompressibleObjectTreeOptions(n){const e=n&&asObjectTreeOptions(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}}}}class CompressibleAsyncDataTree extends AsyncDataTree{constructor(e,t,i,s,r,o,a={}){super(e,t,i,r,o,a),this.compressionDelegate=s,this.compressibleNodeMapper=new WeakMapper(l=>new CompressibleAsyncDataTreeNodeWrapper(l)),this.filter=a.filter}createTree(e,t,i,s,r){const o=new ComposedTreeDelegate(i),a=s.map(c=>new CompressibleAsyncDataTreeRenderer(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=asCompressibleObjectTreeOptions(r)||{};return new CompressibleObjectTree(e,t,o,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const s=g=>this.identityProvider.getId(g).toString(),r=g=>{const m=new Set;for(const _ of g){const v=this.tree.getCompressedTreeNode(_===this.root?null:_);if(v.element)for(const C of v.element.elements)m.add(s(C.element))}return m},o=r(this.tree.getSelection()),a=r(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let u=!1;const f=g=>{const m=g.element;if(m)for(let _=0;_{const i=this.filter.filter(t,1),s=getVisibility(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function getVisibility(n){return typeof n=="boolean"?n?1:0:isFilterResult(n)?getVisibleState(n.visibility):getVisibleState(n)}class DataTree extends AbstractTree{constructor(e,t,i,s,r,o={}){super(e,t,i,s,o),this.user=e,this.dataSource=r,this.identityProvider=o.identityProvider}createModel(e,t,i){return new ObjectTreeModel(e,t,i)}}new RawContextKey("isMac",isMacintosh,localize("isMac","Whether the operating system is macOS"));new RawContextKey("isLinux",isLinux,localize("isLinux","Whether the operating system is Linux"));const IsWindowsContext=new RawContextKey("isWindows",isWindows,localize("isWindows","Whether the operating system is Windows")),IsWebContext=new RawContextKey("isWeb",isWeb,localize("isWeb","Whether the platform is a web browser"));new RawContextKey("isMacNative",isMacintosh&&!isWeb,localize("isMacNative","Whether the operating system is macOS on a non-browser platform"));new RawContextKey("isIOS",isIOS,localize("isIOS","Whether the operating system is iOS"));new RawContextKey("isMobile",isMobile,localize("isMobile","Whether the platform is a mobile web browser"));new RawContextKey("isDevelopment",!1,!0);new RawContextKey("productQualityType","",localize("productQualityType","Quality type of VS Code"));const InputFocusedContextKey="inputFocus",InputFocusedContext=new RawContextKey(InputFocusedContextKey,!1,localize("inputFocus","Whether keyboard focus is inside an input box"));var __decorate$27=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$27=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const IListService=createDecorator("listService");class ListService{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new DisposableStore,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)==null||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)==null||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new DefaultStyleController(createStyleSheet(),"").style(defaultListStyles)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),isActiveElement(e.getHTMLElement())&&this.setLastFocusedList(e),combinedDisposable(e.onDidFocus(()=>this.setLastFocusedList(e)),toDisposable(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const RawWorkbenchListScrollAtBoundaryContextKey=new RawContextKey("listScrollAtBoundary","none");ContextKeyExpr.or(RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("top"),RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("both"));ContextKeyExpr.or(RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("bottom"),RawWorkbenchListScrollAtBoundaryContextKey.isEqualTo("both"));const RawWorkbenchListFocusContextKey=new RawContextKey("listFocus",!0),WorkbenchTreeStickyScrollFocused=new RawContextKey("treestickyScrollFocused",!1),WorkbenchListSupportsMultiSelectContextKey=new RawContextKey("listSupportsMultiselect",!0),WorkbenchListFocusContextKey=ContextKeyExpr.and(RawWorkbenchListFocusContextKey,ContextKeyExpr.not(InputFocusedContextKey),WorkbenchTreeStickyScrollFocused.negate()),WorkbenchListHasSelectionOrFocus=new RawContextKey("listHasSelectionOrFocus",!1),WorkbenchListDoubleSelection=new RawContextKey("listDoubleSelection",!1),WorkbenchListMultiSelection=new RawContextKey("listMultiSelection",!1),WorkbenchListSelectionNavigation=new RawContextKey("listSelectionNavigation",!1),WorkbenchListSupportsFind=new RawContextKey("listSupportsFind",!0),WorkbenchTreeElementCanCollapse=new RawContextKey("treeElementCanCollapse",!1),WorkbenchTreeElementHasParent=new RawContextKey("treeElementHasParent",!1),WorkbenchTreeElementCanExpand=new RawContextKey("treeElementCanExpand",!1),WorkbenchTreeElementHasChild=new RawContextKey("treeElementHasChild",!1),WorkbenchTreeFindOpen=new RawContextKey("treeFindOpen",!1),WorkbenchListTypeNavigationModeKey="listTypeNavigationMode",WorkbenchListAutomaticKeyboardNavigationLegacyKey="listAutomaticKeyboardNavigation";function createScopedContextKeyService(n,e){const t=n.createScoped(e.getHTMLElement());return RawWorkbenchListFocusContextKey.bindTo(t),t}function createScrollObserver(n,e){const t=RawWorkbenchListScrollAtBoundaryContextKey.bindTo(n),i=()=>{const s=e.scrollTop===0,r=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&r?t.set("both"):s?t.set("top"):r?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const multiSelectModifierSettingKey="workbench.list.multiSelectModifier",openModeSettingKey="workbench.list.openMode",horizontalScrollingKey="workbench.list.horizontalScrolling",defaultFindModeSettingKey="workbench.list.defaultFindMode",typeNavigationModeSettingKey="workbench.list.typeNavigationMode",keyboardNavigationSettingKey="workbench.list.keyboardNavigation",scrollByPageKey="workbench.list.scrollByPage",defaultFindMatchTypeSettingKey="workbench.list.defaultFindMatchType",treeIndentKey="workbench.tree.indent",treeRenderIndentGuidesKey="workbench.tree.renderIndentGuides",listSmoothScrolling="workbench.list.smoothScrolling",mouseWheelScrollSensitivityKey="workbench.list.mouseWheelScrollSensitivity",fastScrollSensitivityKey="workbench.list.fastScrollSensitivity",treeExpandMode="workbench.tree.expandMode",treeStickyScroll="workbench.tree.enableStickyScroll",treeStickyScrollMaxElements="workbench.tree.stickyScrollMaxItemCount";function useAltAsMultipleSelectionModifier(n){return n.getValue(multiSelectModifierSettingKey)==="alt"}class MultipleSelectionController extends Disposable{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(multiSelectModifierSettingKey)&&(this.useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return isSelectionRangeChangeEvent(e)}}function toWorkbenchListOptions(n,e){const t=n.get(IConfigurationService),i=n.get(IKeybindingService),s=new DisposableStore;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(o){return i.mightProducePrintableCharacter(o)}},smoothScrolling:!!t.getValue(listSmoothScrolling),mouseWheelScrollSensitivity:t.getValue(mouseWheelScrollSensitivityKey),fastScrollSensitivity:t.getValue(fastScrollSensitivityKey),multipleSelectionController:e.multipleSelectionController??s.add(new MultipleSelectionController(t)),keyboardNavigationEventFilter:createKeyboardNavigationEventFilter(i),scrollByPage:!!t.getValue(scrollByPageKey)},s]}let WorkbenchList=class extends List{constructor(e,t,i,s,r,o,a,l,c){const d=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(horizontalScrollingKey),[u,f]=c.invokeFunction(toWorkbenchListOptions,r);super(e,t,i,s,{keyboardSupport:!1,...u,horizontalScrolling:d}),this.disposables.add(f),this.contextKeyService=createScopedContextKeyService(o,this),this.disposables.add(createScrollObserver(this.contextKeyService,this)),this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.listDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.listMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(l.onDidChangeConfiguration(m=>{m.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l));let _={};if(m.affectsConfiguration(horizontalScrollingKey)&&this.horizontalScrolling===void 0){const v=!!l.getValue(horizontalScrollingKey);_={..._,horizontalScrolling:v}}if(m.affectsConfiguration(scrollByPageKey)){const v=!!l.getValue(scrollByPageKey);_={..._,scrollByPage:v}}if(m.affectsConfiguration(listSmoothScrolling)){const v=!!l.getValue(listSmoothScrolling);_={..._,smoothScrolling:v}}if(m.affectsConfiguration(mouseWheelScrollSensitivityKey)){const v=l.getValue(mouseWheelScrollSensitivityKey);_={..._,mouseWheelScrollSensitivity:v}}if(m.affectsConfiguration(fastScrollSensitivityKey)){const v=l.getValue(fastScrollSensitivityKey);_={..._,fastScrollSensitivity:v}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new ListResourceNavigator(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?getListStyles(e):defaultListStyles)}};WorkbenchList=__decorate$27([__param$27(5,IContextKeyService),__param$27(6,IListService),__param$27(7,IConfigurationService),__param$27(8,IInstantiationService)],WorkbenchList);let WorkbenchPagedList=class extends PagedList{constructor(e,t,i,s,r,o,a,l,c){const d=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!l.getValue(horizontalScrollingKey),[u,f]=c.invokeFunction(toWorkbenchListOptions,r);super(e,t,i,s,{keyboardSupport:!1,...u,horizontalScrolling:d}),this.disposables=new DisposableStore,this.disposables.add(f),this.contextKeyService=createScopedContextKeyService(o,this),this.disposables.add(createScrollObserver(this.contextKeyService,this.widget)),this.horizontalScrolling=r.horizontalScrolling,this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(m=>{m.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(l));let _={};if(m.affectsConfiguration(horizontalScrollingKey)&&this.horizontalScrolling===void 0){const v=!!l.getValue(horizontalScrollingKey);_={..._,horizontalScrolling:v}}if(m.affectsConfiguration(scrollByPageKey)){const v=!!l.getValue(scrollByPageKey);_={..._,scrollByPage:v}}if(m.affectsConfiguration(listSmoothScrolling)){const v=!!l.getValue(listSmoothScrolling);_={..._,smoothScrolling:v}}if(m.affectsConfiguration(mouseWheelScrollSensitivityKey)){const v=l.getValue(mouseWheelScrollSensitivityKey);_={..._,mouseWheelScrollSensitivity:v}}if(m.affectsConfiguration(fastScrollSensitivityKey)){const v=l.getValue(fastScrollSensitivityKey);_={..._,fastScrollSensitivity:v}}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new ListResourceNavigator(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?getListStyles(e):defaultListStyles)}dispose(){this.disposables.dispose(),super.dispose()}};WorkbenchPagedList=__decorate$27([__param$27(5,IContextKeyService),__param$27(6,IListService),__param$27(7,IConfigurationService),__param$27(8,IInstantiationService)],WorkbenchPagedList);let WorkbenchTable=class extends Table{constructor(e,t,i,s,r,o,a,l,c,d){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!c.getValue(horizontalScrollingKey),[f,g]=d.invokeFunction(toWorkbenchListOptions,o);super(e,t,i,s,r,{keyboardSupport:!1,...f,horizontalScrolling:u}),this.disposables.add(g),this.contextKeyService=createScopedContextKeyService(a,this),this.disposables.add(createScrollObserver(this.contextKeyService,this)),this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.listDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.listMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const _=this.getSelection(),v=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(_.length>0||v.length>0),this.listMultiSelection.set(_.length>1),this.listDoubleSelection.set(_.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const _=this.getSelection(),v=this.getFocus();this.listHasSelectionOrFocus.set(_.length>0||v.length>0)})),this.disposables.add(c.onDidChangeConfiguration(_=>{_.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(c));let v={};if(_.affectsConfiguration(horizontalScrollingKey)&&this.horizontalScrolling===void 0){const C=!!c.getValue(horizontalScrollingKey);v={...v,horizontalScrolling:C}}if(_.affectsConfiguration(scrollByPageKey)){const C=!!c.getValue(scrollByPageKey);v={...v,scrollByPage:C}}if(_.affectsConfiguration(listSmoothScrolling)){const C=!!c.getValue(listSmoothScrolling);v={...v,smoothScrolling:C}}if(_.affectsConfiguration(mouseWheelScrollSensitivityKey)){const C=c.getValue(mouseWheelScrollSensitivityKey);v={...v,mouseWheelScrollSensitivity:C}}if(_.affectsConfiguration(fastScrollSensitivityKey)){const C=c.getValue(fastScrollSensitivityKey);v={...v,fastScrollSensitivity:C}}Object.keys(v).length>0&&this.updateOptions(v)})),this.navigator=new TableResourceNavigator(this,{configurationService:c,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?getListStyles(e):defaultListStyles)}dispose(){this.disposables.dispose(),super.dispose()}};WorkbenchTable=__decorate$27([__param$27(6,IContextKeyService),__param$27(7,IListService),__param$27(8,IConfigurationService),__param$27(9,IInstantiationService)],WorkbenchTable);class ResourceNavigator extends Disposable{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new Emitter$1),this.onDidOpen=this._onDidOpen.event,this._register(Event$1.filter(this.widget.onDidChangeSelection,i=>isKeyboardEvent$1(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(openModeSettingKey))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(openModeSettingKey)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(openModeSettingKey))!=="doubleClick")}))):this.openOnSingleClick=(t==null?void 0:t.openOnSingleClick)??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i,r=!1;this._open(this.getSelectedElement(),i,s,r,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,r=!0,o=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const r=!1,o=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,r,o,a,t)}_open(e,t,i,s,r){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:r})}}class ListResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class TableResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class TreeResourceNavigator extends ResourceNavigator{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function createKeyboardNavigationEventFilter(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let WorkbenchObjectTree=class extends ObjectTree{constructor(e,t,i,s,r,o,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:f}=o.invokeFunction(workbenchTreeDataPreamble,r);super(e,t,i,s,d),this.disposables.add(f),this.internals=new WorkbenchTreeInternals(this,r,u,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};WorkbenchObjectTree=__decorate$27([__param$27(5,IInstantiationService),__param$27(6,IContextKeyService),__param$27(7,IListService),__param$27(8,IConfigurationService)],WorkbenchObjectTree);let WorkbenchCompressibleObjectTree=class extends CompressibleObjectTree{constructor(e,t,i,s,r,o,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:f}=o.invokeFunction(workbenchTreeDataPreamble,r);super(e,t,i,s,d),this.disposables.add(f),this.internals=new WorkbenchTreeInternals(this,r,u,r.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchCompressibleObjectTree=__decorate$27([__param$27(5,IInstantiationService),__param$27(6,IContextKeyService),__param$27(7,IListService),__param$27(8,IConfigurationService)],WorkbenchCompressibleObjectTree);let WorkbenchDataTree=class extends DataTree{constructor(e,t,i,s,r,o,a,l,c,d){const{options:u,getTypeNavigationMode:f,disposable:g}=a.invokeFunction(workbenchTreeDataPreamble,o);super(e,t,i,s,r,u),this.disposables.add(g),this.internals=new WorkbenchTreeInternals(this,o,f,o.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchDataTree=__decorate$27([__param$27(6,IInstantiationService),__param$27(7,IContextKeyService),__param$27(8,IListService),__param$27(9,IConfigurationService)],WorkbenchDataTree);let WorkbenchAsyncDataTree=class extends AsyncDataTree{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,r,o,a,l,c,d){const{options:u,getTypeNavigationMode:f,disposable:g}=a.invokeFunction(workbenchTreeDataPreamble,o);super(e,t,i,s,r,u),this.disposables.add(g),this.internals=new WorkbenchTreeInternals(this,o,f,o.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};WorkbenchAsyncDataTree=__decorate$27([__param$27(6,IInstantiationService),__param$27(7,IContextKeyService),__param$27(8,IListService),__param$27(9,IConfigurationService)],WorkbenchAsyncDataTree);let WorkbenchCompressibleAsyncDataTree=class extends CompressibleAsyncDataTree{constructor(e,t,i,s,r,o,a,l,c,d,u){const{options:f,getTypeNavigationMode:g,disposable:m}=l.invokeFunction(workbenchTreeDataPreamble,a);super(e,t,i,s,r,o,f),this.disposables.add(m),this.internals=new WorkbenchTreeInternals(this,a,g,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};WorkbenchCompressibleAsyncDataTree=__decorate$27([__param$27(7,IInstantiationService),__param$27(8,IContextKeyService),__param$27(9,IListService),__param$27(10,IConfigurationService)],WorkbenchCompressibleAsyncDataTree);function getDefaultTreeFindMode(n){const e=n.getValue(defaultFindModeSettingKey);if(e==="highlight")return TreeFindMode.Highlight;if(e==="filter")return TreeFindMode.Filter;const t=n.getValue(keyboardNavigationSettingKey);if(t==="simple"||t==="highlight")return TreeFindMode.Highlight;if(t==="filter")return TreeFindMode.Filter}function getDefaultTreeFindMatchType(n){const e=n.getValue(defaultFindMatchTypeSettingKey);if(e==="fuzzy")return TreeFindMatchType.Fuzzy;if(e==="contiguous")return TreeFindMatchType.Contiguous}function workbenchTreeDataPreamble(n,e){const t=n.get(IConfigurationService),i=n.get(IContextViewService),s=n.get(IContextKeyService),r=n.get(IInstantiationService),o=()=>{const f=s.getContextKeyValue(WorkbenchListTypeNavigationModeKey);if(f==="automatic")return TypeNavigationMode.Automatic;if(f==="trigger"||s.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationLegacyKey)===!1)return TypeNavigationMode.Trigger;const m=t.getValue(typeNavigationModeSettingKey);if(m==="automatic")return TypeNavigationMode.Automatic;if(m==="trigger")return TypeNavigationMode.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(horizontalScrollingKey),[l,c]=r.invokeFunction(toWorkbenchListOptions,e),d=e.paddingBottom,u=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(treeRenderIndentGuidesKey);return{getTypeNavigationMode:o,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(treeIndentKey)=="number"?t.getValue(treeIndentKey):void 0,renderIndentGuides:u,smoothScrolling:!!t.getValue(listSmoothScrolling),defaultFindMode:getDefaultTreeFindMode(t),defaultFindMatchType:getDefaultTreeFindMatchType(t),horizontalScrolling:a,scrollByPage:!!t.getValue(scrollByPageKey),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(treeExpandMode)==="doubleClick",contextViewProvider:i,findWidgetStyles:defaultFindWidgetStyles,enableStickyScroll:!!t.getValue(treeStickyScroll),stickyScrollMaxItemCount:Number(t.getValue(treeStickyScrollMaxElements))}}}let WorkbenchTreeInternals=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,r,o,a){this.tree=e,this.disposables=[],this.contextKeyService=createScopedContextKeyService(r,e),this.disposables.push(createScrollObserver(this.contextKeyService,e)),this.listSupportsMultiSelect=WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),WorkbenchListSelectionNavigation.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=WorkbenchListSupportsFind.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=WorkbenchListHasSelectionOrFocus.bindTo(this.contextKeyService),this.hasDoubleSelection=WorkbenchListDoubleSelection.bindTo(this.contextKeyService),this.hasMultiSelection=WorkbenchListMultiSelection.bindTo(this.contextKeyService),this.treeElementCanCollapse=WorkbenchTreeElementCanCollapse.bindTo(this.contextKeyService),this.treeElementHasParent=WorkbenchTreeElementHasParent.bindTo(this.contextKeyService),this.treeElementCanExpand=WorkbenchTreeElementCanExpand.bindTo(this.contextKeyService),this.treeElementHasChild=WorkbenchTreeElementHasChild.bindTo(this.contextKeyService),this.treeFindOpen=WorkbenchTreeFindOpen.bindTo(this.contextKeyService),this.treeStickyScrollFocused=WorkbenchTreeStickyScrollFocused.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(a),this.updateStyleOverrides(s);const c=()=>{const u=e.getFocus()[0];if(!u)return;const f=e.getNode(u);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(u)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(u))},d=new Set;d.add(WorkbenchListTypeNavigationModeKey),d.add(WorkbenchListAutomaticKeyboardNavigationLegacyKey),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection(()=>{const u=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(u.length>0||f.length>0),this.hasMultiSelection.set(u.length>1),this.hasDoubleSelection.set(u.length===2)})}),e.onDidChangeFocus(()=>{const u=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(u.length>0||f.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(u=>this.treeFindOpen.set(u)),e.onDidChangeStickyScrollFocused(u=>this.treeStickyScrollFocused.set(u)),a.onDidChangeConfiguration(u=>{let f={};if(u.affectsConfiguration(multiSelectModifierSettingKey)&&(this._useAltAsMultipleSelectionModifier=useAltAsMultipleSelectionModifier(a)),u.affectsConfiguration(treeIndentKey)){const g=a.getValue(treeIndentKey);f={...f,indent:g}}if(u.affectsConfiguration(treeRenderIndentGuidesKey)&&t.renderIndentGuides===void 0){const g=a.getValue(treeRenderIndentGuidesKey);f={...f,renderIndentGuides:g}}if(u.affectsConfiguration(listSmoothScrolling)){const g=!!a.getValue(listSmoothScrolling);f={...f,smoothScrolling:g}}if(u.affectsConfiguration(defaultFindModeSettingKey)||u.affectsConfiguration(keyboardNavigationSettingKey)){const g=getDefaultTreeFindMode(a);f={...f,defaultFindMode:g}}if(u.affectsConfiguration(typeNavigationModeSettingKey)||u.affectsConfiguration(keyboardNavigationSettingKey)){const g=i();f={...f,typeNavigationMode:g}}if(u.affectsConfiguration(defaultFindMatchTypeSettingKey)){const g=getDefaultTreeFindMatchType(a);f={...f,defaultFindMatchType:g}}if(u.affectsConfiguration(horizontalScrollingKey)&&t.horizontalScrolling===void 0){const g=!!a.getValue(horizontalScrollingKey);f={...f,horizontalScrolling:g}}if(u.affectsConfiguration(scrollByPageKey)){const g=!!a.getValue(scrollByPageKey);f={...f,scrollByPage:g}}if(u.affectsConfiguration(treeExpandMode)&&t.expandOnlyOnTwistieClick===void 0&&(f={...f,expandOnlyOnTwistieClick:a.getValue(treeExpandMode)==="doubleClick"}),u.affectsConfiguration(treeStickyScroll)){const g=a.getValue(treeStickyScroll);f={...f,enableStickyScroll:g}}if(u.affectsConfiguration(treeStickyScrollMaxElements)){const g=Math.max(1,a.getValue(treeStickyScrollMaxElements));f={...f,stickyScrollMaxItemCount:g}}if(u.affectsConfiguration(mouseWheelScrollSensitivityKey)){const g=a.getValue(mouseWheelScrollSensitivityKey);f={...f,mouseWheelScrollSensitivity:g}}if(u.affectsConfiguration(fastScrollSensitivityKey)){const g=a.getValue(fastScrollSensitivityKey);f={...f,fastScrollSensitivity:g}}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(u=>{u.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new TreeResourceNavigator(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?getListStyles(e):defaultListStyles)}dispose(){this.disposables=dispose(this.disposables)}};WorkbenchTreeInternals=__decorate$27([__param$27(4,IContextKeyService),__param$27(5,IListService),__param$27(6,IConfigurationService)],WorkbenchTreeInternals);const configurationRegistry=Registry.as(Extensions$6.Configuration);configurationRegistry.registerConfiguration({id:"workbench",order:7,title:localize("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[multiSelectModifierSettingKey]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[localize("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),localize("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:localize({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[openModeSettingKey]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:localize({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[horizontalScrollingKey]:{type:"boolean",default:!1,description:localize("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[scrollByPageKey]:{type:"boolean",default:!1,description:localize("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[treeIndentKey]:{type:"number",default:8,minimum:4,maximum:40,description:localize("tree indent setting","Controls tree indentation in pixels.")},[treeRenderIndentGuidesKey]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:localize("render tree indent guides","Controls whether the tree should render indent guides.")},[listSmoothScrolling]:{type:"boolean",default:!1,description:localize("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[mouseWheelScrollSensitivityKey]:{type:"number",default:1,markdownDescription:localize("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[fastScrollSensitivityKey]:{type:"number",default:5,markdownDescription:localize("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[defaultFindModeSettingKey]:{type:"string",enum:["highlight","filter"],enumDescriptions:[localize("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),localize("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:localize("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[keyboardNavigationSettingKey]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[localize("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),localize("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),localize("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:localize("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:localize("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[defaultFindMatchTypeSettingKey]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[localize("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),localize("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:localize("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[treeExpandMode]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:localize("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[treeStickyScroll]:{type:"boolean",default:!0,description:localize("sticky scroll","Controls whether sticky scrolling is enabled in trees.")},[treeStickyScrollMaxElements]:{type:"number",minimum:1,default:7,markdownDescription:localize("sticky scroll maximum items","Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[typeNavigationModeSettingKey]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:localize("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});const iconlabel="";class HighlightedLabel extends Disposable{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(t==null?void 0:t.supportIcons)??!1,this.domNode=append$1(e,$$e("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=HighlightedLabel.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&equals(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){var i,s,r;const e=[];let t=0;for(const o of this.highlights){if(o.end===o.start)continue;if(t{s=r===`\r +`?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=s),a.end>=o&&(a.end+=s));return i+=s,"⏎"})}}class FastLabelNode{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||equals(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class IconLabel extends Disposable{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new FastLabelNode(append$1(e,$$e(".monaco-icon-label")))),this.labelContainer=append$1(this.domNode.element,$$e(".monaco-icon-label-container")),this.nameContainer=append$1(this.labelContainer,$$e("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new LabelWithHighlights(this.nameContainer,!!t.supportIcons)):this.nameNode=new Label(this.nameContainer),this.hoverDelegate=(t==null?void 0:t.hoverDelegate)??getDefaultHoverDelegate("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],r=["monaco-icon-label-container"];let o="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?o+=i.title:o+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let l;!a||!isHTMLElement(a)?(l=$$e(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,l.style.backgroundImage=asCSSUrl(i==null?void 0:i.iconPath)}else a&&a.remove();if(this.domNode.classNames=s,this.domNode.element.setAttribute("aria-label",o),this.labelContainer.classList.value="",this.labelContainer.classList.add(...r),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof HighlightedLabel?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(l.element,i==null?void 0:i.descriptionTitle)):(l.textContent=t&&(i!=null&&i.labelEscapeNewLines)?HighlightedLabel.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(i==null?void 0:i.descriptionTitle)||""),l.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(i==null?void 0:i.suffix)??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(r,o){isString$3(o)?r.title=stripIcons(o):o!=null&&o.markdownNotSupportedFallback?r.title=o.markdownNotSupportedFallback:r.removeAttribute("title")})(e,t);else{const s=getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new FastLabelNode(after(this.nameContainer,$$e("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new FastLabelNode(append$1(e.element,$$e("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new FastLabelNode(append$1(this.labelContainer,$$e("span.monaco-icon-description-container"))));(e=this.creationOptions)!=null&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new HighlightedLabel(append$1(t.element,$$e("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new FastLabelNode(append$1(t.element,$$e("span.label-description"))))}return this.descriptionNode}}class Label{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&equals(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=append$1(this.container,$$e("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const r={start:i,end:i+s.length},o=t.map(a=>Range$1.intersect(r,a)).filter(a=>!Range$1.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=r.end+e.length,o})}class LabelWithHighlights extends Disposable{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&equals(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new HighlightedLabel(append$1(this.container,$$e("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons}))),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=splitMatches(e,i,t==null?void 0:t.matches);for(let r=0;r{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function compareFileNames(n,e,t=!1){const i=n||"",s=e||"",r=intlFileNameCollatorBaseNumeric.value.collator.compare(i,s);return intlFileNameCollatorBaseNumeric.value.collatorIsNumeric&&r===0&&i!==s?is.length)return 1}return 0}var __decorate$26=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$26=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},QuickPickItemElementRenderer_1;const $$7=$$e;class BaseQuickPickItemElement{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Lazy(()=>{const s=i.label??"",r=parseLabelWithIcons(s).text.trim(),o=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>getCodiconAriaLabel(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:r,saneAriaLabel:o}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class QuickPickItemElement extends BaseQuickPickItemElement{constructor(e,t,i,s,r,o){var a,l,c;super(e,t,r),this.fireButtonTriggered=i,this._onChecked=s,this.item=r,this._separator=o,this._checked=!1,this.onChecked=t?Event$1.map(Event$1.filter(this._onChecked.event,d=>d.element===this),d=>d.checked):Event$1.None,this._saneDetail=r.detail,this._labelHighlights=(a=r.highlights)==null?void 0:a.label,this._descriptionHighlights=(l=r.highlights)==null?void 0:l.description,this._detailHighlights=(c=r.highlights)==null?void 0:c.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var QuickPickSeparatorFocusReason;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(QuickPickSeparatorFocusReason||(QuickPickSeparatorFocusReason={}));class QuickPickSeparatorElement extends BaseQuickPickItemElement{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=QuickPickSeparatorFocusReason.NONE}}class QuickInputItemDelegate{getHeight(e){return e instanceof QuickPickSeparatorElement?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof QuickPickItemElement?QuickPickItemElementRenderer.ID:QuickPickSeparatorElementRenderer.ID}}class QuickInputAccessibilityProvider{getWidgetAriaLabel(){return localize("quickInput","Quick Input")}getAriaLabel(e){var t;return(t=e.separator)!=null&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof QuickPickItemElement)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class BaseQuickInputListRenderer{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new DisposableStore,t.toDisposeTemplate=new DisposableStore,t.entry=append$1(e,$$7(".quick-input-list-entry"));const i=append$1(t.entry,$$7("label.quick-input-list-label"));t.toDisposeTemplate.add(addStandardDisposableListener(i,EventType$1.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=append$1(i,$$7("input.quick-input-list-checkbox")),t.checkbox.type="checkbox";const s=append$1(i,$$7(".quick-input-list-rows")),r=append$1(s,$$7(".quick-input-list-row")),o=append$1(s,$$7(".quick-input-list-row"));t.label=new IconLabel(r,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=prepend$1(t.label.element,$$7(".quick-input-list-icon"));const a=append$1(r,$$7(".quick-input-list-entry-keybinding"));t.keybinding=new KeybindingLabel(a,OS$1),t.toDisposeTemplate.add(t.keybinding);const l=append$1(o,$$7(".quick-input-list-label-meta"));return t.detail=new IconLabel(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=append$1(t.entry,$$7(".quick-input-list-separator")),t.actionBar=new ActionBar(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var yl;let QuickPickItemElementRenderer=(yl=class extends BaseQuickInputListRenderer{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return QuickPickItemElementRenderer_1.ID}renderTemplate(e){const t=super.renderTemplate(e);return t.toDisposeTemplate.add(addStandardDisposableListener(t.checkbox,EventType$1.CHANGE,i=>{t.element.checked=t.checkbox.checked})),t}renderElement(e,t,i){var f;const s=e.element;i.element=s,s.element=i.entry??void 0;const r=s.item;i.checkbox.checked=s.checked,i.toDisposeElement.add(s.onChecked(g=>i.checkbox.checked=g)),i.checkbox.disabled=s.checkboxDisabled;const{labelHighlights:o,descriptionHighlights:a,detailHighlights:l}=s;if(r.iconPath){const g=isDark(this.themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,m=URI.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=asCSSUrl(m)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-list-icon ${r.iconClass}`:"";let c;!s.saneTooltip&&s.saneDescription&&(c={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:o||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=r.iconClasses,d.italic=r.italic,d.strikethrough=r.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(r.keybinding),s.saneDetail){let g;s.saneTooltip||(g={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:l,title:g,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";(f=s.separator)!=null&&f.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator);const u=r.buttons;u&&u.length?(i.actionBar.push(u.map((g,m)=>quickInputButtonToAction(g,`id-${m}`,()=>s.fireButtonTriggered({button:g,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},QuickPickItemElementRenderer_1=yl,yl.ID="quickpickitem",yl);QuickPickItemElementRenderer=QuickPickItemElementRenderer_1=__decorate$26([__param$26(1,IThemeService)],QuickPickItemElementRenderer);const Yh=class Yh extends BaseQuickInputListRenderer{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return Yh.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderTemplate(e){const t=super.renderTemplate(e);return t.checkbox.style.display="none",t}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const r=s.separator,{labelHighlights:o,descriptionHighlights:a,detailHighlights:l}=s;i.icon.style.backgroundImage="",i.icon.className="";let c;!s.saneTooltip&&s.saneDescription&&(c={markdown:{value:s.saneDescription,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:o||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),s.saneDetail){let f;s.saneTooltip||(f={markdown:{value:s.saneDetail,supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:l,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const u=r.buttons;u&&u.length?(i.actionBar.push(u.map((f,g)=>quickInputButtonToAction(f,`id-${g}`,()=>s.fireSeparatorButtonTriggered({button:f,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){var s;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(s=e.element.element)==null||s.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};Yh.ID="quickpickseparator";let QuickPickSeparatorElementRenderer=Yh,QuickInputTree=class extends Disposable{constructor(e,t,i,s,r,o){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=o,this._onKeyDown=new Emitter$1,this._onLeave=new Emitter$1,this.onLeave=this._onLeave.event,this._visibleCountObservable=observableValue("VisibleCount",0),this.onChangedVisibleCount=Event$1.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=observableValue("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=Event$1.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=observableValue("CheckedCount",0),this.onChangedCheckedCount=Event$1.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=observableValueOpts({equalsFn:equals$1},new Array),this.onChangedCheckedElements=Event$1.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new Emitter$1,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new Emitter$1,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new Emitter$1,this._elementCheckedEventBufferer=new EventBufferer,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new DisposableStore),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=append$1(this.parent,$$7(".quick-input-list")),this._separatorRenderer=new QuickPickSeparatorElementRenderer(t),this._itemRenderer=r.createInstance(QuickPickItemElementRenderer,t),this._tree=this._register(r.createInstance(WorkbenchObjectTree,"QuickInput",this._container,new QuickInputItemDelegate,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof QuickPickSeparatorElement?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return compareEntries(a,l,c)}},accessibilityProvider:new QuickInputAccessibilityProvider,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:RenderIndentGuides.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return Event$1.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof QuickPickItemElement).map(t=>t.item),this._store)}get onDidChangeSelection(){return Event$1.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof QuickPickItemElement).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new StandardKeyboardEvent(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(addDisposableListener(this._container,EventType$1.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(addDisposableListener(this._container,EventType$1.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new ThrottledDelayer(this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(isHTMLAnchorElement(t.browserEvent.target)){e.cancel();return}if(!(!isHTMLAnchorElement(t.browserEvent.relatedTarget)&&isAncestor$1(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof QuickPickItemElement&&this.showHover(t.element)})}catch(s){if(!isCancellationError(s))throw s}})),this._register(this._tree.onMouseOut(t=>{var i;isAncestor$1(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&QuickPickSeparatorFocusReason.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=QuickPickSeparatorFocusReason.ACTIVE_ITEM:i.focusInsideSeparator&=~QuickPickSeparatorFocusReason.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&QuickPickSeparatorFocusReason.MOUSE_HOVER)||(i.focusInsideSeparator|=QuickPickSeparatorFocusReason.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&QuickPickSeparatorFocusReason.MOUSE_HOVER)&&(i.focusInsideSeparator&=~QuickPickSeparatorFocusReason.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof QuickPickItemElement);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof QuickPickSeparatorElement&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,s,r)=>{let o;if(s.type==="separator"){if(!s.buttons)return i;t=new QuickPickSeparatorElement(r,a=>this._onSeparatorButtonTriggered.fire(a),s),o=t}else{const a=r>0?e[r-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(t=void 0,l=a);const c=new QuickPickItemElement(r,this._hasCheckboxes,d=>this._onButtonTriggered.fire(d),this._elementChecked,s,l);if(this._itemElements.push(c),t)return t.children.push(c),i;o=c}return i.push(o),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),s=i==null?void 0:i.parentNode;if(i&&s){const r=i.nextSibling;i.remove(),s.insertBefore(i,r)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){var t;if(this._itemElements.length)switch(e===QuickPickFocus.Second&&this._itemElements.length<2&&(e=QuickPickFocus.First),e){case QuickPickFocus.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof QuickPickItemElement);break;case QuickPickFocus.Second:{this._tree.scrollTop=0;let i=!1;this._tree.focusFirst(void 0,s=>s.element instanceof QuickPickItemElement?i?!0:(i=!i,!1):!1);break}case QuickPickFocus.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,i=>i.element instanceof QuickPickItemElement);break;case QuickPickFocus.Next:{const i=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,r=>r.element instanceof QuickPickItemElement?(this._tree.reveal(r.element),!0):!1);const s=this._tree.getFocus();i.length&&i[0]===s[0]&&i[0]===this._itemElements[this._itemElements.length-1]&&this._onLeave.fire();break}case QuickPickFocus.Previous:{const i=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,r=>{if(!(r.element instanceof QuickPickItemElement))return!1;const o=this._tree.getParentElement(r.element);return o===null||o.children[0]!==r.element?this._tree.reveal(r.element):this._tree.reveal(o),!0});const s=this._tree.getFocus();i.length&&i[0]===s[0]&&i[0]===this._itemElements[0]&&this._onLeave.fire();break}case QuickPickFocus.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof QuickPickItemElement?(this._tree.reveal(i.element),!0):!1);break;case QuickPickFocus.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof QuickPickItemElement))return!1;const s=this._tree.getParentElement(i.element);return s===null||s.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(s),!0});break;case QuickPickFocus.NextSeparator:{let i=!1;const s=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,o=>{if(i)return!0;if(o.element instanceof QuickPickSeparatorElement)i=!0,this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element.children[0]):this._tree.reveal(o.element,0);else if(o.element instanceof QuickPickItemElement){if(o.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),!0;if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1});const r=this._tree.getFocus()[0];s===r&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,o=>o.element instanceof QuickPickItemElement));break}case QuickPickFocus.PreviousSeparator:{let i,s=!!((t=this._tree.getFocus()[0])!=null&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,r=>{if(r.element instanceof QuickPickSeparatorElement)s?i||(this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),i=r.element.children[0]):s=!0;else if(r.element instanceof QuickPickItemElement&&!i){if(r.element.separator)this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),i=r.element;else if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const s=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=s&&s.type==="separator"&&!s.buttons?s:void 0)});else{let i;this._itemElements.forEach(s=>{let r;this.matchOnLabelMode==="fuzzy"?r=this.matchOnLabel?matchesFuzzyIconAware(e,parseLabelWithIcons(s.saneLabel))??void 0:void 0:r=this.matchOnLabel?matchesContiguousIconAware(t,parseLabelWithIcons(s.saneLabel))??void 0:void 0;const o=this.matchOnDescription?matchesFuzzyIconAware(e,parseLabelWithIcons(s.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?matchesFuzzyIconAware(e,parseLabelWithIcons(s.saneDetail||""))??void 0:void 0;if(r||o||a?(s.labelHighlights=r,s.descriptionHighlights=o,s.detailHighlights=a,s.hidden=!1):(s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=s.item?!s.item.alwaysShow:!0),s.item?s.separator=void 0:s.separator&&(s.hidden=!0),!this.sortByLabel){const l=s.index&&this._inputElements[s.index-1]||void 0;(l==null?void 0:l.type)==="separator"&&!l.buttons&&(i=l),i&&!s.hidden&&(s.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof QuickPickItemElement),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof QuickPickItemElement))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new DisposableStore;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof QuickPickItemElement&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof QuickPickSeparatorElement?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(s=>({element:s,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){var t,i,s;this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.hoverDelegate).onDidHideHover)==null||i.call(t),(s=this._lastHover)==null||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:r=>{this.linkOpenerDelegate(r)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};__decorate$26([memoize],QuickInputTree.prototype,"onDidChangeFocus",null);__decorate$26([memoize],QuickInputTree.prototype,"onDidChangeSelection",null);QuickInputTree=__decorate$26([__param$26(4,IInstantiationService),__param$26(5,IAccessibilityService)],QuickInputTree);function matchesContiguousIconAware(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return matchesContiguous(n,t);const s=ltrim(t," "),r=t.length-s.length,o=matchesContiguous(n,s);if(o)for(const a of o){const l=i[a.start+r]+r;a.start+=l,a.end+=l}return o}function matchesContiguous(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function compareEntries(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:compareAnything(n.saneSortLabel,e.saneSortLabel,t)}const defaultCommandAndKeybindingRule={weight:200,when:ContextKeyExpr.and(ContextKeyExpr.equals(quickInputTypeContextKeyValue,"quickPick"),inQuickInputContext),metadata:{description:localize("quickPick","Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")}};function registerQuickPickCommandAndKeybindingRule(n,e={}){KeybindingsRegistry.registerCommandAndKeybindingRule({...defaultCommandAndKeybindingRule,...n,secondary:getSecondary(n.primary,n.secondary??[],e)})}const ctrlKeyMod$1=isMacintosh?256:2048;function getSecondary(n,e,t={}){return t.withAltMod&&e.push(512+n),t.withCtrlMod&&(e.push(ctrlKeyMod$1+n),t.withAltMod&&e.push(512+ctrlKeyMod$1+n)),t.withCmdMod&&isMacintosh&&(e.push(2048+n),t.withCtrlMod&&e.push(2048+256+n),t.withAltMod&&(e.push(2048+512+n),t.withCtrlMod&&e.push(2048+512+256+n))),e}function focusHandler(n,e){return t=>{const i=t.get(IQuickInputService).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}registerQuickPickCommandAndKeybindingRule({id:"quickInput.pageNext",primary:12,handler:focusHandler(QuickPickFocus.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});registerQuickPickCommandAndKeybindingRule({id:"quickInput.pagePrevious",primary:11,handler:focusHandler(QuickPickFocus.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});registerQuickPickCommandAndKeybindingRule({id:"quickInput.first",primary:ctrlKeyMod$1+14,handler:focusHandler(QuickPickFocus.First)},{withAltMod:!0,withCmdMod:!0});registerQuickPickCommandAndKeybindingRule({id:"quickInput.last",primary:ctrlKeyMod$1+13,handler:focusHandler(QuickPickFocus.Last)},{withAltMod:!0,withCmdMod:!0});registerQuickPickCommandAndKeybindingRule({id:"quickInput.next",primary:18,handler:focusHandler(QuickPickFocus.Next)},{withCtrlMod:!0});registerQuickPickCommandAndKeybindingRule({id:"quickInput.previous",primary:16,handler:focusHandler(QuickPickFocus.Previous)},{withCtrlMod:!0});const nextSeparatorFallbackDesc=localize("quickInput.nextSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),prevSeparatorFallbackDesc=localize("quickInput.previousSeparatorWithQuickAccessFallback","If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");isMacintosh?(registerQuickPickCommandAndKeybindingRule({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2048+18,handler:focusHandler(QuickPickFocus.NextSeparator,QuickPickFocus.Next),metadata:{description:nextSeparatorFallbackDesc}}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.nextSeparator",primary:2048+512+18,secondary:[2048+256+18],handler:focusHandler(QuickPickFocus.NextSeparator)},{withCtrlMod:!0}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2048+16,handler:focusHandler(QuickPickFocus.PreviousSeparator,QuickPickFocus.Previous),metadata:{description:prevSeparatorFallbackDesc}}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.previousSeparator",primary:2048+512+16,secondary:[2048+256+16],handler:focusHandler(QuickPickFocus.PreviousSeparator)},{withCtrlMod:!0})):(registerQuickPickCommandAndKeybindingRule({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:512+18,handler:focusHandler(QuickPickFocus.NextSeparator,QuickPickFocus.Next),metadata:{description:nextSeparatorFallbackDesc}}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.nextSeparator",primary:2048+512+18,handler:focusHandler(QuickPickFocus.NextSeparator)}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:512+16,handler:focusHandler(QuickPickFocus.PreviousSeparator,QuickPickFocus.Previous),metadata:{description:prevSeparatorFallbackDesc}}),registerQuickPickCommandAndKeybindingRule({id:"quickInput.previousSeparator",primary:2048+512+16,handler:focusHandler(QuickPickFocus.PreviousSeparator)}));registerQuickPickCommandAndKeybindingRule({id:"quickInput.acceptInBackground",when:ContextKeyExpr.and(defaultCommandAndKeybindingRule.when,ContextKeyExpr.or(InputFocusedContext.negate(),endOfQuickInputBoxContext)),primary:17,weight:200+50,handler:n=>{const e=n.get(IQuickInputService).currentQuickInput;e==null||e.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});var __decorate$25=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$25=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},QuickInputController_1;const $$6=$$e;var Sl;let QuickInputController=(Sl=class extends Disposable{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.contextKeyService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Emitter$1),this.onDidCustomEmitter=this._register(new Emitter$1),this.onDidTriggerButtonEmitter=this._register(new Emitter$1),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Emitter$1),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Emitter$1),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=InQuickInputContextKey.bindTo(this.contextKeyService),this.quickInputTypeContext=QuickInputTypeContextKey.bindTo(this.contextKeyService),this.endOfQuickInputBoxContext=EndOfQuickInputBoxContextKey.bindTo(this.contextKeyService),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(Event$1.runAndSubscribe(onDidRegisterWindow,({window:r,disposables:o})=>this.registerKeyModsListeners(r,o),{window:mainWindow,disposables:this._store})),this._register(onWillUnregisterWindow(r=>{this.ui&&getWindow(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}))}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[EventType$1.KEY_DOWN,EventType$1.KEY_UP,EventType$1.MOUSE_DOWN])t.add(addDisposableListener(e,s,i,!0))}getUI(e){if(this.ui)return e&&getWindow(this._container)!==getWindow(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=append$1(this._container,$$6(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=createStyleSheet(t),s=append$1(t,$$6(".quick-input-titlebar")),r=this._register(new ActionBar(s,{hoverDelegate:this.options.hoverDelegate}));r.domNode.classList.add("quick-input-left-action-bar");const o=append$1(s,$$6(".quick-input-title")),a=this._register(new ActionBar(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=append$1(t,$$6(".quick-input-header")),c=append$1(l,$$6("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",localize("quickInput.checkAll","Toggle all checkboxes")),this._register(addStandardDisposableListener(c,EventType$1.CHANGE,j=>{const K=c.checked;W.setAllVisibleChecked(K)})),this._register(addDisposableListener(c,EventType$1.CLICK,j=>{(j.x||j.y)&&g.setFocus()}));const d=append$1(l,$$6(".quick-input-description")),u=append$1(l,$$6(".quick-input-and-message")),f=append$1(u,$$6(".quick-input-filter")),g=this._register(new QuickInputBox(f,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const m=append$1(f,$$6(".quick-input-visible-count"));m.setAttribute("aria-live","polite"),m.setAttribute("aria-atomic","true");const _=new CountBadge(m,{countFormat:localize({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),v=append$1(f,$$6(".quick-input-count"));v.setAttribute("aria-live","polite");const C=new CountBadge(v,{countFormat:localize({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),S=this._register(new ActionBar(l,{hoverDelegate:this.options.hoverDelegate}));S.domNode.classList.add("quick-input-inline-action-bar");const w=append$1(l,$$6(".quick-input-action")),L=this._register(new Button(w,this.styles.button));L.label=localize("ok","OK"),this._register(L.onDidClick(j=>{this.onDidAcceptEmitter.fire()}));const I=append$1(l,$$6(".quick-input-action")),N=this._register(new Button(I,{...this.styles.button,supportIcons:!0}));N.label=localize("custom","Custom"),this._register(N.onDidClick(j=>{this.onDidCustomEmitter.fire()}));const R=append$1(u,$$6(`#${this.idPrefix}message.quick-input-message`)),T=this._register(new ProgressBar(t,this.styles.progressBar));T.getContainer().classList.add("quick-input-progress");const A=append$1(t,$$6(".quick-input-html-widget"));A.tabIndex=-1;const F=append$1(t,$$6(".quick-input-description")),B=this.idPrefix+"list",W=this._register(this.instantiationService.createInstance(QuickInputTree,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,B));g.setAttribute("aria-controls",B),this._register(W.onDidChangeFocus(()=>{g.setAttribute("aria-activedescendant",W.getActiveDescendant()??"")})),this._register(W.onChangedAllVisibleChecked(j=>{c.checked=j})),this._register(W.onChangedVisibleCount(j=>{_.setCount(j)})),this._register(W.onChangedCheckedCount(j=>{C.setCount(j)})),this._register(W.onLeave(()=>{setTimeout(()=>{this.controller&&(g.setFocus(),this.controller instanceof QuickPick&&this.controller.canSelectMany&&W.clearFocus())},0)}));const G=trackFocus(t);return this._register(G),this._register(addDisposableListener(t,EventType$1.FOCUS,j=>{const K=this.getUI();if(isAncestor$1(j.relatedTarget,K.inputContainer)){const ee=K.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==ee&&this.endOfQuickInputBoxContext.set(ee)}isAncestor$1(j.relatedTarget,K.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=isHTMLElement(j.relatedTarget)?j.relatedTarget:void 0)},!0)),this._register(G.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(QuickInputHideReason.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(g.onKeyDown(j=>{const K=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==K&&this.endOfQuickInputBoxContext.set(K)})),this._register(addDisposableListener(t,EventType$1.FOCUS,j=>{g.setFocus()})),this._register(addStandardDisposableListener(t,EventType$1.KEY_DOWN,j=>{if(!isAncestor$1(j.target,A))switch(j.keyCode){case 3:EventHelper.stop(j,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:EventHelper.stop(j,!0),this.hide(QuickInputHideReason.Gesture);break;case 2:if(!j.altKey&&!j.ctrlKey&&!j.metaKey){const K=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(t.classList.contains("show-checkboxes")?K.push("input"):K.push("input[type=text]"),this.getUI().list.displayed&&K.push(".monaco-list"),this.getUI().message&&K.push(".quick-input-message a"),this.getUI().widget){if(isAncestor$1(j.target,this.getUI().widget))break;K.push(".quick-input-html-widget")}const ee=t.querySelectorAll(K.join(", "));j.shiftKey&&j.target===ee[0]?(EventHelper.stop(j,!0),W.clearFocus()):!j.shiftKey&&isAncestor$1(j.target,ee[ee.length-1])&&(EventHelper.stop(j,!0),ee[0].focus())}break;case 10:j.ctrlKey&&(EventHelper.stop(j,!0),this.getUI().list.toggleHover());break}})),this.ui={container:t,styleSheet:i,leftActionBar:r,titleBar:s,title:o,description1:F,description2:d,widget:A,rightActionBar:a,inlineActionBar:S,checkAll:c,inputContainer:u,filterContainer:f,inputBox:g,visibleCountContainer:m,visibleCount:_,countContainer:v,count:C,okContainer:w,ok:L,message:R,customButtonContainer:I,customButton:N,list:W,progressBar:T,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:j=>this.show(j),hide:()=>this.hide(),setVisibilities:j=>this.setVisibilities(j),setEnabled:j=>this.setEnabled(j),setContextKey:j=>this.options.setContextKey(j),linkOpenerDelegate:j=>this.options.linkOpenerDelegate(j)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,append$1(this._container,this.ui.container))}pick(e,t={},i=CancellationToken.None){return new Promise((s,r)=>{let o=d=>{var u;o=s,(u=t.onKeyMods)==null||u.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){o(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)o(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(o(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(o(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const f=a.items.slice(),g=f.splice(u,1),m=a.activeItems.filter(v=>v!==g[0]),_=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=f,m&&(a.activeItems=m),a.keepScrollPosition=_}}})),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)==null?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{dispose(c),o(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(f=>f.type!=="separator"&&f.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{r(d),a.hide()})})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new QuickPick(t)}createInputBox(){const e=this.getUI(!0);return new InputBox$1(e)}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",reset$1(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Severity$2.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),reset$1(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();backButton.tooltip=s?localize("quickInput.backWithKeybinding","Back ({0})",s):localize("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var r;const t=this.controller;if(!t)return;t.willHide(e);const i=(r=this.ui)==null?void 0:r.container,s=i&&!isAncestorOfActiveElement(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let o=this.previousFocusElement;for(;o&&!o.offsetParent;)o=o.parentElement??void 0;o!=null&&o.offsetParent?(o.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,QuickInputController_1.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:r}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=r?`0 0 8px 2px ${r}`:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const a=o.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},QuickInputController_1=Sl,Sl.MAX_WIDTH=600,Sl);QuickInputController=QuickInputController_1=__decorate$25([__param$25(1,ILayoutService),__param$25(2,IInstantiationService),__param$25(3,IContextKeyService)],QuickInputController);var __decorate$24=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$24=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let QuickInputService=class extends Themable{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(QuickAccessController))),this._quickAccess}constructor(e,t,i,s,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=r,this._onShow=this._register(new Emitter$1),this._onHide=this._register(new Emitter$1),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:r=>this.setContextKey(r),linkOpenerDelegate:r=>{this.instantiationService.invokeFunction(o=>{o.get(IOpenerService).open(r,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(QuickInputHoverDelegate))},s=this._register(this.instantiationService.createInstance(QuickInputController,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(r=>{getWindow(e.activeContainer)===getWindow(s.container)&&s.layout(r,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new RawContextKey(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=CancellationToken.None){return this.controller.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:asCssVariable(quickInputBackground),quickInputForeground:asCssVariable(quickInputForeground),quickInputTitleBackground:asCssVariable(quickInputTitleBackground),widgetBorder:asCssVariable(widgetBorder),widgetShadow:asCssVariable(widgetShadow)},inputBox:defaultInputBoxStyles,toggle:defaultToggleStyles,countBadge:defaultCountBadgeStyles,button:defaultButtonStyles,progressBar:defaultProgressBarStyles,keybindingLabel:defaultKeybindingLabelStyles,list:getListStyles({listBackground:quickInputBackground,listFocusBackground:quickInputListFocusBackground,listFocusForeground:quickInputListFocusForeground,listInactiveFocusForeground:quickInputListFocusForeground,listInactiveSelectionIconForeground:quickInputListFocusIconForeground,listInactiveFocusBackground:quickInputListFocusBackground,listFocusOutline:activeContrastBorder,listInactiveFocusOutline:activeContrastBorder}),pickerGroup:{pickerGroupBorder:asCssVariable(pickerGroupBorder),pickerGroupForeground:asCssVariable(pickerGroupForeground)}}}};QuickInputService=__decorate$24([__param$24(0,IInstantiationService),__param$24(1,IContextKeyService),__param$24(2,IThemeService),__param$24(3,ILayoutService),__param$24(4,IConfigurationService)],QuickInputService);var __decorate$23=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$23=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let EditorScopedQuickInputService=class extends QuickInputService{constructor(e,t,i,s,r,o){super(t,i,s,new EditorScopedLayoutService(e.getContainerDomNode(),r),o),this.host=void 0;const a=QuickInputEditorContribution.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return Event$1.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return Event$1.None},get onDidAddContainer(){return Event$1.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};EditorScopedQuickInputService=__decorate$23([__param$23(1,IInstantiationService),__param$23(2,IContextKeyService),__param$23(3,IThemeService),__param$23(4,ICodeEditorService),__param$23(5,IConfigurationService)],EditorScopedQuickInputService);let StandaloneQuickInputService=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(EditorScopedQuickInputService,e);this.mapEditorToService.set(e,t),createSingleCallFunction(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=CancellationToken.None){return this.activeService.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}};StandaloneQuickInputService=__decorate$23([__param$23(0,IInstantiationService),__param$23(1,ICodeEditorService)],StandaloneQuickInputService);const Xh=class Xh{static get(e){return e.getContribution(Xh.ID)}constructor(e){this.editor=e,this.widget=new QuickInputEditorWidget(this.editor)}dispose(){this.widget.dispose()}};Xh.ID="editor.controller.quickInput";let QuickInputEditorContribution=Xh;const Qh=class Qh{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Qh.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}};Qh.ID="editor.contrib.quickInputWidget";let QuickInputEditorWidget=Qh;registerEditorContribution(QuickInputEditorContribution.ID,QuickInputEditorContribution,4);class ParsedTokenThemeRule{constructor(e,t,i,s,r){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=r}}function parseTokenTheme(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const f=strcmp(d.token,u.token);return f!==0?f:d.index-u.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const r=new ColorMap;for(const d of e)r.getId(d);const o=r.getId(i),a=r.getId(s),l=new ThemeTrieElementRule(t,o,a),c=new ThemeTrieElement(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),r=toStandardTokenType(t);i=(s.metadata|r<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|regexp)\b/;function toStandardTokenType(n){const e=n.match(STANDARD_TOKEN_TYPE_REGEXP);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function strcmp(n,e){return ne?1:0}class ThemeTrieElementRule{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new ThemeTrieElementRule(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class ThemeTrieElement{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const r=this._children.get(i);return typeof r<"u"?r.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const r=e.indexOf(".");let o,a;r===-1?(o=e,a=""):(o=e.substring(0,r),a=e.substring(r+1));let l=this._children.get(o);typeof l>"u"&&(l=new ThemeTrieElement(this._mainRule.clone()),this._children.set(o,l)),l.insert(a,t,i,s)}}function generateTokensCSSForColorMap(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=r=>isString$3(r)?r:void 0;if(i&&Array.isArray(i.src)&&i.src.every(r=>isString$3(r.format)&&isString$3(r.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(r=>({format:r.format,location:URI.parse(r.location)}))}}n.fromJSONObject=t})(IconFontDefinition||(IconFontDefinition={}));class IconRegistry{constructor(){this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:localize("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:localize("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${ThemeIcon.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const r=this.iconsById[e];if(r){if(i&&!r.description){r.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return r}const o={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=o;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(r,o)=>r.id.localeCompare(o.id),t=r=>{for(;ThemeIcon.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of s.filter(o=>!!o.description).sort(e))i.push(`||${r.id}|${ThemeIcon.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const r of s.filter(o=>!ThemeIcon.isThemeIcon(o.defaults)).sort(e))i.push(`||${r.id}|`);return i.join(` +`)}}const iconRegistry=new IconRegistry;Registry.add(Extensions$1.IconContribution,iconRegistry);function registerIcon(n,e,t,i){return iconRegistry.registerIcon(n,e,t,i)}function getIconRegistry(){return iconRegistry}function initialize(){const n=getCodiconFontCharacters();for(const e in n){const t="\\"+n[e].toString(16);iconRegistry.registerIcon(e,{fontCharacter:t})}}initialize();const iconsSchemaId="vscode://schemas/icons",schemaRegistry=Registry.as(Extensions$7.JSONContribution);schemaRegistry.registerSchema(iconsSchemaId,iconRegistry.getIconSchema());const delayer=new RunOnceScheduler(()=>schemaRegistry.notifySchemaChanged(iconsSchemaId),200);iconRegistry.onDidChange(()=>{delayer.isScheduled()||delayer.schedule()});const widgetClose=registerIcon("widget-close",Codicon.close,localize("widgetClose","Icon for the close action in widgets."));registerIcon("goto-previous-location",Codicon.arrowUp,localize("previousChangeIcon","Icon for goto previous editor location."));registerIcon("goto-next-location",Codicon.arrowDown,localize("nextChangeIcon","Icon for goto next editor location."));ThemeIcon.modify(Codicon.sync,"spin");ThemeIcon.modify(Codicon.loading,"spin");function getIconsStyleSheet(n){const e=new DisposableStore,t=e.add(new Emitter$1),i=getIconRegistry();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new UnthemedProductIconTheme,r={},o=[],a=[];for(const l of i.getIcons()){const c=s.getIcon(l);if(!c)continue;const d=c.font,u=`--vscode-icon-${l.id}-font-family`,f=`--vscode-icon-${l.id}-content`;d?(r[d.id]=d.definition,a.push(`${u}: ${asCSSPropertyValue(d.id)};`,`${f}: '${c.fontCharacter}';`),o.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${asCSSPropertyValue(d.id)}; }`)):(a.push(`${f}: '${c.fontCharacter}'; ${u}: 'codicon';`),o.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(const l in r){const c=r[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",f=c.src.map(g=>`${asCSSUrl(g.location)} format('${g.format}')`).join(", ");o.push(`@font-face { src: ${f}; font-family: ${asCSSPropertyValue(l)};${d}${u} font-display: block; }`)}return o.push(`:root { ${a.join(" ")} }`),o.join(` +`)}}}class UnthemedProductIconTheme{getIcon(e){const t=getIconRegistry();let i=e.defaults;for(;ThemeIcon.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const VS_LIGHT_THEME_NAME="vs",VS_DARK_THEME_NAME="vs-dark",HC_BLACK_THEME_NAME="hc-black",HC_LIGHT_THEME_NAME="hc-light",colorRegistry=Registry.as(Extensions$3.ColorContribution),themingRegistry=Registry.as(Extensions$4.ThemingContribution);class StandaloneTheme{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(isBuiltinTheme(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Color.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=getBuiltinRules(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,Color.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=colorRegistry.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case VS_LIGHT_THEME_NAME:return ColorScheme.LIGHT;case HC_BLACK_THEME_NAME:return ColorScheme.HIGH_CONTRAST_DARK;case HC_LIGHT_THEME_NAME:return ColorScheme.HIGH_CONTRAST_LIGHT;default:return ColorScheme.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const r=getBuiltinRules(this.themeData.base);e=r.rules,r.encodedTokensColors&&(t=r.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const r={token:""};i&&(r.foreground=i),s&&(r.background=s),e.push(r)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=TokenTheme.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const r=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=TokenMetadata.getForeground(r),a=TokenMetadata.getFontStyle(r);return{foreground:o,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function isBuiltinTheme(n){return n===VS_LIGHT_THEME_NAME||n===VS_DARK_THEME_NAME||n===HC_BLACK_THEME_NAME||n===HC_LIGHT_THEME_NAME}function getBuiltinRules(n){switch(n){case VS_LIGHT_THEME_NAME:return vs;case VS_DARK_THEME_NAME:return vs_dark;case HC_BLACK_THEME_NAME:return hc_black;case HC_LIGHT_THEME_NAME:return hc_light}}function newBuiltInTheme(n){const e=getBuiltinRules(n);return new StandaloneTheme(n,e)}class StandaloneThemeService extends Disposable{constructor(){super(),this._onColorThemeChange=this._register(new Emitter$1),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new Emitter$1),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new UnthemedProductIconTheme,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(VS_LIGHT_THEME_NAME,newBuiltInTheme(VS_LIGHT_THEME_NAME)),this._knownThemes.set(VS_DARK_THEME_NAME,newBuiltInTheme(VS_DARK_THEME_NAME)),this._knownThemes.set(HC_BLACK_THEME_NAME,newBuiltInTheme(HC_BLACK_THEME_NAME)),this._knownThemes.set(HC_LIGHT_THEME_NAME,newBuiltInTheme(HC_LIGHT_THEME_NAME));const e=this._register(getIconsStyleSheet(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(VS_LIGHT_THEME_NAME),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),addMatchMediaChangeListener(mainWindow,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return isInShadowDOM(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=createStyleSheet(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Disposable.None}_registerShadowDomContainer(e){const t=createStyleSheet(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(VS_LIGHT_THEME_NAME),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=mainWindow.matchMedia("(forced-colors: active)").matches;if(e!==isHighContrast(this._theme.type)){let t;isDark(this._theme.type)?t=e?HC_BLACK_THEME_NAME:VS_DARK_THEME_NAME:t=e?HC_LIGHT_THEME_NAME:VS_LIGHT_THEME_NAME,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};themingRegistry.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const s=[];for(const o of colorRegistry.getColors()){const a=this._theme.getColor(o.id,!0);a&&s.push(`${asCssVariableName(o.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${s.join(` +`)} }`);const r=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(generateTokensCSSForColorMap(r)),this._themeCSS=e.join(` +`),this._updateCSS(),TokenizationRegistry.setColorMap(r),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const IStandaloneThemeService=createDecorator("themeService");var __decorate$22=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$22=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let AccessibilityService=class extends Disposable{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Emitter$1,this._onDidChangeReducedMotion=new Emitter$1,this._onDidChangeLinkUnderline=new Emitter$1,this._accessibilityModeEnabledContext=CONTEXT_ACCESSIBILITY_MODE_ENABLED.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(o=>{o.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),o.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const r=mainWindow.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=r.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(r),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(addDisposableListener(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};AccessibilityService=__decorate$22([__param$22(0,IContextKeyService),__param$22(1,ILayoutService),__param$22(2,IConfigurationService)],AccessibilityService);var __decorate$21=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$21=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PersistedMenuHideState_1,MenuInfo_1;let MenuService=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new PersistedMenuHideState(i)}createMenu(e,t,i){return new MenuImpl(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const s=new MenuImpl(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),r=s.getActions(i);return s.dispose(),r}resetHiddenStates(e){this._hiddenStates.reset(e)}};MenuService=__decorate$21([__param$21(0,ICommandService),__param$21(1,IKeybindingService),__param$21(2,IStorageService)],MenuService);var wl;let PersistedMenuHideState=(wl=class{constructor(e){this._storageService=e,this._disposables=new DisposableStore,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(PersistedMenuHideState_1._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,PersistedMenuHideState_1._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(PersistedMenuHideState_1._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var r;const i=this._isHiddenByDefault(e,t),s=((r=this._data[e.id])==null?void 0:r.includes(t))??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const r=this._data[e.id];if(i)r?r.indexOf(t)<0&&r.push(t):this._data[e.id]=[t];else if(r){const o=r.indexOf(t);o>=0&&removeFastWithoutKeepingOrder(r,o),r.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(PersistedMenuHideState_1._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}},PersistedMenuHideState_1=wl,wl._key="menu.hiddenCommands",wl);PersistedMenuHideState=PersistedMenuHideState_1=__decorate$21([__param$21(0,IStorageService)],PersistedMenuHideState);class MenuInfoSnapshot{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(MenuRegistry.getMenuItems(this._id));let t;for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(MenuInfoSnapshot._fillInKbExprKeys(e.when,this._structureContextKeys),isIMenuItem(e)){if(e.command.precondition&&MenuInfoSnapshot._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;MenuInfoSnapshot._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(MenuRegistry.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let MenuInfo=MenuInfo_1=class extends MenuInfoSnapshot{constructor(e,t,i,s,r,o){super(e,i),this._hiddenStates=t,this._commandService=s,this._keybindingService=r,this._contextKeyService=o,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,r]=i;let o;for(const a of r)if(this._contextKeyService.contextMatchesRules(a.when)){const l=isIMenuItem(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=createMenuHide(this._id,l?a.command:a,this._hiddenStates);if(l){const d=createConfigureKeybindingAction(this._commandService,this._keybindingService,a.command.id,a.when);(o??(o=[])).push(new MenuItemAction(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new MenuInfo_1(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),u=Separator.join(...d.map(f=>f[1]));u.length>0&&(o??(o=[])).push(new SubmenuItemAction(a,c,u))}}o&&o.length>0&&t.push([s,o])}return t}_sort(e){return e.sort(MenuInfo_1._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const r=e.order||0,o=t.order||0;return ro?1:MenuInfo_1._compareTitles(isIMenuItem(e)?e.command.title:e.title,isIMenuItem(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};MenuInfo=MenuInfo_1=__decorate$21([__param$21(3,ICommandService),__param$21(4,IKeybindingService),__param$21(5,IContextKeyService)],MenuInfo);let MenuImpl=class{constructor(e,t,i,s,r,o){this._disposables=new DisposableStore,this._menuInfo=new MenuInfo(e,t,i.emitEventsForSubmenuChanges,s,r,o);const a=new RunOnceScheduler(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(MenuRegistry.onDidChangeMenu(u=>{for(const f of this._menuInfo.allMenuIds)if(u.has(f)){a.schedule();break}}));const l=this._disposables.add(new DisposableStore),c=u=>{let f=!1,g=!1,m=!1;for(const _ of u)if(f=f||_.isStructuralChange,g=g||_.isEnablementChange,m=m||_.isToggleChange,f&&g&&m)break;return{menu:this,isStructuralChange:f,isEnablementChange:g,isToggleChange:m}},d=()=>{l.add(o.onDidChangeContext(u=>{const f=u.affectsSome(this._menuInfo.structureContextKeys),g=u.affectsSome(this._menuInfo.preconditionContextKeys),m=u.affectsSome(this._menuInfo.toggledContextKeys);(f||g||m)&&this._onDidChange.fire({menu:this,isStructuralChange:f,isEnablementChange:g,isToggleChange:m})})),l.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new DebounceEmitter({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};MenuImpl=__decorate$21([__param$21(3,ICommandService),__param$21(4,IKeybindingService),__param$21(5,IContextKeyService)],MenuImpl);function createMenuHide(n,e,t){const i=isISubmenuItem(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,r=toAction({id:`hide/${n.id}/${i}`,label:localize("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),o=toAction({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:r,toggle:o,get isHidden(){return!o.checked}}}function createConfigureKeybindingAction(n,e,t,i=void 0,s=!0){return toAction({id:`configureKeybinding/${t}`,label:localize("configure keybinding","Configure Keybinding"),enabled:s,run(){const o=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;n.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(o?` +when:${o}`:""))}})}var __decorate$20=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$20=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},BrowserClipboardService_1;const vscodeResourcesMime="application/vnd.code.resources";var xl;let BrowserClipboardService=(xl=class extends Disposable{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(isSafari||isWebkitWebView)&&this.installWebKitWriteTextWorkaround(),this._register(Event$1.runAndSubscribe(onDidRegisterWindow,({window:i,disposables:s})=>{s.add(addDisposableListener(i.document,"copy",()=>this.clearResourcesState()))},{window:mainWindow,disposables:this._store}))}installWebKitWriteTextWorkaround(){const e=()=>{const t=new DeferredPromise;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,getActiveWindow().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(Event$1.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(addDisposableListener(t,"click",e)),i.add(addDisposableListener(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.clearResourcesState(),t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return await getActiveWindow().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){const t=getActiveDocument(),i=t.activeElement,s=t.body.appendChild($$e("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),isHTMLElement(i)&&i.focus(),s.remove()}async readText(e){if(e)return this.mapTextToType.get(e)||"";try{return await getActiveWindow().navigator.clipboard.readText()}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async readResources(){try{const t=await getActiveWindow().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${vscodeResourcesMime}`)){const s=await i.getType(`web ${vscodeResourcesMime}`);return JSON.parse(await s.text()).map(o=>URI.from(o))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return hash(e.substring(0,BrowserClipboardService_1.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},BrowserClipboardService_1=xl,xl.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,xl);BrowserClipboardService=BrowserClipboardService_1=__decorate$20([__param$20(0,ILayoutService),__param$20(1,ILogService)],BrowserClipboardService);const IClipboardService=createDecorator("clipboardService");var __decorate$1$=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const KEYBINDING_CONTEXT_ATTR="data-keybinding-context";let Context$2=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};const Zh=class Zh extends Context$2{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}};Zh.INSTANCE=new Zh;let NullContext=Zh;const Ud=class Ud extends Context$2{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=TernarySearchTree.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const r=Array.from(this._values,([o])=>o);this._values.clear(),i.fire(new ArrayContextKeyChangeEvent(r))}else{const r=[];for(const o of s.affectedKeys){const a=`config.${o}`,l=this._values.findSuperstr(a);l!==void 0&&(r.push(...Iterable.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(r.push(a),this._values.delete(a))}i.fire(new ArrayContextKeyChangeEvent(r))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Ud._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Ud._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}};Ud._keyPrefix="config.";let ConfigAwareContextValuesContainer=Ud;class ContextKey{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class SimpleContextKeyChangeEvent{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class ArrayContextKeyChangeEvent{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class CompositeContextKeyChangeEvent{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function allEventKeysInContext(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class AbstractContextKeyService extends Disposable{constructor(e){super(),this._onDidChangeContext=this._register(new PauseableEmitter({merge:t=>new CompositeContextKeyChangeEvent(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ContextKey(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new ScopedContextKeyService(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new SimpleContextKeyChangeEvent(e))}getContext(e){return this._isDisposed?NullContext.INSTANCE:this.getContextValuesContainer(findContextAttr(e))}dispose(){super.dispose(),this._isDisposed=!0}}let ContextKeyService=class extends AbstractContextKeyService{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new ConfigAwareContextValuesContainer(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?NullContext.INSTANCE:this._contexts.get(e)||NullContext.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Context$2(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};ContextKeyService=__decorate$1$([__param$1$(0,IConfigurationService)],ContextKeyService);class ScopedContextKeyService extends AbstractContextKeyService{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new MutableDisposable),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(KEYBINDING_CONTEXT_ATTR)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(KEYBINDING_CONTEXT_ATTR,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;allEventKeysInContext(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(KEYBINDING_CONTEXT_ATTR),super.dispose())}getContextValuesContainer(e){return this._isDisposed?NullContext.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function findContextAttr(n){for(;n;){if(n.hasAttribute(KEYBINDING_CONTEXT_ATTR)){const e=n.getAttribute(KEYBINDING_CONTEXT_ATTR);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function setContext(n,e,t){n.get(IContextKeyService).createKey(String(e),stringifyURIs(t))}function stringifyURIs(n){return cloneAndChange(n,e=>{if(typeof e=="object"&&e.$mid===1)return URI.revive(e).toString();if(e instanceof URI)return e.toString()})}CommandsRegistry.registerCommand("_setContext",setContext);CommandsRegistry.registerCommand({id:"getContextKeyInfo",handler(){return[...RawContextKey.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:localize("getContextKeyInfo","A command that returns information about context keys"),args:[]}});CommandsRegistry.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of RawContextKey.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let Node$1=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Graph{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new Node$1(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} + (-> incoming)[${[...i.incoming.keys()].join(", ")}] + (outgoing ->)[${[...i.outgoing.keys()].join(",")}] +`);return e.join(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const r=this._findCycle(s,t);if(r)return r;t.delete(i)}}}class ServiceCollection{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}const _enableAllTracing=!1;class CyclicDependencyError extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class InstantiationService{constructor(e=new ServiceCollection,t=!1,i,s=_enableAllTracing){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(IInstantiationService,this),this._globalGraph=s?(i==null?void 0:i._globalGraph)??new Graph(r=>r):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,dispose(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)isDisposable(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends InstantiationService{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t==null||t.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=Trace.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:o=>{if(s)throw illegalState("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(o,i);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof SyncDescriptor?(i=Trace.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Trace.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=_util.getServiceDependencies(e).sort((a,l)=>a.index-l.index),r=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),r.push(l)}const o=s.length>0?s[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const a=o-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,o)}return Reflect.construct(e,t.concat(r))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof SyncDescriptor)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var l;const s=new Graph(c=>c.id.toString());let r=0;const o=[{id:e,desc:t,_trace:i}],a=new Set;for(;o.length;){const c=o.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),s.lookupOrInsertNode(c),r++>1e3)throw new CyclicDependencyError(s);for(const d of _util.getServiceDependencies(c.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(d.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(l=this._globalGraph)==null||l.insertEdge(String(c.id),String(d.id)),u instanceof SyncDescriptor){const f={id:d.id,desc:u,_trace:c._trace.branch(d.id,!0)};s.insertEdge(c,f),o.push(f)}}}}for(;;){const c=s.roots();if(c.length===0){if(!s.isEmpty())throw new CyclicDependencyError(s);break}for(const{data:d}of c){if(this._getServiceInstanceOrDescriptor(d.id)instanceof SyncDescriptor){const f=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,f)}s.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,r){if(this._services.get(e)instanceof SyncDescriptor)return this._createServiceInstance(e,t,i,s,r,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,r);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,r,o){if(s){const a=new InstantiationService(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new GlobalIdleValue(()=>{const d=a._createInstance(t,i,r);for(const[u,f]of l){const g=d[u];if(typeof g=="function")for(const m of f)m.disposable=g.apply(d,m.listener)}return l.clear(),o.add(d),d});return new Proxy(Object.create(null),{get(d,u){if(!c.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let m=l.get(u);return m||(m=new LinkedList,l.set(u,m)),(v,C,S)=>{if(c.isInitialized)return c.value[u](v,C,S);{const w={listener:[v,C,S],disposable:void 0},L=m.push(w);return toDisposable(()=>{var N;L(),(N=w.disposable)==null||N.dispose()})}}}if(u in d)return d[u];const f=c.value;let g=f[u];return typeof g!="function"||(g=g.bind(f),d[u]=g),g},set(d,u,f){return c.value[u]=f,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,r);return o.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}const pn=class pn{static traceInvocation(e,t){return e?new pn(2,t.name||new Error().stack.split(` +`).slice(3,4).join(` +`)):pn._None}static traceCreation(e,t){return e?new pn(1,t.name):pn._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new pn(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;pn._totals+=e;let t=!1;function i(r,o){const a=[],l=new Array(r+1).join(" ");for(const[c,d,u]of o._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const f=i(r+1,u);f&&a.push(f)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${pn._totals.toFixed(2)}ms)`];(e>2||t)&&pn.all.add(s.join(` +`))}};pn.all=new Set,pn._None=new class extends pn{constructor(){super(0,null)}stop(){}branch(){return this}},pn._totals=0;let Trace=pn;const unsupportedSchemas=new Set([Schemas.inMemory,Schemas.vscodeSourceControl,Schemas.walkThrough,Schemas.walkThroughSnippet,Schemas.vscodeChatCodeBlock]);class DoubleResourceMap{constructor(){this._byResource=new ResourceMap,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let r=this._byOwner.get(t);r||(r=new ResourceMap,this._byOwner.set(t,r)),r.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const r=this._byResource.get(e);r&&(i=r.delete(t));const o=this._byOwner.get(t);if(o&&(s=o.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i;return typeof e=="string"?((t=this._byOwner.get(e))==null?void 0:t.values())??Iterable.empty():URI.isUri(e)?((i=this._byResource.get(e))==null?void 0:i.values())??Iterable.empty():Iterable.map(Iterable.concat(...this._byOwner.values()),s=>s[1])}}class MarkerStats{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ResourceMap,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(unsupportedSchemas.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===MarkerSeverity$1.Error?t.errors+=1:i===MarkerSeverity$1.Warning?t.warnings+=1:i===MarkerSeverity$1.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class MarkerService{constructor(){this._onMarkerChanged=new DebounceEmitter({delay:0,merge:MarkerService._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new DoubleResourceMap,this._stats=new MarkerStats(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(isFalsyOrEmpty(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const r of i){const o=MarkerService._toMarker(e,t,r);o&&s.push(o)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:r,message:o,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:f,tags:g}=i;if(o)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:s,severity:r,message:o,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:f,tags:g}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const r of s){const o=Iterable.first(r);o&&(i.push(o.resource),this._data.delete(o.resource,e))}if(isNonEmptyArray(t)){const r=new ResourceMap;for(const{resource:o,marker:a}of t){const l=MarkerService._toMarker(e,o,a);if(!l)continue;const c=r.get(o);c?c.push(l):(r.set(o,[l]),i.push(o))}for(const[o,a]of r)this._data.set(o,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:r}=e;if((!r||r<0)&&(r=-1),t&&i){const o=this._data.get(i,t);if(o){const a=[];for(const l of o)if(MarkerService._accept(l,s)){const c=a.push(l);if(r>0&&c===r)break}return a}else return[]}else if(!t&&!i){const o=[];for(const a of this._data.values())for(const l of a)if(MarkerService._accept(l,s)){const c=o.push(l);if(r>0&&c===r)return o}return o}else{const o=this._data.values(i??t),a=[];for(const l of o)for(const c of l)if(MarkerService._accept(c,s)){const d=a.push(c);if(r>0&&d===r)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new ResourceMap;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class DefaultConfiguration extends Disposable{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=ConfigurationModel.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=ConfigurationModel.createEmptyModel(this.logService);const e=Registry.as(Extensions$6.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const r=i[s],o=t[s];r!==void 0?this._configurationModel.setValue(s,r):o?this._configurationModel.setValue(s,o.default):this._configurationModel.removeValue(s)}}}const IAccessibilitySignalService=createDecorator("accessibilitySignalService"),xt=class xt{static register(e){return new xt(e.fileName)}constructor(e){this.fileName=e}};xt.error=xt.register({fileName:"error.mp3"}),xt.warning=xt.register({fileName:"warning.mp3"}),xt.success=xt.register({fileName:"success.mp3"}),xt.foldedArea=xt.register({fileName:"foldedAreas.mp3"}),xt.break=xt.register({fileName:"break.mp3"}),xt.quickFixes=xt.register({fileName:"quickFixes.mp3"}),xt.taskCompleted=xt.register({fileName:"taskCompleted.mp3"}),xt.taskFailed=xt.register({fileName:"taskFailed.mp3"}),xt.terminalBell=xt.register({fileName:"terminalBell.mp3"}),xt.diffLineInserted=xt.register({fileName:"diffLineInserted.mp3"}),xt.diffLineDeleted=xt.register({fileName:"diffLineDeleted.mp3"}),xt.diffLineModified=xt.register({fileName:"diffLineModified.mp3"}),xt.chatRequestSent=xt.register({fileName:"chatRequestSent.mp3"}),xt.chatResponseReceived1=xt.register({fileName:"chatResponseReceived1.mp3"}),xt.chatResponseReceived2=xt.register({fileName:"chatResponseReceived2.mp3"}),xt.chatResponseReceived3=xt.register({fileName:"chatResponseReceived3.mp3"}),xt.chatResponseReceived4=xt.register({fileName:"chatResponseReceived4.mp3"}),xt.clear=xt.register({fileName:"clear.mp3"}),xt.save=xt.register({fileName:"save.mp3"}),xt.format=xt.register({fileName:"format.mp3"}),xt.voiceRecordingStarted=xt.register({fileName:"voiceRecordingStarted.mp3"}),xt.voiceRecordingStopped=xt.register({fileName:"voiceRecordingStopped.mp3"}),xt.progress=xt.register({fileName:"progress.mp3"});let Sound=xt;class SoundSource{constructor(e){this.randomOneOf=e}}const pt=class pt{constructor(e,t,i,s,r,o){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=r,this.announcementMessage=o}static register(e){const t=new SoundSource("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new pt(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage);return pt._signals.add(i),i}};pt._signals=new Set,pt.errorAtPosition=pt.register({name:localize("accessibilitySignals.positionHasError.name","Error at Position"),sound:Sound.error,announcementMessage:localize("accessibility.signals.positionHasError","Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),pt.warningAtPosition=pt.register({name:localize("accessibilitySignals.positionHasWarning.name","Warning at Position"),sound:Sound.warning,announcementMessage:localize("accessibility.signals.positionHasWarning","Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),pt.errorOnLine=pt.register({name:localize("accessibilitySignals.lineHasError.name","Error on Line"),sound:Sound.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:localize("accessibility.signals.lineHasError","Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),pt.warningOnLine=pt.register({name:localize("accessibilitySignals.lineHasWarning.name","Warning on Line"),sound:Sound.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:localize("accessibility.signals.lineHasWarning","Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),pt.foldedArea=pt.register({name:localize("accessibilitySignals.lineHasFoldedArea.name","Folded Area on Line"),sound:Sound.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:localize("accessibility.signals.lineHasFoldedArea","Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),pt.break=pt.register({name:localize("accessibilitySignals.lineHasBreakpoint.name","Breakpoint on Line"),sound:Sound.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:localize("accessibility.signals.lineHasBreakpoint","Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),pt.inlineSuggestion=pt.register({name:localize("accessibilitySignals.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Sound.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),pt.terminalQuickFix=pt.register({name:localize("accessibilitySignals.terminalQuickFix.name","Terminal Quick Fix"),sound:Sound.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:localize("accessibility.signals.terminalQuickFix","Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),pt.onDebugBreak=pt.register({name:localize("accessibilitySignals.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Sound.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:localize("accessibility.signals.onDebugBreak","Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),pt.noInlayHints=pt.register({name:localize("accessibilitySignals.noInlayHints","No Inlay Hints on Line"),sound:Sound.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:localize("accessibility.signals.noInlayHints","No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),pt.taskCompleted=pt.register({name:localize("accessibilitySignals.taskCompleted","Task Completed"),sound:Sound.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:localize("accessibility.signals.taskCompleted","Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),pt.taskFailed=pt.register({name:localize("accessibilitySignals.taskFailed","Task Failed"),sound:Sound.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:localize("accessibility.signals.taskFailed","Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),pt.terminalCommandFailed=pt.register({name:localize("accessibilitySignals.terminalCommandFailed","Terminal Command Failed"),sound:Sound.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:localize("accessibility.signals.terminalCommandFailed","Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),pt.terminalCommandSucceeded=pt.register({name:localize("accessibilitySignals.terminalCommandSucceeded","Terminal Command Succeeded"),sound:Sound.success,announcementMessage:localize("accessibility.signals.terminalCommandSucceeded","Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),pt.terminalBell=pt.register({name:localize("accessibilitySignals.terminalBell","Terminal Bell"),sound:Sound.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:localize("accessibility.signals.terminalBell","Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),pt.notebookCellCompleted=pt.register({name:localize("accessibilitySignals.notebookCellCompleted","Notebook Cell Completed"),sound:Sound.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:localize("accessibility.signals.notebookCellCompleted","Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),pt.notebookCellFailed=pt.register({name:localize("accessibilitySignals.notebookCellFailed","Notebook Cell Failed"),sound:Sound.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:localize("accessibility.signals.notebookCellFailed","Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),pt.diffLineInserted=pt.register({name:localize("accessibilitySignals.diffLineInserted","Diff Line Inserted"),sound:Sound.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),pt.diffLineDeleted=pt.register({name:localize("accessibilitySignals.diffLineDeleted","Diff Line Deleted"),sound:Sound.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),pt.diffLineModified=pt.register({name:localize("accessibilitySignals.diffLineModified","Diff Line Modified"),sound:Sound.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),pt.chatRequestSent=pt.register({name:localize("accessibilitySignals.chatRequestSent","Chat Request Sent"),sound:Sound.chatRequestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:localize("accessibility.signals.chatRequestSent","Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),pt.chatResponseReceived=pt.register({name:localize("accessibilitySignals.chatResponseReceived","Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Sound.chatResponseReceived1,Sound.chatResponseReceived2,Sound.chatResponseReceived3,Sound.chatResponseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),pt.progress=pt.register({name:localize("accessibilitySignals.progress","Progress"),sound:Sound.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:localize("accessibility.signals.progress","Progress"),settingsKey:"accessibility.signals.progress"}),pt.clear=pt.register({name:localize("accessibilitySignals.clear","Clear"),sound:Sound.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:localize("accessibility.signals.clear","Clear"),settingsKey:"accessibility.signals.clear"}),pt.save=pt.register({name:localize("accessibilitySignals.save","Save"),sound:Sound.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:localize("accessibility.signals.save","Save"),settingsKey:"accessibility.signals.save"}),pt.format=pt.register({name:localize("accessibilitySignals.format","Format"),sound:Sound.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:localize("accessibility.signals.format","Format"),settingsKey:"accessibility.signals.format"}),pt.voiceRecordingStarted=pt.register({name:localize("accessibilitySignals.voiceRecordingStarted","Voice Recording Started"),sound:Sound.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),pt.voiceRecordingStopped=pt.register({name:localize("accessibilitySignals.voiceRecordingStopped","Voice Recording Stopped"),sound:Sound.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"});let AccessibilitySignal=pt;class LogService extends Disposable{constructor(e,t=[]){super(),this.logger=new MultiplexLogger([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const editorFeatures=[];function registerEditorFeature(n){editorFeatures.push(n)}function getEditorFeatures(){return editorFeatures.slice(0)}class StandaloneTreeSitterParserService{getParseResult(e){}}var __decorate$1_=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class SimpleModel{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new Emitter$1}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let StandaloneTextModelService=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new ImmortalReference(new SimpleModel(t))):Promise.reject(new Error("Model not found"))}};StandaloneTextModelService=__decorate$1_([__param$1_(0,IModelService)],StandaloneTextModelService);const Jh=class Jh{show(){return Jh.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};Jh.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let StandaloneEditorProgressService=Jh;class StandaloneProgressService{withProgress(e,t,i){return t({report:()=>{}})}}class StandaloneEnvironmentService{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class StandaloneDialogService{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` + +`+t),mainWindow.confirm(i)}async prompt(e){var s;let t;if(this.doConfirm(e.message,e.detail)){const r=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),t=await((s=r[0])==null?void 0:s.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:Severity$2.Error,message:e,detail:t})}}const eu=class eu{info(e){return this.notify({severity:Severity$2.Info,message:e})}warn(e){return this.notify({severity:Severity$2.Warning,message:e})}error(e){return this.notify({severity:Severity$2.Error,message:e})}notify(e){switch(e.severity){case Severity$2.Error:console.error(e.message);break;case Severity$2.Warning:console.warn(e.message);break;default:console.log(e.message);break}return eu.NO_OP}prompt(e,t,i,s){return eu.NO_OP}status(e,t){return Disposable.None}};eu.NO_OP=new NoOpNotification;let StandaloneNotificationService=eu,StandaloneCommandService=class{constructor(e){this._onWillExecuteCommand=new Emitter$1,this._onDidExecuteCommand=new Emitter$1,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=CommandsRegistry.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};StandaloneCommandService=__decorate$1_([__param$1_(0,IInstantiationService)],StandaloneCommandService);let StandaloneKeybindingService=class extends AbstractKeybindingService{constructor(e,t,i,s,r,o){super(e,t,i,s,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const m=new DisposableStore;m.add(addDisposableListener(g,EventType$1.KEY_DOWN,_=>{const v=new StandardKeyboardEvent(_);this._dispatch(v,v.target)&&(v.preventDefault(),v.stopPropagation())})),m.add(addDisposableListener(g,EventType$1.KEY_UP,_=>{const v=new StandardKeyboardEvent(_);this._singleModifierDispatch(v,v.target)&&v.preventDefault()})),this._domNodeListeners.push(new DomNodeListeners(g,m))},l=g=>{for(let m=0;m{g.getOption(61)||a(g.getContainerDomNode())},d=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(o.onCodeEditorAdd(c)),this._register(o.onCodeEditorRemove(d)),o.listCodeEditors().forEach(c);const u=g=>{a(g.getContainerDomNode())},f=g=>{l(g.getContainerDomNode())};this._register(o.onDiffEditorAdd(u)),this._register(o.onDiffEditorRemove(f)),o.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,s){return combinedDisposable(CommandsRegistry.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:decodeKeybinding(i.keybinding,OS$1),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),toDisposable(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return mainWindow.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const r of e){const o=r.when||void 0,a=r.keybinding;if(!a)i[s++]=new ResolvedKeybindingItem(void 0,r.command,r.commandArgs,o,t,null,!1);else{const l=USLayoutResolvedKeybinding.resolveKeybinding(a,OS$1);for(const c of l)i[s++]=new ResolvedKeybindingItem(c,r.command,r.commandArgs,o,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new KeyCodeChord(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new USLayoutResolvedKeybinding([t],OS$1)}};StandaloneKeybindingService=__decorate$1_([__param$1_(0,IContextKeyService),__param$1_(1,ICommandService),__param$1_(2,ITelemetryService),__param$1_(3,INotificationService),__param$1_(4,ILogService),__param$1_(5,ICodeEditorService)],StandaloneKeybindingService);class DomNodeListeners extends Disposable{constructor(e,t){super(),this.domNode=e,this._register(t)}}function isConfigurationOverrides(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof URI)}let StandaloneConfigurationService=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new Emitter$1,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new DefaultConfiguration(e);this._configuration=new Configuration(t.reload(),ConfigurationModel.createEmptyModel(e),ConfigurationModel.createEmptyModel(e),ConfigurationModel.createEmptyModel(e),ConfigurationModel.createEmptyModel(e),ConfigurationModel.createEmptyModel(e),new ResourceMap,ConfigurationModel.createEmptyModel(e),new ResourceMap,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=isConfigurationOverrides(e)?e:isConfigurationOverrides(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[r,o]=s;this.getValue(r)!==o&&(this._configuration.updateValue(r,o),i.push(r))}if(i.length>0){const s=new ConfigurationChangeEvent({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=8,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};StandaloneConfigurationService=__decorate$1_([__param$1_(0,ILogService)],StandaloneConfigurationService);let StandaloneResourceConfigurationService=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new Emitter$1,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(r,o)=>s.affectsConfiguration(o)})})}getValue(e,t,i){const s=Position$1.isIPosition(t)?t:null,r=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,o=e?this.getLanguage(e,s):void 0;return typeof r>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};StandaloneResourceConfigurationService=__decorate$1_([__param$1_(0,IConfigurationService),__param$1_(1,IModelService),__param$1_(2,ILanguageService)],StandaloneResourceConfigurationService);let StandaloneResourcePropertiesService=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:isLinux||isMacintosh?` +`:`\r +`}};StandaloneResourcePropertiesService=__decorate$1_([__param$1_(0,IConfigurationService)],StandaloneResourcePropertiesService);class StandaloneTelemetryService{publicLog2(){}}const tu=class tu{constructor(){const e=URI.from({scheme:tu.SCHEME,authority:"model",path:"/"});this.workspace={id:STANDALONE_EDITOR_WORKSPACE_ID,folders:[new WorkspaceFolder({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===tu.SCHEME?this.workspace.folders[0]:null}};tu.SCHEME="inmemory";let StandaloneWorkspaceContextService=tu;function updateConfigurationService(n,e,t){if(!e||!(n instanceof StandaloneConfigurationService))return;const i=[];Object.keys(e).forEach(s=>{isEditorConfigurationKey(s)&&i.push([`editor.${s}`,e[s]]),t&&isDiffEditorConfigurationKey(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let StandaloneBulkEditService=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:ResourceEdit.convert(e),s=new Map;for(const a of i){if(!(a instanceof ResourceTextEdit))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=s.get(l);c||(c=[],s.set(l,c)),c.push(EditOperation.replaceMove(Range$2.lift(a.textEdit.range),a.textEdit.text))}let r=0,o=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),o+=1,r+=l.length;return{ariaSummary:format$1(StandaloneServicesNLS.bulkEditServiceSummary,r,o),isApplied:r>0}}};StandaloneBulkEditService=__decorate$1_([__param$1_(0,IModelService)],StandaloneBulkEditService);class StandaloneUriLabelService{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return basename$1(e)}}let StandaloneContextViewService=class extends ContextViewService{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};StandaloneContextViewService=__decorate$1_([__param$1_(0,ILayoutService),__param$1_(1,ICodeEditorService)],StandaloneContextViewService);class StandaloneWorkspaceTrustManagementService{constructor(){this._neverEmitter=new Emitter$1,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class StandaloneLanguageService extends LanguageService{constructor(){super()}}class StandaloneLogService extends LogService{constructor(){super(new ConsoleLogger)}}let StandaloneContextMenuService=class extends ContextMenuService{constructor(e,t,i,s,r,o){super(e,t,i,s,r,o),this.configure({blockMouse:!1})}};StandaloneContextMenuService=__decorate$1_([__param$1_(0,ITelemetryService),__param$1_(1,INotificationService),__param$1_(2,IContextViewService),__param$1_(3,IKeybindingService),__param$1_(4,IMenuService),__param$1_(5,IContextKeyService)],StandaloneContextMenuService);const standaloneEditorWorkerDescriptor={amdModuleId:"vs/editor/common/services/editorSimpleWorker",esmModuleLocation:void 0,label:"editorWorkerService"};let StandaloneEditorWorkerService=class extends EditorWorkerService{constructor(e,t,i,s,r){super(standaloneEditorWorkerDescriptor,e,t,i,s,r)}};StandaloneEditorWorkerService=__decorate$1_([__param$1_(0,IModelService),__param$1_(1,ITextResourceConfigurationService),__param$1_(2,ILogService),__param$1_(3,ILanguageConfigurationService),__param$1_(4,ILanguageFeaturesService)],StandaloneEditorWorkerService);class StandaloneAccessbilitySignalService{async playSignal(e,t){}}registerSingleton(ILogService,StandaloneLogService,0);registerSingleton(IConfigurationService,StandaloneConfigurationService,0);registerSingleton(ITextResourceConfigurationService,StandaloneResourceConfigurationService,0);registerSingleton(ITextResourcePropertiesService,StandaloneResourcePropertiesService,0);registerSingleton(IWorkspaceContextService,StandaloneWorkspaceContextService,0);registerSingleton(ILabelService,StandaloneUriLabelService,0);registerSingleton(ITelemetryService,StandaloneTelemetryService,0);registerSingleton(IDialogService,StandaloneDialogService,0);registerSingleton(IEnvironmentService,StandaloneEnvironmentService,0);registerSingleton(INotificationService,StandaloneNotificationService,0);registerSingleton(IMarkerService,MarkerService,0);registerSingleton(ILanguageService,StandaloneLanguageService,0);registerSingleton(IStandaloneThemeService,StandaloneThemeService,0);registerSingleton(IModelService,ModelService,0);registerSingleton(IMarkerDecorationsService,MarkerDecorationsService,0);registerSingleton(IContextKeyService,ContextKeyService,0);registerSingleton(IProgressService,StandaloneProgressService,0);registerSingleton(IEditorProgressService,StandaloneEditorProgressService,0);registerSingleton(IStorageService,InMemoryStorageService,0);registerSingleton(IEditorWorkerService,StandaloneEditorWorkerService,0);registerSingleton(IBulkEditService,StandaloneBulkEditService,0);registerSingleton(IWorkspaceTrustManagementService,StandaloneWorkspaceTrustManagementService,0);registerSingleton(ITextModelService,StandaloneTextModelService,0);registerSingleton(IAccessibilityService,AccessibilityService,0);registerSingleton(IListService,ListService,0);registerSingleton(ICommandService,StandaloneCommandService,0);registerSingleton(IKeybindingService,StandaloneKeybindingService,0);registerSingleton(IQuickInputService,StandaloneQuickInputService,0);registerSingleton(IContextViewService,StandaloneContextViewService,0);registerSingleton(IOpenerService,OpenerService,0);registerSingleton(IClipboardService,BrowserClipboardService,0);registerSingleton(IContextMenuService,StandaloneContextMenuService,0);registerSingleton(IMenuService,MenuService,0);registerSingleton(IAccessibilitySignalService,StandaloneAccessbilitySignalService,0);registerSingleton(ITreeSitterParserService,StandaloneTreeSitterParserService,0);var StandaloneServices;(function(n){const e=new ServiceCollection;for(const[l,c]of getSingletonServiceDescriptors())e.set(l,c);const t=new InstantiationService(e,!0);e.set(IInstantiationService,t);function i(l){s||o({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof SyncDescriptor?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const r=new Emitter$1;function o(l){if(s)return t;s=!0;for(const[d,u]of getSingletonServiceDescriptors())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=createDecorator(d);e.get(u)instanceof SyncDescriptor&&e.set(u,l[d])}const c=getEditorFeatures();for(const d of c)try{t.createInstance(d)}catch(u){onUnexpectedError(u)}return r.fire(),t}n.initialize=o;function a(l){if(s)return l();const c=new DisposableStore,d=c.add(r.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(StandaloneServices||(StandaloneServices={}));function createWebWorker$1(n,e){return new MonacoWebWorkerImpl(n,e)}class MonacoWebWorkerImpl extends EditorWorkerClient{constructor(e,t){const i={amdModuleId:standaloneEditorWorkerDescriptor.amdModuleId,esmModuleLocation:standaloneEditorWorkerDescriptor.esmModuleLocation,label:t.label};super(i,t.keepIdleModels||!1,e),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?getAllMethodNames(this._foreignModuleHost):[];return e.$loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,l)=>e.$fmr(a,l),r=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},o={};for(const a of i)o[a]=r(a,s);return o})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this.workerWithSyncedResources(e).then(t=>this.getProxy())}}const EditorType={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class LineDecoration{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let r=0;r=r||(a[l++]=new LineDecoration(Math.max(1,c.startColumn-s+1),Math.min(o+1,c.endColumn-s+1),c.className,c.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const r=[];let o=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,f=d.endLineNumber===t?d.endColumn:s;r[o++]=new LineDecoration(u,f,c.inlineClassName,c.type)}return r}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=LineDecoration._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class LineDecorationsNormalizer{static normalize(e,t){if(t.length===0)return[];const i=[],s=new Stack;let r=0;for(let o=0,a=t.length;o1){const _=e.charCodeAt(c-2);isHighSurrogate(_)&&c--}if(d>1){const _=e.charCodeAt(d-2);isHighSurrogate(_)&&d--}const g=c-1,m=d-2;r=s.consumeLowerThan(g,r,i),s.count===0&&(r=g),s.insert(m,u,f)}return s.consumeLowerThan(1073741824,r,i),i}}class LinePart{constructor(e,t,i,s){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class LineRange{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class RenderLineInput{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g,m,_,v,C,S,w){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=r,this.containsRTL=o,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(LineDecoration.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=f,this.stopRenderingLineAfter=_,this.renderWhitespace=v==="all"?4:v==="boundary"?1:v==="selection"?2:v==="trailing"?3:0,this.renderControlCharacters=C,this.fontLigatures=S,this.selectionsOnLine=w&&w.sort((N,R)=>N.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const r=(t<<16|i<<0)>>>0;this._data[e-1]=r,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=CharacterMapping.getPartIndex(t),s=CharacterMapping.getCharIndex(t);return new DomPosition(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<<16|i<<0)>>>0;let r=0,o=this.length-1;for(;r+1>>1,v=this._data[_];if(v===s)return _;v>s?o=_:r=_}if(r===o)return r;const a=this._data[r],l=this._data[o];if(a===s)return r;if(l===s)return o;const c=CharacterMapping.getPartIndex(a),d=CharacterMapping.getCharIndex(a),u=CharacterMapping.getPartIndex(l);let f;c!==u?f=t:f=CharacterMapping.getCharIndex(l);const g=i-d,m=f-i;return g<=m?r:o}}class RenderLineOutput{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function renderViewLine(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,s=0;for(const o of n.lineDecorations)(o.type===1||o.type===2)&&(e.appendString(''),o.type===1&&(s|=1,t++),o.type===2&&(s|=2,i++));e.appendString("");const r=new CharacterMapping(1,t+i);return r.setColumnInfo(1,t,0,0),new RenderLineOutput(r,!1,s)}return e.appendString(""),new RenderLineOutput(new CharacterMapping(0,0),!1,0)}return _renderLine(resolveRenderLineInput(n),e)}class RenderLineOutput2{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function renderViewLine2(n){const e=new StringBuilder(1e4),t=renderViewLine(n,e);return new RenderLineOutput2(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class ResolvedRenderLineInput{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g,m,_,v){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=r,this.overflowingCharCount=o,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=f,this.spaceWidth=g,this.renderSpaceCharCode=m,this.renderWhitespace=_,this.renderControlCharacters=v}}function resolveRenderLineInput(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(r[o++]=new LinePart(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const g=e?containsRTL(n.substring(a,s)):!1;r[o++]=new LinePart(s,u,0,g);break}const f=e?containsRTL(n.substring(a,d)):!1;r[o++]=new LinePart(d,u,0,f),a=d}return r}function splitLargeTokens(n,e,t){let i=0;const s=[];let r=0;if(t)for(let o=0,a=e.length;o=50&&(s[r++]=new LinePart(g+1,d,u,f),m=g+1,g=-1);m!==c&&(s[r++]=new LinePart(c,d,u,f))}else s[r++]=l;i=c}else for(let o=0,a=e.length;o50){const u=l.type,f=l.metadata,g=l.containsRTL,m=Math.ceil(d/50);for(let _=1;_=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function extractControlCharacters(n,e){const t=[];let i=new LinePart(0,"",0,!1),s=0;for(const r of e){const o=r.endIndex;for(;si.endIndex&&(i=new LinePart(s,r.type,r.metadata,r.containsRTL),t.push(i)),i=new LinePart(s+1,"mtkcontrol",r.metadata,!1),t.push(i))}s>i.endIndex&&(i=new LinePart(o,r.type,r.metadata,r.containsRTL),t.push(i))}return t}function _applyRenderWhitespace(n,e,t,i){const s=n.continuesWithWrappedLine,r=n.fauxIndentLength,o=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,u=n.renderWhitespace===3,f=n.renderSpaceWidth!==n.spaceWidth,g=[];let m=0,_=0,v=i[_].type,C=i[_].containsRTL,S=i[_].endIndex;const w=i.length;let L=!1,I=firstNonWhitespaceIndex(e),N;I===-1?(L=!0,I=t,N=t):N=lastNonWhitespaceIndex(e);let R=!1,T=0,A=c&&c[T],F=a%o;for(let W=r;W=A.endOffset&&(T++,A=c&&c[T]);let j;if(WN)j=!0;else if(G===9)j=!0;else if(G===32)if(d)if(R)j=!0;else{const K=W+1W),j&&u&&(j=L||W>N),j&&C&&W>=I&&W<=N&&(j=!1),R){if(!j||!l&&F>=o){if(f){const K=m>0?g[m-1].endIndex:r;for(let ee=K+1;ee<=W;ee++)g[m++]=new LinePart(ee,"mtkw",1,!1)}else g[m++]=new LinePart(W,"mtkw",1,!1);F=F%o}}else(W===S||j&&W>r)&&(g[m++]=new LinePart(W,v,0,C),F=F%o);for(G===9?F=o:isFullWidthCharacter(G)?F+=2:F++,R=j;W===S&&(_++,_0?e.charCodeAt(t-1):0,G=t>1?e.charCodeAt(t-2):0;W===32&&G!==32&&G!==9||(B=!0)}else B=!0;if(B)if(f){const W=m>0?g[m-1].endIndex:r;for(let G=W+1;G<=t;G++)g[m++]=new LinePart(G,"mtkw",1,!1)}else g[m++]=new LinePart(t,"mtkw",1,!1);else g[m++]=new LinePart(t,v,0,C);return g}function _applyInlineDecorations(n,e,t,i){i.sort(LineDecoration.compare);const s=LineDecorationsNormalizer.normalize(n,i),r=s.length;let o=0;const a=[];let l=0,c=0;for(let u=0,f=t.length;uc&&(c=S.startOffset,a[l++]=new LinePart(c,_,v,C)),S.endOffset+1<=m)c=S.endOffset+1,a[l++]=new LinePart(c,_+" "+S.className,v|S.metadata,C),o++;else{c=m,a[l++]=new LinePart(c,_+" "+S.className,v|S.metadata,C);break}}m>c&&(c=m,a[l++]=new LinePart(c,_,v,C))}const d=t[t.length-1].endIndex;if(o'):e.appendString("");for(let A=0,F=c.length;A=d&&(ce+=Ce)}}for(ee&&(e.appendString(' style="width:'),e.appendString(String(m*q)),e.appendString('px"')),e.appendASCIICharCode(62);L1?e.appendCharCode(8594):e.appendCharCode(65515);for(let Ce=2;Ce<=ie;Ce++)e.appendCharCode(160)}else ce=2,ie=1,e.appendCharCode(_),e.appendCharCode(8204);N+=ce,R+=ie,L>=d&&(I+=ie)}}else for(e.appendASCIICharCode(62);L=d&&(I+=ce)}U?T++:T=0,L>=o&&!w&&B.isPseudoAfter()&&(w=!0,S.setColumnInfo(L+1,A,N,R)),e.appendString("")}return w||S.setColumnInfo(o+1,c.length-1,N,R),a&&(e.appendString(''),e.appendString(localize("showMore","Show more ({0})",renderOverflowingCharCount(l))),e.appendString("")),e.appendString(""),new RenderLineOutput(S,g,s)}function to4CharHex(n){return n.toString(16).toUpperCase().padStart(4,"0")}function renderOverflowingCharCount(n){return n<1024?localize("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class Viewport{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class MinimapLinesRenderingData{constructor(e,t){this.tabSize=e,this.data=t}}class ViewLineData{constructor(e,t,i,s,r,o,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=r,this.tokens=o,this.inlineDecorations=a}}class ViewLineRenderingData{constructor(e,t,i,s,r,o,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=ViewLineRenderingData.isBasicASCII(i,o),this.containsRTL=ViewLineRenderingData.containsRTL(i,this.isBasicASCII,r),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?isBasicASCII(e):!0}static containsRTL(e,t,i){return!t&&i?containsRTL(e):!1}}class InlineDecoration{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class SingleLineInlineDecoration{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new InlineDecoration(new Range$2(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class ViewModelDecoration{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class OverviewRulerDecorationsGroup{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&equals$1(e.data,t.data)}static equalsArr(e,t){return equals$1(e,t,OverviewRulerDecorationsGroup.equals)}}function isFuzzyActionArr(n){return Array.isArray(n)}function isFuzzyAction(n){return!isFuzzyActionArr(n)}function isString$2(n){return typeof n=="string"}function isIAction(n){return!isString$2(n)}function empty(n){return!n}function fixCase(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function sanitize(n){return n.replace(/[&<>'"_]/g,"-")}function log(n,e){console.log(`${n.languageId}: ${e}`)}function createError(n,e){return new Error(`${n.languageId}: ${e}`)}function substituteMatches(n,e,t,i,s){const r=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let o=null;return e.replace(r,function(a,l,c,d,u,f,g,m,_){return empty(c)?empty(d)?!empty(u)&&u0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function stateExists(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var __decorate$1Z=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1Z=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MonarchTokenizer_1;const CACHE_STACK_DEPTH=5,Qf=class Qf{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new MonarchStackElement(e,t);let i=MonarchStackElement.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new MonarchStackElement(e,t),this._entries[i]=s,s)}};Qf._INSTANCE=new Qf(CACHE_STACK_DEPTH);let MonarchStackElementFactory=Qf;class MonarchStackElement{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return MonarchStackElement._equals(this,e)}push(e){return MonarchStackElementFactory.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return MonarchStackElementFactory.create(this.parent,e)}}class EmbeddedLanguageData{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new EmbeddedLanguageData(this.languageId,this.state)}}const Zf=class Zf{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new MonarchLineState(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new MonarchLineState(e,t);const i=MonarchStackElement.getStackElementId(e);let s=this._entries[i];return s||(s=new MonarchLineState(e,null),this._entries[i]=s,s)}};Zf._INSTANCE=new Zf(CACHE_STACK_DEPTH);let MonarchLineStateFactory=Zf;class MonarchLineState{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:MonarchLineStateFactory.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof MonarchLineState)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class MonarchClassicTokensCollector{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Token$2(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const r=i.languageId,o=i.state,a=TokenizationRegistry.get(r);if(!a)return this.enterLanguage(r),this.emit(s,""),o;const l=a.tokenize(e,t,o);if(s!==0)for(const c of l.tokens)this._tokens.push(new Token$2(c.offset+s,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new TokenizationResult(this._tokens,e)}}class MonarchModernTokensCollector{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,r=t.length,o=i!==null?i.length:0;if(s===0&&r===0&&o===0)return new Uint32Array(0);if(s===0&&r===0)return i;if(r===0&&o===0)return e;const a=new Uint32Array(s+r+o);e!==null&&a.set(e);for(let l=0;l{if(o)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=TokenizationRegistry.get(t);if(i){if(i instanceof MonarchTokenizer_1){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}TokenizationRegistry.isResolved(t)||e.push(TokenizationRegistry.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=MonarchStackElementFactory.create(null,this._lexer.start);return MonarchLineStateFactory.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return nullTokenize(this._languageId,i);const s=new MonarchClassicTokensCollector,r=this._tokenize(e,t,i,s);return s.finalize(r)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return nullTokenizeEncoded(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new MonarchModernTokensCollector(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),r=this._tokenize(e,t,i,s);return s.finalize(r)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=findRules(this._lexer,t.stack.state),!i))throw createError(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,r=!1;for(const o of i){if(!isIAction(o.action)||o.action.nextEmbedded!=="@pop")continue;r=!0;let a=o.resolveRegex(t.stack.state);const l=a.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&o.matchOnlyAtLineStart||(s===-1||c0&&r.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const l=e.substring(o);return this._myTokenize(l,t,i,s+o,r)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,r){r.enterLanguage(this._languageId);const o=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,f=null,g=!0;for(;g||u=l)break;g=!1;let A=this._lexer.tokenizer[C];if(!A&&(A=findRules(this._lexer,C),!A))throw createError(this._lexer,"tokenizer state is not defined: "+C);const F=a.substr(u);for(const B of A)if((u===0||!B.matchOnlyAtLineStart)&&(S=F.match(B.resolveRegex(C)),S)){w=S[0],L=B.action;break}}if(S||(S=[""],w=""),L||(u=this._lexer.maxStack)throw createError(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(C)}else if(L.next==="@pop"){if(d.depth<=1)throw createError(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(I));d=d.pop()}else if(L.next==="@popall")d=d.popall();else{let A=substituteMatches(this._lexer,L.next,w,S,C);if(A[0]==="@"&&(A=A.substr(1)),findRules(this._lexer,A))d=d.push(A);else throw createError(this._lexer,"trying to set a next state '"+A+"' that is undefined in rule: "+this._safeRuleName(I))}}L.log&&typeof L.log=="string"&&log(this._lexer,this._lexer.languageId+": "+substituteMatches(this._lexer,L.log,w,S,C))}if(R===null)throw createError(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(I));const T=A=>{const F=this._languageService.getLanguageIdByLanguageName(A)||this._languageService.getLanguageIdByMimeType(A)||A,B=this._getNestedEmbeddedLanguageData(F);if(u0)throw createError(this._lexer,"groups cannot be nested: "+this._safeRuleName(I));if(S.length!==R.length+1)throw createError(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(I));let A=0;for(let F=1;Fn});class Colorizer{static colorizeElement(e,t,i,s){s=s||{};const r=s.theme||"vs",o=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(o)||o;e.setTheme(r);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+r;const c=d=>{const u=(ttPolicy$3==null?void 0:ttPolicy$3.createHTML(d))??d;i.innerHTML=u};return this.colorize(t,l||"",a,s).then(c,d=>console.error(d))}static async colorize(e,t,i,s){const r=e.languageIdCodec;let o=4;s&&typeof s.tabSize=="number"&&(o=s.tabSize),startsWithUTF8BOM(t)&&(t=t.substr(1));const a=splitLines(t);if(!e.isRegisteredLanguageId(i))return _fakeColorize(a,o,r);const l=await TokenizationRegistry.getOrCreate(i);return l?_colorize(a,o,l,r):_fakeColorize(a,o,r)}static colorizeLine(e,t,i,s,r=4){const o=ViewLineRenderingData.isBasicASCII(e,t),a=ViewLineRenderingData.containsRTL(e,o,i);return renderViewLine2(new RenderLineInput(!1,!0,e,!1,o,a,0,s,[],r,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function _colorize(n,e,t,i){return new Promise((s,r)=>{const o=()=>{const a=_actualColorize(n,e,t,i);if(t instanceof MonarchTokenizer){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(o,r);return}}s(a)};o()})}function _fakeColorize(n,e,t){let i=[];const r=new Uint32Array(2);r[0]=0,r[1]=33587200;for(let o=0,a=n.length;o")}return i.join("")}function _actualColorize(n,e,t,i){let s=[],r=t.getInitialState();for(let o=0,a=n.length;o"),r=c.endState}return s.join("")}var __decorate$1Y=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1Y=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},cu;let MarkerDecorationsContribution=(cu=class{constructor(e,t){}dispose(){}},cu.ID="editor.contrib.markerDecorations",cu);MarkerDecorationsContribution=__decorate$1Y([__param$1Y(1,IMarkerDecorationsService)],MarkerDecorationsContribution);registerEditorContribution(MarkerDecorationsContribution.ID,MarkerDecorationsContribution,0);const editor$1="";class ElementSizeObserver extends Disposable{constructor(e,t){super(),this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const r=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{scheduleAtNextAnimationFrame(getWindow(this._referenceDomElement),()=>{s=!1,r()})}};this._resizeObserver=new ResizeObserver(o=>{o&&o[0]&&o[0].contentRect?e={width:o[0].contentRect.width,height:o[0].contentRect.height}:e=null,i=!0,r()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}const ul=class ul{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=ul._read(e,this.key),i=r=>ul._read(e,r),s=(r,o)=>ul._write(e,r,o);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const r=t.substring(0,s);e[r]=e[r]||{},this._write(e[r],t.substring(s+1),i);return}e[t]=i}};ul.items=[];let EditorSettingMigration=ul;function registerEditorSettingMigration(n,e){EditorSettingMigration.items.push(new EditorSettingMigration(n,e))}function registerSimpleEditorSettingMigration(n,e){registerEditorSettingMigration(n,(t,i,s)=>{if(typeof t<"u"){for(const[r,o]of e)if(t===r){s(n,o);return}}})}function migrateOptions(n){EditorSettingMigration.items.forEach(e=>e.apply(n))}registerSimpleEditorSettingMigration("wordWrap",[[!0,"on"],[!1,"off"]]);registerSimpleEditorSettingMigration("lineNumbers",[[!0,"on"],[!1,"off"]]);registerSimpleEditorSettingMigration("cursorBlinking",[["visible","solid"]]);registerSimpleEditorSettingMigration("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);registerSimpleEditorSettingMigration("renderLineHighlight",[[!0,"line"],[!1,"none"]]);registerSimpleEditorSettingMigration("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);registerSimpleEditorSettingMigration("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);registerSimpleEditorSettingMigration("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);registerSimpleEditorSettingMigration("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);registerSimpleEditorSettingMigration("autoIndent",[[!1,"advanced"],[!0,"full"]]);registerSimpleEditorSettingMigration("matchBrackets",[[!0,"always"],[!1,"never"]]);registerSimpleEditorSettingMigration("renderFinalNewline",[[!0,"on"],[!1,"off"]]);registerSimpleEditorSettingMigration("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);registerSimpleEditorSettingMigration("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]);registerSimpleEditorSettingMigration("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]);registerEditorSettingMigration("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});registerEditorSettingMigration("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});registerEditorSettingMigration("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const suggestFilteredTypesMapping={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};registerEditorSettingMigration("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(suggestFilteredTypesMapping))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});registerEditorSettingMigration("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});registerEditorSettingMigration("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});registerEditorSettingMigration("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});registerEditorSettingMigration("codeActionsOnSave",(n,e,t)=>{if(n&&typeof n=="object"){let i=!1;const s={};for(const r of Object.entries(n))typeof r[1]=="boolean"?(i=!0,s[r[0]]=r[1]?"explicit":"never"):s[r[0]]=r[1];i&&t("codeActionsOnSave",s)}});registerEditorSettingMigration("codeActionWidget.includeNearbyQuickfixes",(n,e,t)=>{typeof n=="boolean"&&(t("codeActionWidget.includeNearbyQuickfixes",void 0),typeof e("codeActionWidget.includeNearbyQuickFixes")>"u"&&t("codeActionWidget.includeNearbyQuickFixes",n))});registerEditorSettingMigration("lightbulb.enabled",(n,e,t)=>{typeof n=="boolean"&&t("lightbulb.enabled",n?void 0:"off")});class TabFocusImpl{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Emitter$1,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const TabFocus=new TabFocusImpl;var __decorate$1X=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1X=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let EditorConfiguration=class extends Disposable{constructor(e,t,i,s,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new Emitter$1),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Emitter$1),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new ComputeOptionsMemory,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new ElementSizeObserver(s,i.dimension)),this._targetWindowId=getWindow(s).vscodeWindowId,this._rawOptions=deepCloneAndMigrateOptions(i),this._validatedOptions=EditorOptionsUtil.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(EditorZoom.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(TabFocus.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(FontMeasurements.onDidChange(()=>this._recomputeOptions())),this._register(PixelRatio.getInstance(getWindow(s)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=EditorOptionsUtil.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=BareFontInfo.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:TabFocus.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return EditorOptionsUtil.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:getExtraEditorClassName(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:isWebKit||isFirefox,pixelRatio:PixelRatio.getInstance(getWindowById(this._targetWindowId,!0).window).value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return FontMeasurements.readFontInfo(getWindowById(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=deepCloneAndMigrateOptions(e);EditorOptionsUtil.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=EditorOptionsUtil.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};EditorConfiguration=__decorate$1X([__param$1X(4,IAccessibilityService)],EditorConfiguration);function digitCount(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function getExtraEditorClassName(){let n="";return!isSafari&&!isWebkitWebView&&(n+="no-user-select "),isSafari&&(n+="no-minimap-shadow ",n+="enable-user-select "),isMacintosh&&(n+="mac "),n}class ValidatedEditorOptions{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class ComputedEditorOptions{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class EditorOptionsUtil{static validateOptions(e){const t=new ValidatedEditorOptions;for(const i of editorOptionsRegistry){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new ComputedEditorOptions;for(const s of editorOptionsRegistry)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?equals$1(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!EditorOptionsUtil._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const r of editorOptionsRegistry){const o=!EditorOptionsUtil._deepEquals(e._read(r.id),t._read(r.id));i[r.id]=o,o&&(s=!0)}return s?new ConfigurationChangedEvent(i):null}static applyUpdate(e,t){let i=!1;for(const s of editorOptionsRegistry)if(t.hasOwnProperty(s.name)){const r=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=r.newValue,i=i||r.didChange}return i}}function deepCloneAndMigrateOptions(n){const e=deepClone(n);return migrateOptions(e),e}var inputLatency;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t={...e},i={...e},s={...e};let r=0;const o={keydown:0,input:0,render:0};function a(){C(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),o.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){o.keydown===1&&(performance.mark("keydown/end"),o.keydown=2)}function c(){performance.mark("input/start"),o.input=1,v()}n.onBeforeInput=c;function d(){o.input===0&&c(),queueMicrotask(u)}n.onInput=d;function u(){o.input===1&&(performance.mark("input/end"),o.input=2)}function f(){C()}n.onKeyUp=f;function g(){C()}n.onSelectionChange=g;function m(){o.keydown===2&&o.input===2&&o.render===0&&(performance.mark("render/start"),o.render=1,queueMicrotask(_),v())}n.onRenderStart=m;function _(){o.render===1&&(performance.mark("render/end"),o.render=2)}function v(){setTimeout(C)}function C(){o.keydown===2&&o.input===2&&o.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),S("keydown",e),S("input",t),S("render",i),S("inputlatency",s),r++,w())}function S(R,T){const A=performance.getEntriesByName(R)[0].duration;T.total+=A,T.min=Math.min(T.min,A),T.max=Math.max(T.max,A)}function w(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),o.keydown=0,o.input=0,o.render=0}function L(){if(r===0)return;const R={keydown:I(e),input:I(t),render:I(i),total:I(s),sampleCount:r};return N(e),N(t),N(i),N(s),r=0,R}n.getAndClearMeasurements=L;function I(R){return{average:R.total/r,max:R.max,min:R.min}}function N(R){R.total=0,R.min=Number.MAX_VALUE,R.max=0}})(inputLatency||(inputLatency={}));class PageCoordinates{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new ClientCoordinates(this.x-e.scrollX,this.y-e.scrollY)}}class ClientCoordinates{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new PageCoordinates(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class EditorPagePosition{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class CoordinatesRelativeToEditor{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function createEditorPagePosition(n){const e=getDomNodePagePosition(n);return new EditorPagePosition(e.left,e.top,e.width,e.height)}function createCoordinatesRelativeToEditor(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,r=(t.x-e.x)/i,o=(t.y-e.y)/s;return new CoordinatesRelativeToEditor(r,o)}class EditorMouseEvent extends StandardMouseEvent{constructor(e,t,i){super(getWindow(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new PageCoordinates(this.posx,this.posy),this.editorPos=createEditorPagePosition(i),this.relativePos=createCoordinatesRelativeToEditor(i,this.editorPos,this.pos)}}class EditorMouseEventFactory{constructor(e){this._editorViewDomNode=e}_create(e){return new EditorMouseEvent(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return addDisposableListener(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return addDisposableListener(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return addDisposableListener(e,EventType$1.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return addDisposableListener(e,EventType$1.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return addDisposableListener(e,EventType$1.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return addDisposableListener(e,"mousemove",i=>t(this._create(i)))}}class EditorPointerEventFactory{constructor(e){this._editorViewDomNode=e}_create(e){return new EditorMouseEvent(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return addDisposableListener(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return addDisposableListener(e,EventType$1.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return addDisposableListener(e,EventType$1.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return addDisposableListener(e,"pointermove",i=>t(this._create(i)))}}class GlobalEditorPointerMoveMonitor extends Disposable{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new GlobalPointerMoveMonitor),this._keydownListener=null}startMonitoring(e,t,i,s,r){this._keydownListener=addStandardDisposableListener(e.ownerDocument,"keydown",o=>{o.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,o.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,o=>{s(new EditorMouseEvent(o,!0,this._editorViewDomNode))},o=>{this._keydownListener.dispose(),r(o)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}const eg=class eg{constructor(e){this._editor=e,this._instanceId=++eg._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new RunOnceScheduler(()=>this.garbageCollect(),1e3)}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const s=this._counter++;i=new RefCountedCssRule(t,`dyn-rule-${this._instanceId}-${s}`,isInShadowDOM(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}};eg._idPool=0;let DynamicCssRules=eg;class RefCountedCssRule{constructor(e,t,i,s){this.key=e,this.className=t,this.properties=s,this._referenceCount=0,this._styleElementDisposables=new DisposableStore,this._styleElement=createStyleSheet(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const s in t){const r=t[s];let o;typeof r=="object"?o=asCssVariable(r.id):o=r;const a=camelToDashes(s);i+=` + ${a}: ${o};`}return i+=` +}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function camelToDashes(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class ViewEventHandler extends Disposable{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let r=0,o=e.length;rl)return null;if(t=Math.min(l,Math.max(0,t)),s=Math.min(l,Math.max(0,s)),t===s&&i===r&&i===0&&!e.children[t].firstChild){const f=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(f,o.clientRectDeltaLeft,o.clientRectScale)}t!==s&&s>0&&r===0&&(s--,r=1073741824);let c=e.children[t].firstChild,d=e.children[s].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&r===0&&s>0&&(d=e.children[s-1].firstChild,r=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),r=Math.min(d.textContent.length,Math.max(0,r));const u=this._readClientRects(c,i,d,r,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,o.clientRectDeltaLeft,o.clientRectScale)}}const canUseFastRenderedViewLine=function(){return isNative?!0:!(isLinux||isFirefox||isSafari)}();let monospaceAssumptionsAreValid=!0;class ViewLineOptions{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(100):this.renderWhitespace="none",this.renderControlCharacters=i.get(95),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(67),this.stopRenderingLineAfter=i.get(118),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}const tg=class tg{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=createFastDomNode(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return isHighContrast(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=s.getViewLineRenderingData(e),a=this._options,l=LineDecoration.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let c=null;if(isHighContrast(a.themeType)||this._options.renderWhitespace==="selection"){const g=s.selections;for(const m of g){if(m.endLineNumbere)continue;const _=m.startLineNumber===e?m.startColumn:o.minColumn,v=m.endLineNumber===e?m.endColumn:o.maxColumn;_');const u=renderViewLine(d,r);r.appendString("
    ");let f=null;return monospaceAssumptionsAreValid&&canUseFastRenderedViewLine&&o.isBasicASCII&&a.useMonospaceOptimizations&&u.containsForeignElements===0&&(f=new FastRenderedViewLine(this._renderedViewLine?this._renderedViewLine.domNode:null,d,u.characterMapping)),f||(f=createRenderedLine(this._renderedViewLine?this._renderedViewLine.domNode:null,d,u.characterMapping,u.containsRTL,u.containsForeignElements)),this._renderedViewLine=f,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof FastRenderedViewLine:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof FastRenderedViewLine?this._renderedViewLine.monospaceAssumptionsAreValid():monospaceAssumptionsAreValid}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof FastRenderedViewLine&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const r=this._renderedViewLine.input.stopRenderingLineAfter;if(r!==-1&&t>r+1&&i>r+1)return new VisibleRanges(!0,[new FloatHorizontalRange(this.getWidth(s),0)]);r!==-1&&t>r+1&&(t=r+1),r!==-1&&i>r+1&&(i=r+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return o&&o.length>0?new VisibleRanges(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}};tg.CLASS_NAME="view-line";let ViewLine=tg;class FastRenderedViewLine{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let r=0;r=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),monospaceAssumptionsAreValid=!1)}return monospaceAssumptionsAreValid}toSlowRenderedLine(){return createRenderedLine(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const r=this._getColumnPixelOffset(e,t,s),o=this._getColumnPixelOffset(e,i,s);return[new FloatHorizontalRange(r,o-r)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const s=Math.floor((t-1)/300)-1,r=(s+1)*300+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[s],o===-1&&(o=this._actualReadPixelOffset(e,r,i),this._keyColumnPixelOffsetCache[s]=o)),o===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(r),l=this._characterMapping.getHorizontalOffset(t);return o+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),r=RangeUtil.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!r||r.length===0?-1:r[0].left}getColumnOfNodeOffset(e,t){return getColumnOfNodeOffset(this._characterMapping,e,t)}}class RenderedViewLine{constructor(e,t,i,s,r){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=r,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let o=0,a=this._characterMapping.length;o<=a;o++)this._pixelOffsetCache[o]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const r=this._readPixelOffset(this.domNode,e,t,s);if(r===-1)return null;const o=this._readPixelOffset(this.domNode,e,i,s);return o===-1?null:[new FloatHorizontalRange(r,o-r)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,r){if(i===s){const o=this._readPixelOffset(e,t,i,r);return o===-1?null:[new FloatHorizontalRange(o,0)]}else return this._readRawVisibleRangesForRange(e,i,s,r)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const r=this._getReadingTarget(e);return r.firstChild?(s.markDidDomLayout(),r.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const r=this._pixelOffsetCache[i];if(r!==-1)return r;const o=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=RangeUtil.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const r=this._characterMapping.getDomPosition(i),o=RangeUtil.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,r.partIndex,r.charIndex,s);if(!o||o.length===0)return-1;const a=o[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new FloatHorizontalRange(0,this.getWidth(s))];const r=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return RangeUtil.readHorizontalRanges(this._getReadingTarget(e),r.partIndex,r.charIndex,o.partIndex,o.charIndex,s)}getColumnOfNodeOffset(e,t){return getColumnOfNodeOffset(this._characterMapping,e,t)}}class WebKitRenderedViewLine extends RenderedViewLine{_readVisibleRangesForRange(e,t,i,s,r){const o=super._readVisibleRangesForRange(e,t,i,s,r);if(!o||o.length===0||i===s||i===1&&s===this._characterMapping.length)return o;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,r);if(a!==-1){const l=o[o.length-1];l.left=4&&e[0]===3&&e[3]===8}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===8}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===6}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===9}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&e[0]===5}}class HitTestContext{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(146),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(67),this.stickyTabStops=s.get(117),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return HitTestContext.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount();let o=null,a,l=null;return i.afterLineNumber!==r&&(l=new Position$1(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new Position$1(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=o:o===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class HitTestRequest extends BareHitTestRequest{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=PartFingerprints.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,s,r){super(e,t,i,s),this.hitTestResult=new Lazy(()=>MouseTargetFactory.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=r;const o=!!this._eventTarget;this._useHitTestTarget=!o}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.columno.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=r&&r<=a+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?8:5;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return ElementPath.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let r=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:r};if(r-=e.layoutInfo.glyphMarginLeft,r<=e.layoutInfo.glyphMarginWidth){const a=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),l=e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);return o.glyphMarginLane=l[Math.floor(r/e.lineHeight)],t.fulfillMargin(2,s,i.range,o)}return r-=e.layoutInfo.glyphMarginWidth,r<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,s,i.range,o):(r-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,s,i.range,o))}return null}static _hitTestViewLines(e,t){if(!ElementPath.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Position$1(1,1),EMPTY_CONTENT_AFTER_LINES);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const s=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(s);return t.fulfillContentEmpty(new Position$1(s,r),EMPTY_CONTENT_AFTER_LINES)}if(ElementPath.isStrictChildOfViewLines(t.targetPath)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(s)===0){const o=e.getLineWidth(s),a=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-o);return t.fulfillContentEmpty(new Position$1(s,1),a)}const r=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>=r){const o=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-r),a=new Position$1(s,e.viewModel.getLineMaxColumn(s));return t.fulfillContentEmpty(a,o)}}const i=t.hitTestResult.value;return i.type===1?MouseTargetFactory.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(ElementPath.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Position$1(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(ElementPath.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new Position$1(s,r))}}return null}static _hitTestScrollbar(e,t){if(ElementPath.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Position$1(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(146),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return MouseTargetFactory._getMouseColumn(s,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,r){const o=s.lineNumber,a=s.column,l=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>l){const C=createEmptyContentDataInLines(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(s,C)}const c=e.visibleRangeForPosition(o,a);if(!c)return t.fulfillUnknown(s);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!r,injectedText:r});const u=[];if(u.push({offset:c.left,column:a}),a>1){const C=e.visibleRangeForPosition(o,a-1);C&&u.push({offset:C.left,column:a-1})}const f=e.viewModel.getLineMaxColumn(o);if(aC.offset-S.offset);const g=t.pos.toClientCoordinates(getWindow(e.viewDomNode)),m=i.getBoundingClientRect(),_=m.left<=g.clientX&&g.clientX<=m.right;let v=null;for(let C=1;Cr)){const a=Math.floor((s+r)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new PageCoordinates(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates(getWindow(e.viewDomNode)));if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(getWindow(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=getShadowRoot(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=shadowCaretRangeFromPoint(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new UnknownHitTestResult;const r=s.startContainer;if(r.nodeType===r.TEXT_NODE){const o=r.parentNode,a=o?o.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,o,s.startOffset):new UnknownHitTestResult(r.parentNode)}else if(r.nodeType===r.ELEMENT_NODE){const o=r.parentNode,a=o?o.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,r,r.textContent.length):new UnknownHitTestResult(r)}return new UnknownHitTestResult}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,r=s?s.parentNode:null,o=r?r.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===ViewLine.CLASS_NAME?HitTestResult.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new UnknownHitTestResult(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,r=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,o=s?s.parentNode:null,a=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(r===ViewLine.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return HitTestResult.createFromDOMInfo(e,l,0)}else if(a===ViewLine.CLASS_NAME)return HitTestResult.createFromDOMInfo(e,i.offsetNode,0)}return new UnknownHitTestResult(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),r=AtomicTabMoveOperations.atomicPosition(i,e.column-1,s,2);return r!==-1?new Position$1(e.lineNumber,r+1):e}static doHitTest(e,t){let i=new UnknownHitTestResult;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(getWindow(e.viewDomNode)))),i.type===1){const s=e.viewModel.getInjectedTextAt(i.position),r=e.viewModel.normalizePosition(i.position,2);(s||!r.equals(i.position))&&(i=new ContentHitTestResult(r,i.spanNode,s))}return i}}function shadowCaretRangeFromPoint(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const r=s.getBoundingClientRect(),o=getWindow(s),a=o.getComputedStyle(s,null).getPropertyValue("font-style"),l=o.getComputedStyle(s,null).getPropertyValue("font-variant"),c=o.getComputedStyle(s,null).getPropertyValue("font-weight"),d=o.getComputedStyle(s,null).getPropertyValue("font-size"),u=o.getComputedStyle(s,null).getPropertyValue("line-height"),f=o.getComputedStyle(s,null).getPropertyValue("font-family"),g=`${a} ${l} ${c} ${d}/${u} ${f}`,m=s.innerText;let _=r.left,v=0,C;if(e>r.left+r.width)v=m.length;else{const S=CharWidthReader.getInstance();for(let w=0;wthis._createMouseTarget(o,a),o=>this._getMouseColumn(o))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(146).height;const s=new EditorMouseEventFactory(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,o=>this._onContextMenu(o,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,o=>{this._onMouseMove(o),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=addDisposableListener(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new EditorMouseEvent(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o)));let r=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,a)=>{r=a})),this._register(addDisposableListener(this.viewHelper.viewDomNode,EventType$1.POINTER_UP,o=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,o=>this._onMouseDown(o,r))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=MouseWheelClassifier.INSTANCE;let t=0,i=EditorZoom.getZoomLevel(),s=!1,r=0;const o=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(76))return;const c=new StandardWheelEvent(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=EditorZoom.getZoomLevel(),u=c.deltaY>0?1:-1;EditorZoom.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=EditorZoom.getZoomLevel(),s=a(l),r=0),t=Date.now(),r+=c.deltaY,s&&(EditorZoom.setZoomLevel(i+r/5),c.preventDefault(),c.stopPropagation())};this._register(addDisposableListener(this.viewHelper.viewDomNode,EventType$1.MOUSE_WHEEL,o,{capture:!0,passive:!1}));function a(l){return isMacintosh?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(146)){const t=this._context.configuration.options.get(146).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new ClientCoordinates(e,t).toPageCoordinates(getWindow(this.viewHelper.viewDomNode)),r=createEditorPagePosition(this.viewHelper.viewDomNode);if(s.yr.y+r.height||s.xr.x+r.width)return null;const o=createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode,r,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),r,s,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=getShadowRoot(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(r=>this.viewHelper.viewDomNode.contains(r)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||o&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(r)e.preventDefault();else if(l){const f=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(f.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class MouseDownOperation extends Disposable{constructor(e,t,i,s,r,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=r,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new TopBottomDragScrolling(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new MouseDownState,this._currentSelection=new Selection$1(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const r=this._context.configuration.options;if(!r.get(92)&&r.get(35)&&!r.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,o=>this._onMouseDownThenMove(o),o=>{const a=this._findMousePosition(this._lastMouseEvent,!1);isKeyboardEvent$1(o)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,o=>this._onMouseDownThenMove(o),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,r=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=s.getCurrentScrollTop()+e.relativePos.y,c=HitTestContext.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return MouseTarget.createOutsideEditor(r,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return MouseTarget.createOutsideEditor(r,new Position$1(d,i.getLineMaxColumn(d)),"below",a)}const o=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return MouseTarget.createOutsideEditor(r,new Position$1(o,i.getLineMaxColumn(o)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const o=this._helpPositionJumpOverViewZone(s.detail);if(o)return MouseTarget.createViewZone(s.type,s.element,s.mouseColumn,o,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new Position$1(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class TopBottomDragScrolling extends Disposable{constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new TopBottomDragScrollingOperation(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class TopBottomDragScrollingOperation extends Disposable{constructor(e,t,i,s,r,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=r,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=scheduleAtNextAnimationFrame(getWindow(o.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(67),t=this._context.configuration.options.get(146).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(67),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,r=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,r),this._viewHelper.renderNow();const o=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?o.startLineNumber:o.endLineNumber;let l;{const c=createEditorPagePosition(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(146).horizontalScrollbarHeight,u=new PageCoordinates(this._mouseEvent.pos.x,c.y+c.height-d-.1),f=createCoordinatesRelativeToEditor(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,f,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=MouseTarget.createOutsideEditor(this._position.mouseColumn,new Position$1(a,1),"above",this._position.outsideDistance):l=MouseTarget.createOutsideEditor(this._position.mouseColumn,new Position$1(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=scheduleAtNextAnimationFrame(getWindow(l.element),()=>this._execute())}}const ig=class ig{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>ig.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}};ig.CLEAR_MOUSE_DOWN_COUNT_TIME=400;let MouseDownState=ig;const hl=class hl{constructor(e,t,i,s,r){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=r}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),r=e.getSelectionEnd();let o;if(t){const a=i.substring(0,s),l=t.value.substring(0,t.selectionStart);a===l&&(o=t.newlineCountBeforeSelection)}return new hl(i,s,r,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new hl(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var s,r,o,a;if(e<=this.selectionStart){const l=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(((s=this.selection)==null?void 0:s.getStartPosition())??null,l,-1)}if(e>=this.selectionEnd){const l=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(((r=this.selection)==null?void 0:r.getEndPosition())??null,l,1)}const t=this.value.substring(this.selectionStart,e);if(t.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition(((o=this.selection)==null?void 0:o.getStartPosition())??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(((a=this.selection)==null?void 0:a.getEndPosition())??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,r=-1;for(;(r=t.indexOf(` +`,r+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(commonPrefixLength(e.value,t.value),e.selectionStart,t.selectionStart),r=Math.min(commonSuffixLength(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-r);const o=t.value.substring(s,t.value.length-r),a=e.selectionStart-s,l=e.selectionEnd-s,c=t.selectionStart-s,d=t.selectionEnd-s;if(c===d){const f=e.selectionStart-s;return{text:o,replacePrevCharCnt:f,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:o,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(commonPrefixLength(e.value,t.value),e.selectionEnd),s=Math.min(commonSuffixLength(e.value,t.value),e.value.length-e.selectionEnd),r=e.value.substring(i,e.value.length-s),o=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:o,replacePrevCharCnt:a,replaceNextCharCnt:r.length-a,positionDelta:l-o.length}}};hl.EMPTY=new hl("",0,0,null,void 0);let TextAreaState=hl;class PagedScreenReaderStrategy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,r=i+t;return new Range$2(s,1,r+1,1)}static fromEditorSelection(e,t,i,s){const o=PagedScreenReaderStrategy._getPageOfLine(t.startLineNumber,i),a=PagedScreenReaderStrategy._getRangeForPage(o,i),l=PagedScreenReaderStrategy._getPageOfLine(t.endLineNumber,i),c=PagedScreenReaderStrategy._getRangeForPage(l,i);let d=a.intersectRanges(new Range$2(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const C=e.modifyPosition(d.getEndPosition(),-500);d=Range$2.fromPositions(C,d.getEndPosition())}const u=e.getValueInRange(d,1),f=e.getLineCount(),g=e.getLineMaxColumn(f);let m=c.intersectRanges(new Range$2(t.endLineNumber,t.endColumn,f,g));if(s&&e.getValueLengthInRange(m,1)>500){const C=e.modifyPosition(m.getStartPosition(),500);m=Range$2.fromPositions(m.getStartPosition(),C)}const _=e.getValueInRange(m,1);let v;if(o===l||o+1===l)v=e.getValueInRange(t,1);else{const C=a.intersectRanges(t),S=c.intersectRanges(t);v=e.getValueInRange(C,1)+String.fromCharCode(8230)+e.getValueInRange(S,1)}return s&&v.length>2*500&&(v=v.substring(0,500)+String.fromCharCode(8230)+v.substring(v.length-500,v.length)),new TextAreaState(u+v+_,u.length,u.length+v.length,t,d.endLineNumber-d.startLineNumber)}}var __decorate$1W=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1W=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},TextAreaSyntethicEvents;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(TextAreaSyntethicEvents||(TextAreaSyntethicEvents={}));const CopyOptions={forceCopyWithSyntaxHighlighting:!1},ng=class ng{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};ng.INSTANCE=new ng;let InMemoryClipboardMetadataManager=ng;class CompositionContext{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let TextAreaInput=class extends Disposable{get textAreaState(){return this._textAreaState}constructor(e,t,i,s,r,o){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._accessibilityService=r,this._logService=o,this._onFocus=this._register(new Emitter$1),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Emitter$1),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Emitter$1),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Emitter$1),this.onCut=this._onCut.event,this._onPaste=this._register(new Emitter$1),this.onPaste=this._onPaste.event,this._onType=this._register(new Emitter$1),this.onType=this._onType.event,this._onCompositionStart=this._register(new Emitter$1),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Emitter$1),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Emitter$1),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Emitter$1),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new MutableDisposable),this._asyncTriggerCut=this._register(new RunOnceScheduler(()=>this._onCut.fire(),0)),this._textAreaState=TextAreaState.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(Event$1.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new RunOnceScheduler(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let a=null;this._register(this._textArea.onKeyDown(l=>{const c=new StandardKeyboardEvent(l);(c.keyCode===114||this._currentComposition&&c.keyCode===1)&&c.stopPropagation(),c.equals(9)&&c.preventDefault(),a=c,this._onKeyDown.fire(c)})),this._register(this._textArea.onKeyUp(l=>{const c=new StandardKeyboardEvent(l);this._onKeyUp.fire(c)})),this._register(this._textArea.onCompositionStart(l=>{const c=new CompositionContext;if(this._currentComposition){this._currentComposition=c;return}if(this._currentComposition=c,this._OS===2&&a&&a.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===l.data&&(a.code==="ArrowRight"||a.code==="ArrowLeft")){c.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:l.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:l.data});return}this._onCompositionStart.fire({data:l.data})})),this._register(this._textArea.onCompositionUpdate(l=>{const c=this._currentComposition;if(!c)return;if(this._browser.isAndroid){const u=TextAreaState.readFromTextArea(this._textArea,this._textAreaState),f=TextAreaState.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(f),this._onCompositionUpdate.fire(l);return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=TextAreaState.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionUpdate.fire(l)})),this._register(this._textArea.onCompositionEnd(l=>{const c=this._currentComposition;if(!c)return;if(this._currentComposition=null,this._browser.isAndroid){const u=TextAreaState.readFromTextArea(this._textArea,this._textAreaState),f=TextAreaState.deduceAndroidCompositionInput(this._textAreaState,u);this._textAreaState=u,this._onType.fire(f),this._onCompositionEnd.fire();return}const d=c.handleCompositionUpdate(l.data);this._textAreaState=TextAreaState.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(d),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const c=TextAreaState.readFromTextArea(this._textArea,this._textAreaState),d=TextAreaState.deduceInput(this._textAreaState,c,this._OS===2);d.replacePrevCharCnt===0&&d.text.length===1&&(isHighSurrogate(d.text.charCodeAt(0))||d.text.charCodeAt(0)===127)||(this._textAreaState=c,(d.text!==""||d.replacePrevCharCnt!==0||d.replaceNextCharCnt!==0||d.positionDelta!==0)&&this._onType.fire(d))})),this._register(this._textArea.onCut(l=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(l),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(l=>{this._ensureClipboardGetsEditorSelection(l)})),this._register(this._textArea.onPaste(l=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),l.preventDefault(),!l.clipboardData)return;let[c,d]=ClipboardEventUtils.getTextData(l.clipboardData);c&&(d=d||InMemoryClipboardMetadataManager.INSTANCE.get(c),this._onPaste.fire({text:c,metadata:d}))})),this._register(this._textArea.onFocus(()=>{const l=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!l&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new RunOnceScheduler(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return addDisposableListener(this._textArea.ownerDocument,"selectionchange",t=>{if(inputLatency.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const r=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),r<100||!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),f=this._host.deduceModelPosition(u[0],u[1],u[2]),g=new Selection$1(d.lineNumber,d.column,f.lineNumber,f.column);this._onSelectionChangeRequest.fire(g)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&e==="render"||this._currentComposition||(this._logService.trace(`writeTextAreaState(reason: ${e})`),this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent()))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};InMemoryClipboardMetadataManager.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&ClipboardEventUtils.setTextData(e.clipboardData,t.text,t.html,i)}};TextAreaInput=__decorate$1W([__param$1W(4,IAccessibilityService),__param$1W(5,ILogService)],TextAreaInput);const ClipboardEventUtils={getTextData(n){const e=n.getData(Mimes.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(r=>r.name).join(` +`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Mimes.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class TextAreaWrapper extends Disposable{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new DomEmitter(this._actual,"keydown")).event,this.onKeyUp=this._register(new DomEmitter(this._actual,"keyup")).event,this.onCompositionStart=this._register(new DomEmitter(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new DomEmitter(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new DomEmitter(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new DomEmitter(this._actual,"beforeinput")).event,this.onInput=this._register(new DomEmitter(this._actual,"input")).event,this.onCut=this._register(new DomEmitter(this._actual,"cut")).event,this.onCopy=this._register(new DomEmitter(this._actual,"copy")).event,this.onPaste=this._register(new DomEmitter(this._actual,"paste")).event,this.onFocus=this._register(new DomEmitter(this._actual,"focus")).event,this.onBlur=this._register(new DomEmitter(this._actual,"blur")).event,this._onSyntheticTap=this._register(new Emitter$1),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>inputLatency.onKeyDown())),this._register(this.onBeforeInput(()=>inputLatency.onBeforeInput())),this._register(this.onInput(()=>inputLatency.onInput())),this._register(this.onKeyUp(()=>inputLatency.onKeyUp())),this._register(addDisposableListener(this._actual,TextAreaSyntethicEvents.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=getShadowRoot(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?getActiveElement()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let r=null;const o=getShadowRoot(s);o?r=o.activeElement:r=getActiveElement();const a=getWindow(r),l=r===s,c=s.selectionStart,d=s.selectionEnd;if(l&&c===t&&d===i){isFirefox&&a.parent!==a&&s.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),isFirefox&&a.parent!==a&&s.focus();return}try{const u=saveParentsScrollTop(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),restoreParentsScrollTop(s,u)}catch{}}}class PointerEventHandler extends MouseHandler{constructor(e,t,i){super(e,t,i),this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Tap,r=>this.onTap(r))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Change,r=>this.onChange(r))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Contextmenu,r=>this._onContextMenu(new EditorMouseEvent(r,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(addDisposableListener(this.viewHelper.linesContentDomNode,"pointerdown",r=>{const o=r.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new EditorPointerEventFactory(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,r=>this._onMouseMove(r))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,o)=>this._onMouseDown(r,o)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:i.type===6&&i.detail.injectedText!==null})}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class TouchHandler extends MouseHandler{constructor(e,t,i){super(e,t,i),this._register(Gesture.addTarget(this.viewHelper.linesContentDomNode)),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Tap,s=>this.onTap(s))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Change,s=>this.onChange(s))),this._register(addDisposableListener(this.viewHelper.linesContentDomNode,EventType.Contextmenu,s=>this._onContextMenu(new EditorMouseEvent(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new EditorMouseEvent(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(TextAreaSyntethicEvents.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class PointerHandler extends Disposable{constructor(e,t,i){super(),(isIOS||isAndroid$1&&isMobile)&&BrowserFeatures.pointerEvents?this.handler=this._register(new PointerEventHandler(e,t,i)):mainWindow.TouchEvent?this.handler=this._register(new TouchHandler(e,t,i)):this.handler=this._register(new MouseHandler(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}const textAreaHandler="",lineNumbers="";class DynamicViewOverlay extends ViewEventHandler{}const sg=class sg extends DynamicViewOverlay{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Position$1(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(67);const t=e.get(68);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(96);const i=e.get(146);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}if(this._renderLineNumbers===3){if(this._lastCursorModelPosition.lineNumber===i||i%10===0)return String(i);const s=this._context.viewModel.getLineCount();return i===s?String(i):""}return String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=isLinux?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(c=>!!c.options.lineNumberClassName);r.sort((c,d)=>Range$2.compareRangesUsingEnds(c.range,d.range));let o=0;const a=this._context.viewModel.getLineCount(),l=[];for(let c=i;c<=s;c++){const d=c-i;let u=this._getLineRenderLineNumber(c),f="";for(;o${u}`}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};sg.CLASS_NAME="line-numbers";let LineNumbersOverlay=sg;registerThemingParticipant((n,e)=>{const t=n.getColor(editorLineNumbers),i=n.getColor(editorDimmedLineNumber);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});const margin="",fl=class fl extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setClassName(fl.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=createFastDomNode(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(fl.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}};fl.CLASS_NAME="glyph-margin",fl.OUTER_CLASS_NAME="margin";let Margin=fl;const mouseCursor="",MOUSE_CURSOR_TEXT_CSS_CLASS_NAME="monaco-mouse-cursor-text";var __decorate$1V=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1V=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class VisibleTextAreaData{constructor(e,t,i,s,r){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=r,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Position$1(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Position$1(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const canUseZeroSizeTextarea=isFirefox;let TextAreaHandler=class extends ViewPart{constructor(e,t,i,s,r){super(e),this._keybindingService=s,this._instantiationService=r,this._primaryCursorPosition=new Position$1(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,a=o.get(146);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(50),this._lineHeight=o.get(67),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new Selection$1(1,1,1,1)],this._modelSelections=[new Selection$1(1,1,1,1)],this._lastRenderPosition=null,this.textArea=createFastDomNode(document.createElement("textarea")),PartFingerprints.write(this.textArea,7),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(125))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",localize("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(92)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=createFastDomNode(document.createElement("div")),this.textAreaCover.setPosition("absolute");const c={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:f=>this._context.viewModel.getLineMaxColumn(f),getValueInRange:(f,g)=>this._context.viewModel.getValueInRange(f,g),getValueLengthInRange:(f,g)=>this._context.viewModel.getValueLengthInRange(f,g),modifyPosition:(f,g)=>this._context.viewModel.modifyPosition(f,g)},d={getDataToCopy:()=>{const f=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,isWindows),g=this._context.viewModel.model.getEOL(),m=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),_=Array.isArray(f)?f:null,v=Array.isArray(f)?f.join(g):f;let C,S=null;if(CopyOptions.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&v.length<65536){const w=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);w&&(C=w.html,S=w.mode)}return{isFromEmptySelection:m,multicursorText:_,text:v,html:C,mode:S}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const f=this._selections[0];if(isMacintosh&&f.isEmpty()){const m=f.getStartPosition();let _=this._getWordBeforePosition(m);if(_.length===0&&(_=this._getCharacterBeforePosition(m)),_.length>0)return new TextAreaState(_,_.length,_.length,Range$2.fromPositions(m),0)}const g=500;if(isMacintosh&&!f.isEmpty()&&c.getValueLengthInRange(f,0)0)return new TextAreaState(m,_,_,Range$2.fromPositions(g),0)}return TextAreaState.EMPTY}return PagedScreenReaderStrategy.fromEditorSelection(c,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(f,g,m)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(f,g,m)},u=this._register(new TextAreaWrapper(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(TextAreaInput,d,u,OS$1,{isAndroid,isChrome,isFirefox,isSafari})),this._register(this._textAreaInput.onKeyDown(f=>{this._viewController.emitKeyDown(f)})),this._register(this._textAreaInput.onKeyUp(f=>{this._viewController.emitKeyUp(f)})),this._register(this._textAreaInput.onPaste(f=>{let g=!1,m=null,_=null;f.metadata&&(g=this._emptySelectionClipboard&&!!f.metadata.isFromEmptySelection,m=typeof f.metadata.multicursorText<"u"?f.metadata.multicursorText:null,_=f.metadata.mode),this._viewController.paste(f.text,g,m,_)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(f=>{f.replacePrevCharCnt||f.replaceNextCharCnt||f.positionDelta?this._viewController.compositionType(f.text,f.replacePrevCharCnt,f.replaceNextCharCnt,f.positionDelta):this._viewController.type(f.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(f=>{this._viewController.setSelection(f)})),this._register(this._textAreaInput.onCompositionStart(f=>{const g=this.textArea.domNode,m=this._modelSelections[0],{distanceToModelLineStart:_,widthOfHiddenTextBefore:v}=(()=>{const S=g.value.substring(0,Math.min(g.selectionStart,g.selectionEnd)),w=S.lastIndexOf(` +`),L=S.substring(w+1),I=L.lastIndexOf(" "),N=L.length-I-1,R=m.getStartPosition(),T=Math.min(R.column-1,N),A=R.column-1-T,F=L.substring(0,L.length-T),{tabSize:B}=this._context.viewModel.model.getOptions(),W=measureText(this.textArea.domNode.ownerDocument,F,this._fontInfo,B);return{distanceToModelLineStart:A,widthOfHiddenTextBefore:W}})(),{distanceToModelLineEnd:C}=(()=>{const S=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),w=S.indexOf(` +`),L=w===-1?S:S.substring(0,w),I=L.indexOf(" "),N=I===-1?L.length:L.length-I-1,R=m.getEndPosition(),T=Math.min(this._context.viewModel.model.getLineMaxColumn(R.lineNumber)-R.column,N);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(R.lineNumber)-R.column-T}})();this._context.viewModel.revealRange("keyboard",!0,Range$2.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new VisibleTextAreaData(this._context,m.startLineNumber,_,v,C),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(f=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(IME.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=getMapForWordSeparators(t,[]);let r=!0,o=e.column,a=!0,l=e.column,c=0;for(;c<50&&(r||a);){if(r&&o<=1&&(r=!1),r){const d=i.charCodeAt(o-2);s.get(d)!==0?r=!1:o--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);s.get(d)!==0?a=!1:l++}c++}return[i.substring(o-1,l-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=getMapForWordSeparators(this._context.configuration.options.get(132),[]);let s=e.column,r=0;for(;s>1;){const o=t.charCodeAt(s-2);if(i.get(o)!==0||r>50)return t.substring(s-1,e.column-1);r++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!isHighSurrogate(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var i,s,r;if(e.get(2)===1){const o=(i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))==null?void 0:i.getAriaLabel(),a=(s=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))==null?void 0:s.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))==null?void 0:r.getAriaLabel(),c=localize("accessibilityModeOff","The editor is not accessible at this time.");return o?localize("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,o):a?localize("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?localize("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===EditorOptions.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(146).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const r=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*r.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=canUseZeroSizeTextarea?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(67),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(125))),(e.hasChanged(34)||e.hasChanged(92))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!IME.enabled||e.get(34)&&e.get(92)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Position$1(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)==null||t.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const i=this._visibleTextArea.visibleTextareaStart,s=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,o=this._visibleTextArea.endPosition;if(r&&o&&i&&s&&s.left>=this._scrollLeft&&i.left<=this._scrollLeft+this._contentWidth){const a=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,l=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let c=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+i.left-this._scrollLeft,u=s.left-i.left+1;if(dthis._contentWidth&&(u=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),m=f.tokens.findTokenIndexAtOffset(o.column-1),_=g===m,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=l*this._lineHeight,this.textArea.domNode.scrollLeft=c,this._doRender({lastRenderPosition:null,top:a,left:d,width:u,height:this._lineHeight,useCover:!1,color:(TokenizationRegistry.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(isMacintosh||this._accessibilitySupport===2){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const i=this._textAreaInput.textAreaState.newlineCountBeforeSelection??this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=i*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:canUseZeroSizeTextarea?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:canUseZeroSizeTextarea?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;applyFontInfo(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Color.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Margin.OUTER_CLASS_NAME):s.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+LineNumbersOverlay.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};TextAreaHandler=__decorate$1V([__param$1V(3,IKeybindingService),__param$1V(4,IInstantiationService)],TextAreaHandler);function measureText(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const r=n.createElement("span");applyFontInfo(r,t),r.style.whiteSpace="pre",r.style.tabSize=`${i*t.spaceWidth}px`,r.append(e),s.appendChild(r),n.body.appendChild(s);const o=r.offsetWidth;return s.remove(),o}const autoCloseAlways=()=>!0,autoCloseNever=()=>!1,autoCloseBeforeWhitespace=n=>n===" "||n===" ";class CursorConfiguration{static shouldRecreate(e){return e.hasChanged(146)||e.hasChanged(132)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(129)||e.hasChanged(50)||e.hasChanged(92)||e.hasChanged(131)}constructor(e,t,i,s){this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,o=r.get(146),a=r.get(50);this.readOnly=r.get(92),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(117),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=r.get(129),this.wordSeparators=r.get(132),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(77),this.multiCursorPaste=r.get(79),this.multiCursorLimit=r.get(80),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.wordSegmenterLocales=r.get(131),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const c=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(c==null?void 0:c.blockCommentStartToken)??null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)==null?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=createScopedLineTokens(t,i-1),r=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return r?r.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return normalizeIndentation(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return autoCloseBeforeWhitespace;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return autoCloseAlways;case"never":return autoCloseNever}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return CursorColumns.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=CursorColumns.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),r=e.getLineMinColumn(t);if(so?o:s}}let CursorState$1=class Gv{static fromModelState(e){return new PartialModelCursorState(e)}static fromViewState(e){return new PartialViewCursorState(e)}static fromModelSelection(e){const t=Selection$1.liftSelection(e),i=new SingleCursorState(Range$2.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Gv.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;ir,c=s>o,d=so||Cs||v0&&s--,ColumnSelection.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const r=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=r;l<=o;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new Position$1(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-prevCharLength(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Position$1(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),r=e.getLineContent(t.lineNumber),o=AtomicTabMoveOperations.atomicPosition(r,t.column-1,i,0);if(o!==-1&&o+1>=s)return new Position$1(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?MoveOperations.leftPositionAtomicSoftTabs(t,i,e.tabSize):MoveOperations.leftPosition(t,i);return new CursorPosition(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,r){let o,a;if(i.hasSelection()&&!s)o=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(r-1)),c=t.normalizePosition(MoveOperations.clipPositionColumn(l,t),0),d=MoveOperations.left(e,t,c);o=d.lineNumber,a=d.column}return i.move(s,o,a,0)}static clipPositionColumn(e,t){return new Position$1(e.lineNumber,MoveOperations.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,c),g?r=0:r=c-CursorColumns.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const m=new Position$1(i,s),_=t.normalizePosition(m,l);r=r+(s-_.column),i=_.lineNumber,s=_.column}return new CursorPosition(i,s,r)}static down(e,t,i,s,r,o,a){return this.vertical(e,t,i,s,r,i+o,a,4)}static moveDown(e,t,i,s,r){let o,a;i.hasSelection()&&!s?(o=i.selection.endLineNumber,a=i.selection.endColumn):(o=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=MoveOperations.down(e,t,o+l,a,i.leftoverVisibleColumns,r,!0),t.normalizePosition(new Position$1(c.lineNumber,c.column),2).lineNumber>o)break;while(l++<10&&o+l1&&this._isBlankLine(t,r);)r--;for(;r>1&&!this._isBlankLine(t,r);)r--;return i.move(s,r,t.getLineMinColumn(r),0)}static moveToNextBlankLine(e,t,i,s){const r=t.getLineCount();let o=i.position.lineNumber;for(;o=f.length+1)return!1;const g=f.charAt(u.column-2),m=s.get(g);if(!m)return!1;if(isQuote(g)){if(i==="never")return!1}else if(t==="never")return!1;const _=f.charAt(u.column-1);let v=!1;for(const C of m)C.open===g&&C.close===_&&(v=!0);if(!v)return!1;if(e==="auto"){let C=!1;for(let S=0,w=a.length;S1){const r=t.getLineContent(s.lineNumber),o=firstNonWhitespaceIndex(r),a=o===-1?r.length+1:o+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=CursorColumns.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new Range$2(s.lineNumber,d,s.lineNumber,s.column)}}return Range$2.fromPositions(DeleteOperations.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=getLeftDeleteOffset(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new Position$1(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let r=null;i.sort((o,a)=>Position$1.compare(o.getStartPosition(),a.getEndPosition()));for(let o=0,a=i.length;o1&&(r==null?void 0:r.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),f=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,f=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber));const m=new Range$2(d,u,f,g);r=m,m.isEmpty()?s[o]=null:s[o]=new ReplaceCommand(m,"")}else s[o]=null;else s[o]=new ReplaceCommand(l,"")}return new EditOperationResult(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class WordOperations{static _createWord(e,t,i,s,r){return{start:s,end:r,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;const r=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let o=i.column-2;o>=0;o--){const a=e.charCodeAt(o),l=t.get(a);if(r&&o===r.index)return this._createIntlWord(r,l);if(l===0){if(s===2)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(l===2){if(s===1)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(l===1&&s!==0)return this._createWord(e,s,l,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const r=t.findNextIntlWordAtOrAfterOffset(e,s),o=e.length;for(let a=s;a=0;o--){const a=e.charCodeAt(o),l=t.get(a);if(r&&o===r.index)return o;if(l===1||i===1&&l===2||i===2&&l===0)return o+1}return 0}static moveWordLeft(e,t,i,s,r){let o=i.lineNumber,a=i.column;a===1&&o>1&&(o=o-1,a=t.getLineMaxColumn(o));let l=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,a));if(s===0)return new Position$1(o,l?l.start+1:1);if(s===1)return!r&&l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,l.start+1))),new Position$1(o,l?l.start+1:1);if(s===3){for(;l&&l.wordType===2;)l=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,l.start+1));return new Position$1(o,l?l.start+1:1)}return l&&a<=l.end+1&&(l=WordOperations._findPreviousWordOnLine(e,t,new Position$1(o,l.start+1))),new Position$1(o,l?l.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new Position$1(i-1,e.getLineMaxColumn(i-1)):t;const r=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const a=r.charCodeAt(o-2),l=r.charCodeAt(o-1);if(a===95&&l!==95)return new Position$1(i,o);if(a===45&&l!==45)return new Position$1(i,o);if((isLowerAsciiLetter(a)||isAsciiDigit(a))&&isUpperAsciiLetter(l))return new Position$1(i,o);if(isUpperAsciiLetter(a)&&isUpperAsciiLetter(l)&&o+1=l.start+1&&(l=WordOperations._findNextWordOnLine(e,t,new Position$1(r,l.end+1))),l?o=l.start+1:o=t.getLineMaxColumn(r);return new Position$1(r,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?c=1:(l--,c=s.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=WordOperations._findPreviousWordOnLine(i,s,new Position$1(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new Range$2(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new Position$1(i.positionLineNumber,i.positionColumn),r=this._deleteInsideWordWhitespace(t,s);return r||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let r=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,r))return null;let o=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,o))return null;for(;r>0&&this._charAtIsWhitespace(i,r-1);)r--;for(;o+11?new Range$2(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,f)=>(u=Math.min(u,i.column),f=Math.max(f,i.column),new Range$2(i.lineNumber,u,i.lineNumber,f)),l=u=>{let f=u.start+1,g=u.end+1,m=!1;for(;g-11&&this._charAtIsWhitespace(s,f-2);)f--;return a(f,g)},c=WordOperations._findPreviousWordOnLine(e,t,i);if(c&&o(c))return l(c);const d=WordOperations._findNextWordOnLine(e,t,i);return d&&o(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,r+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=WordOperations._moveWordPartLeft(e,i);return new Range$2(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=f.start+1&&(f=WordOperations._findNextWordOnLine(i,s,new Position$1(l,f.end+1))),f?c=f.start+1:c!!e)}class CursorMoveCommands{static addCursorDown(e,t,i){const s=[];let r=0;for(let o=0,a=t.length;oc&&(d=c,u=e.model.getLineMaxColumn(d)),CursorState$1.fromModelState(new SingleCursorState(new Range$2(o.lineNumber,1,d,u),2,0,new Position$1(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),CursorState$1.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return CursorState$1.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const r=e.model.validatePosition(s);return CursorState$1.fromModelState(WordOperations.word(e.cursorConfig,e.model,t.modelState,i,r))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new CursorState$1(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return CursorState$1.fromViewState(new SingleCursorState(new Range$2(i,s,i,s),0,0,new Position$1(i,s),0))}static moveTo(e,t,i,s,r){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,s,r)}const o=e.model.validatePosition(s),a=r?e.coordinatesConverter.validateViewPosition(new Position$1(r.lineNumber,r.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return CursorState$1.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,r,o){switch(i){case 0:return o===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,r);case 1:return o===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,r);case 2:return o===2?this._moveUpByViewLines(e,t,s,r):this._moveUpByModelLines(e,t,s,r);case 3:return o===2?this._moveDownByViewLines(e,t,s,r):this._moveDownByModelLines(e,t,s,r);case 4:return o===2?t.map(a=>CursorState$1.fromViewState(MoveOperations.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>CursorState$1.fromModelState(MoveOperations.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return o===2?t.map(a=>CursorState$1.fromViewState(MoveOperations.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>CursorState$1.fromModelState(MoveOperations.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,r){const o=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,r),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?o=i.endLineNumber-1:rCursorState$1.fromViewState(MoveOperations.moveLeft(e.cursorConfig,e,r.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let r=0,o=t.length;rCursorState$1.fromViewState(MoveOperations.moveRight(e.cursorConfig,e,r.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let r=0,o=t.length;r{this.model.tokenization.forceTokenization(g);const m=this.model.tokenization.getLineTokens(g),_=this.model.getLineMaxColumn(g)-1;return createScopedLineTokens(m,_)};this.model.tokenization.forceTokenization(e.startLineNumber);const i=this.model.tokenization.getLineTokens(e.startLineNumber),s=createScopedLineTokens(i,e.startColumn-1),r=LineTokens.createEmpty("",s.languageIdCodec),o=e.startLineNumber-1;if(o===0||!(s.firstCharOffset===0))return r;const c=t(o);if(!(s.languageId===c.languageId))return r;const u=c.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(u)}}class IndentationLineProcessor{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){var o,a;const i=(l,c)=>{const d=getLeadingWhitespace(l);return c+l.substring(d.length)};(a=(o=this.model.tokenization).forceTokenization)==null||a.call(o,e);const s=this.model.tokenization.getLineTokens(e);let r=this.getProcessedTokens(s).getLineContent();return t!==void 0&&(r=i(r,t)),r}getProcessedTokens(e){const t=l=>l===2||l===3||l===1,i=e.getLanguageId(0),r=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),o=[];return e.forEach(l=>{const c=e.getStandardTokenType(l);let d=e.getTokenText(l);t(c)&&(d=d.replace(r,""));const u=e.getMetadata(l);o.push({text:d,metadata:u})}),LineTokens.createFromTextAndMetadata(o,e.languageIdCodec)}}function isLanguageDifferentFromLineStart(n,e){n.tokenization.forceTokenization(e.lineNumber);const t=n.tokenization.getLineTokens(e.lineNumber),i=createScopedLineTokens(t,e.column-1),s=i.firstCharOffset===0,r=t.getLanguageId(0)===i.languageId;return!s&&!r}function getEnterAction(n,e,t,i){e.tokenization.forceTokenization(t.startLineNumber);const s=e.getLanguageIdAtPosition(t.startLineNumber,t.startColumn),r=i.getLanguageConfiguration(s);if(!r)return null;const a=new IndentationContextProcessor(e,i).getProcessedTokenContextAroundRange(t),l=a.previousLineProcessedTokens.getLineContent(),c=a.beforeRangeProcessedTokens.getLineContent(),d=a.afterRangeProcessedTokens.getLineContent(),u=r.onEnter(n,l,c,d);if(!u)return null;const f=u.indentAction;let g=u.appendText;const m=u.removeText||0;g?f===IndentAction.Indent&&(g=" "+g):f===IndentAction.Indent||f===IndentAction.IndentOutdent?g=" ":g="";let _=getIndentationAtPosition(e,t.startLineNumber,t.startColumn);return m&&(_=_.substring(0,_.length-m)),{indentAction:f,appendText:g,removeText:m,indentation:_}}var __decorate$1U=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1U=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ShiftCommand_1;const repeatCache=Object.create(null);function cachedStringRepeat(n,e){if(e<=0)return"";repeatCache[n]||(repeatCache[n]=["",n]);const t=repeatCache[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let ShiftCommand=ShiftCommand_1=class{static unshiftIndent(e,t,i,s,r){const o=CursorColumns.visibleColumnFromColumn(e,t,i);if(r){const a=cachedStringRepeat(" ",s),c=CursorColumns.prevIndentTabStop(o,s)/s;return cachedStringRepeat(a,c)}else{const a=" ",c=CursorColumns.prevRenderTabStop(o,i)/i;return cachedStringRepeat(a,c)}}static shiftIndent(e,t,i,s,r){const o=CursorColumns.visibleColumnFromColumn(e,t,i);if(r){const a=cachedStringRepeat(" ",s),c=CursorColumns.nextIndentTabStop(o,s)/s;return cachedStringRepeat(a,c)}else{const a=" ",c=CursorColumns.nextRenderTabStop(o,i)/i;return cachedStringRepeat(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:r,indentSize:o,insertSpaces:a}=this._opts,l=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=s;u++,c=d){d=0;const f=e.getLineContent(u);let g=firstNonWhitespaceIndex(f);if(this._opts.isUnshift&&(f.length===0||g===0)||!l&&!this._opts.isUnshift&&f.length===0)continue;if(g===-1&&(g=f.length),u>1&&CursorColumns.visibleColumnFromColumn(f,g+1,r)%o!==0&&e.tokenization.isCheapToTokenize(u-1)){const v=getEnterAction(this._opts.autoIndent,e,new Range$2(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(v){if(d=c,v.appendText)for(let C=0,S=v.appendText.length;C1){let s,r=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return r;const o=n.getLineContent(s);if(t.shouldIgnore(s)||/^\s+$/.test(o)||o===""){r=s;continue}return s}}return-1}function getInheritIndentForLine(n,e,t,i=!0,s){if(n<4)return null;const r=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!r)return null;const o=new ProcessedIndentRulesSupport(e,r,s);if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const a=getPrecedingValidLine(e,t,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(o.shouldIncrease(a)||o.shouldIndentNextLine(a)){const l=e.getLineContent(a);return{indentation:getLeadingWhitespace(l),action:IndentAction.Indent,line:a}}else if(o.shouldDecrease(a)){const l=e.getLineContent(a);return{indentation:getLeadingWhitespace(l),action:null,line:a}}else{if(a===1)return{indentation:getLeadingWhitespace(e.getLineContent(a)),action:null,line:a};const l=a-1,c=r.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(u)){d=u;break}return{indentation:getLeadingWhitespace(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:getLeadingWhitespace(e.getLineContent(a)),action:null,line:a};for(let d=a;d>0;d--){if(o.shouldIncrease(d))return{indentation:getLeadingWhitespace(e.getLineContent(d)),action:IndentAction.Indent,line:d};if(o.shouldIndentNextLine(d)){let u=0;for(let f=d-1;f>0;f--)if(!o.shouldIndentNextLine(d)){u=f;break}return{indentation:getLeadingWhitespace(e.getLineContent(u+1)),action:null,line:u+1}}else if(o.shouldDecrease(d))return{indentation:getLeadingWhitespace(e.getLineContent(d)),action:null,line:d}}return{indentation:getLeadingWhitespace(e.getLineContent(1)),action:null,line:1}}}function getGoodIndentForLine(n,e,t,i,s,r){if(n<4)return null;const o=r.getLanguageConfiguration(t);if(!o)return null;const a=r.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=new ProcessedIndentRulesSupport(e,a,r),c=getInheritIndentForLine(n,e,i,void 0,r);if(c){const d=c.line;if(d!==void 0){let u=!0;for(let f=d;f0){const C=e.getLineContent(v);if(c.shouldIndentNextLine(C)&&c.shouldIncrease(_)){const S=getInheritIndentForLine(o,e,t.startLineNumber,!1,r),w=S==null?void 0:S.indentation;if(w!==void 0){const L=e.getLineContent(t.startLineNumber),I=getLeadingWhitespace(L),R=s.shiftIndent(w)===I,T=/^\s*$/.test(m),A=n.autoClosingPairs.autoClosingPairsOpenByEnd.get(i),B=A&&A.length>0&&T;if(R&&B)return w}}}return null}function getIndentMetadata(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}function createVirtualModelWithModifiedTokensAtLine(n,e,t){return{tokenization:{getLineTokens:s=>s===e?t:n.tokenization.getLineTokens(s),getLanguageId:()=>n.getLanguageId(),getLanguageIdAtPosition:(s,r)=>n.getLanguageIdAtPosition(s,r)},getLineContent:s=>s===e?t.getLineContent():n.getLineContent(s)}}class AutoIndentOperation{static getEdits(e,t,i,s,r){if(!r&&this._isAutoIndentType(e,t,i)){const o=[];for(const l of i){const c=this._findActualIndentationForSelection(e,t,l,s);if(c===null)return;o.push({selection:l,indentation:c})}const a=AutoClosingOpenCharTypeOperation.getAutoClosingPairClose(e,t,i,s,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,s,a)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,r=i.length;sshiftIndent(e,a),unshiftIndent:a=>unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;const o=getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return r===e.normalizeIndentation(o)?null:r}static _getIndentationAndAutoClosingPairEdits(e,t,i,s,r){const o=i.map(({selection:l,indentation:c})=>{if(r!==null){const d=this._getEditFromIndentationAndSelection(e,t,c,l,s,!1);return new TypeWithIndentationAndAutoClosingCommand(d,l,s,r)}else{const d=this._getEditFromIndentationAndSelection(e,t,c,l,s,!0);return typeCommand(d.range,d.text,!1)}}),a={shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1};return new EditOperationResult(4,o,a)}static _getEditFromIndentationAndSelection(e,t,i,s,r,o=!0){const a=s.startLineNumber,l=t.getLineFirstNonWhitespaceColumn(a);let c=e.normalizeIndentation(i);if(l!==0){const u=t.getLineContent(a);c+=u.substring(l-1,s.startColumn-1)}return c+=o?r:"",{range:new Range$2(a,1,s.endLineNumber,s.endColumn),text:c}}}class AutoClosingOvertypeOperation{static getEdits(e,t,i,s,r,o){if(isAutoClosingOvertype(t,i,s,r,o))return this._runAutoClosingOvertype(e,s,o)}static _runAutoClosingOvertype(e,t,i){const s=[];for(let r=0,o=t.length;rnew ReplaceCommand(new Range$2(a.positionLineNumber,a.positionColumn,a.positionLineNumber,a.positionColumn+1),"",!1));return new EditOperationResult(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}}class AutoClosingOpenCharTypeOperation{static getEdits(e,t,i,s,r,o){if(!o){const a=this.getAutoClosingPairClose(e,t,i,s,r);if(a!==null)return this._runAutoClosingOpenCharType(i,s,r,a)}}static _runAutoClosingOpenCharType(e,t,i,s){const r=[];for(let o=0,a=e.length;o{const _=m.getPosition();return r?{lineNumber:_.lineNumber,beforeColumn:_.column-s.length,afterColumn:_.column}:{lineNumber:_.lineNumber,beforeColumn:_.column,afterColumn:_.column}}),a=this._findAutoClosingPairOpen(e,t,o.map(m=>new Position$1(m.lineNumber,m.beforeColumn)),s);if(!a)return null;let l,c;if(isQuote(s)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),f=u?u.close:"";let g=!0;for(const m of o){const{lineNumber:_,beforeColumn:v,afterColumn:C}=m,S=t.getLineContent(_),w=S.substring(0,v-1),L=S.substring(C-1);if(L.startsWith(f)||(g=!1),L.length>0){const T=L.charAt(0);if(!this._isBeforeClosingBrace(e,L)&&!c(T))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const T=getMapForWordSeparators(e.wordSeparators,[]);if(w.length>0){const A=w.charCodeAt(w.length-1);if(T.get(A)===0)return null}}if(!t.tokenization.isCheapToTokenize(_))return null;t.tokenization.forceTokenization(_);const I=t.tokenization.getLineTokens(_),N=createScopedLineTokens(I,v-1);if(!a.shouldAutoClose(N,v-N.firstCharOffset))return null;const R=a.findNeutralCharacter();if(R){const T=t.tokenization.getTokenTypeIfInsertingCharacter(_,v,R);if(!a.isOK(T))return null}}return g?a.close.substring(0,a.close.length-f.length):a.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let r=null;for(const o of s)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!r||o.open.length>r.open.length)&&(r=o);return r}static _findAutoClosingPairOpen(e,t,i,s){const r=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!r)return null;let o=null;for(const a of r)if(o===null||a.open.length>o.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new Range$2(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+s!==a.open){l=!1;break}l&&(o=a)}return o}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),s=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],r=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],o=s.some(l=>t.startsWith(l.open)),a=r.some(l=>t.startsWith(l.close));return!o&&a}}class SurroundSelectionOperation{static getEdits(e,t,i,s,r){if(!r&&this._isSurroundSelectionType(e,t,i,s))return this._runSurroundSelectionType(e,i,s)}static _runSurroundSelectionType(e,t,i){const s=[];for(let r=0,o=t.length;r=4){const l=getIndentForEnter(e.autoIndent,t,s,{unshiftIndent:c=>unshiftIndent(e,c),shiftIndent:c=>shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,u=t.getLineContent(s.endLineNumber),f=firstNonWhitespaceIndex(u);if(f>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,f+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new ReplaceCommandWithoutChangingPosition(s,` +`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=f+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new ReplaceCommandWithOffsetCursorState(s,` +`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return typeCommand(s,` +`+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const s=[];for(let r=0,o=i.length;rthis._compositionType(i,d,r,o,a,l));return new EditOperationResult(4,c,{shouldPushStackElementBefore:shouldPushStackElementBetween(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,r,o){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+r),d=new Range$2(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&o===0?null:new ReplaceCommandWithOffsetCursorState(d,i,0,o)}}class TypeWithoutInterceptorsOperation{static getEdits(e,t,i){const s=[];for(let o=0,a=t.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(lastNonWhitespaceIndex(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=getEnterAction(e.autoIndent,t,new Range$2(a,l,a,l),e.languageConfigurationService);c&&(r=c.indentation+c.appendText)}return s&&(s===IndentAction.Indent&&(r=shiftIndent(e,r)),s===IndentAction.Outdent&&(r=unshiftIndent(e,r)),r=e.normalizeIndentation(r)),r||null}static _replaceJumpToNextIndent(e,t,i,s){let r="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),l=e.indentSize,c=l-a%l;for(let d=0;d2?c.charCodeAt(l.column-2):0)===92&&u)return!1;if(n.autoClosingOvertype==="auto"){let g=!1;for(let m=0,_=i.length;m<_;m++){const v=i[m];if(l.lineNumber===v.startLineNumber&&l.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}function typeCommand(n,e,t){return t?new ReplaceCommandWithoutChangingPosition(n,e,!0):new ReplaceCommand(n,e,!0)}function shiftIndent(n,e,t){return t=t||1,ShiftCommand.shiftIndent(e,e.length+t,n.tabSize,n.indentSize,n.insertSpaces)}function unshiftIndent(n,e,t){return t=t||1,ShiftCommand.unshiftIndent(e,e.length+t,n.tabSize,n.indentSize,n.insertSpaces)}function shouldSurroundChar(n,e){return isQuote(e)?n.autoSurround==="quotes"||n.autoSurround==="languageDefined":n.autoSurround==="brackets"||n.autoSurround==="languageDefined"}class TypeOperations{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let r=0,o=i.length;r{const s=t.get(ICodeEditorService).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=getActiveElement();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(ICodeEditorService).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var CoreNavigationCommands;(function(n){class e extends CoreEditorCommand{constructor(S){super(S),this._inSelectionMode=S.inSelectionMode}runCoreEditorCommand(S,w){if(!w.position)return;S.model.pushStackElement(),S.setCursorStates(w.source,3,[CursorMoveCommands.moveTo(S,S.getPrimaryCursorState(),this._inSelectionMode,w.position,w.viewPosition)])&&w.revealType!==2&&S.revealAllCursors(w.source,!0,!0)}}n.MoveTo=registerEditorCommand(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=registerEditorCommand(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends CoreEditorCommand{runCoreEditorCommand(S,w){S.model.pushStackElement();const L=this._getColumnSelectResult(S,S.getPrimaryCursorState(),S.getCursorColumnSelectData(),w);L!==null&&(S.setCursorStates(w.source,3,L.viewStates.map(I=>CursorState$1.fromViewState(I))),S.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:L.fromLineNumber,fromViewVisualColumn:L.fromVisualColumn,toViewLineNumber:L.toLineNumber,toViewVisualColumn:L.toVisualColumn}),L.reversed?S.revealTopMostCursor(w.source):S.revealBottomMostCursor(w.source))}}n.ColumnSelect=registerEditorCommand(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(C,S,w,L){if(typeof L.position>"u"||typeof L.viewPosition>"u"||typeof L.mouseColumn>"u")return null;const I=C.model.validatePosition(L.position),N=C.coordinatesConverter.validateViewPosition(new Position$1(L.viewPosition.lineNumber,L.viewPosition.column),I),R=L.doColumnSelect?w.fromViewLineNumber:N.lineNumber,T=L.doColumnSelect?w.fromViewVisualColumn:L.mouseColumn-1;return ColumnSelection.columnSelect(C.cursorConfig,C,R,T,N.lineNumber,L.mouseColumn-1)}}),n.CursorColumnSelectLeft=registerEditorCommand(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(C,S,w,L){return ColumnSelection.columnSelectLeft(C.cursorConfig,C,w)}}),n.CursorColumnSelectRight=registerEditorCommand(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(C,S,w,L){return ColumnSelection.columnSelectRight(C.cursorConfig,C,w)}});class i extends t{constructor(S){super(S),this._isPaged=S.isPaged}_getColumnSelectResult(S,w,L,I){return ColumnSelection.columnSelectUp(S.cursorConfig,S,L,this._isPaged)}}n.CursorColumnSelectUp=registerEditorCommand(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=registerEditorCommand(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(S){super(S),this._isPaged=S.isPaged}_getColumnSelectResult(S,w,L,I){return ColumnSelection.columnSelectDown(S.cursorConfig,S,L,this._isPaged)}}n.CursorColumnSelectDown=registerEditorCommand(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=registerEditorCommand(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends CoreEditorCommand{constructor(){super({id:"cursorMove",precondition:void 0,metadata:CursorMove.metadata})}runCoreEditorCommand(S,w){const L=CursorMove.parse(w);L&&this._runCursorMove(S,w.source,L)}_runCursorMove(S,w,L){S.model.pushStackElement(),S.setCursorStates(w,3,r._move(S,S.getCursorStates(),L)),S.revealAllCursors(w,!0)}static _move(S,w,L){const I=L.select,N=L.value;switch(L.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return CursorMoveCommands.simpleMove(S,w,L.direction,I,N,L.unit);case 11:case 13:case 12:case 14:return CursorMoveCommands.viewportMove(S,w,L.direction,I,N);default:return null}}}n.CursorMoveImpl=r,n.CursorMove=registerEditorCommand(new r);class o extends CoreEditorCommand{constructor(S){super(S),this._staticArgs=S.args}runCoreEditorCommand(S,w){let L=this._staticArgs;this._staticArgs.value===-1&&(L={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:w.pageSize||S.cursorConfig.pageSize}),S.model.pushStackElement(),S.setCursorStates(w.source,3,CursorMoveCommands.simpleMove(S,S.getCursorStates(),L.direction,L.select,L.value,L.unit)),S.revealAllCursors(w.source,!0)}}n.CursorLeft=registerEditorCommand(new o({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=registerEditorCommand(new o({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1039}})),n.CursorRight=registerEditorCommand(new o({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=registerEditorCommand(new o({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1041}})),n.CursorUp=registerEditorCommand(new o({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=registerEditorCommand(new o({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=registerEditorCommand(new o({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:11}})),n.CursorPageUpSelect=registerEditorCommand(new o({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1035}})),n.CursorDown=registerEditorCommand(new o({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=registerEditorCommand(new o({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=registerEditorCommand(new o({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:12}})),n.CursorPageDownSelect=registerEditorCommand(new o({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1036}})),n.CreateCursor=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(C,S){if(!S.position)return;let w;S.wholeLine?w=CursorMoveCommands.line(C,C.getPrimaryCursorState(),!1,S.position,S.viewPosition):w=CursorMoveCommands.moveTo(C,C.getPrimaryCursorState(),!1,S.position,S.viewPosition);const L=C.getCursorStates();if(L.length>1){const I=w.modelState?w.modelState.position:null,N=w.viewState?w.viewState.position:null;for(let R=0,T=L.length;RN&&(I=N);const R=new Range$2(I,1,I,C.model.getLineMaxColumn(I));let T=0;if(w.at)switch(w.at){case RevealLine_.RawAtArgument.Top:T=3;break;case RevealLine_.RawAtArgument.Center:T=1;break;case RevealLine_.RawAtArgument.Bottom:T=4;break}const A=C.coordinatesConverter.convertModelRangeToViewRange(R);C.revealRange(S.source,!1,A,T,0)}}),n.SelectAll=new class extends EditorOrNativeTextInputCommand{constructor(){super(SelectAllCommand)}runDOMCommand(C){isFirefox&&(C.focus(),C.select()),C.ownerDocument.execCommand("selectAll")}runEditorCommand(C,S,w){const L=S._getViewModel();L&&this.runCoreEditorCommand(L,w)}runCoreEditorCommand(C,S){C.model.pushStackElement(),C.setCursorStates("keyboard",3,[CursorMoveCommands.selectAll(C,C.getPrimaryCursorState())])}},n.SetSelection=registerEditorCommand(new class extends CoreEditorCommand{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(C,S){S.selection&&(C.model.pushStackElement(),C.setCursorStates(S.source,3,[CursorState$1.fromModelSelection(S.selection)]))}})})(CoreNavigationCommands||(CoreNavigationCommands={}));const columnSelectionCondition=ContextKeyExpr.and(EditorContextKeys.textInputFocus,EditorContextKeys.columnSelection);function registerColumnSelection(n,e){KeybindingsRegistry.registerKeybindingRule({id:n,primary:e,when:columnSelectionCondition,weight:CORE_WEIGHT+1})}registerColumnSelection(CoreNavigationCommands.CursorColumnSelectLeft.id,1039);registerColumnSelection(CoreNavigationCommands.CursorColumnSelectRight.id,1041);registerColumnSelection(CoreNavigationCommands.CursorColumnSelectUp.id,1040);registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageUp.id,1035);registerColumnSelection(CoreNavigationCommands.CursorColumnSelectDown.id,1042);registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageDown.id,1036);function registerCommand$2(n){return n.register(),n}var CoreEditingCommands;(function(n){class e extends EditorCommand{runEditorCommand(i,s,r){const o=s._getViewModel();o&&this.runCoreEditingCommand(s,o,r||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=registerEditorCommand(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,EnterOperation.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection)))}}),n.Outdent=registerEditorCommand(new class extends e{constructor(){super({id:"outdent",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,EditorContextKeys.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.outdent(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.Tab=registerEditorCommand(new class extends e{constructor(){super({id:"tab",precondition:EditorContextKeys.writable,kbOpts:{weight:CORE_WEIGHT,kbExpr:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,EditorContextKeys.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.tab(i.cursorConfig,i.model,i.getCursorStates().map(r=>r.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=registerEditorCommand(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[r,o]=DeleteOperations.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(2)}}),n.DeleteRight=registerEditorCommand(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:CORE_WEIGHT,kbExpr:EditorContextKeys.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[r,o]=DeleteOperations.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));r&&t.pushUndoStop(),t.executeCommands(this.id,o),i.setPrevEditOperationType(3)}}),n.Undo=new class extends EditorOrNativeTextInputCommand{constructor(){super(UndoCommand)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(92)===!0))return i.getModel().undo()}},n.Redo=new class extends EditorOrNativeTextInputCommand{constructor(){super(RedoCommand)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(92)===!0))return i.getModel().redo()}}})(CoreEditingCommands||(CoreEditingCommands={}));class EditorHandlerCommand extends Command{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(ICodeEditorService).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function registerOverwritableCommand(n,e){registerCommand$2(new EditorHandlerCommand("default:"+n,n)),registerCommand$2(new EditorHandlerCommand(n,n,e))}registerOverwritableCommand("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});registerOverwritableCommand("replacePreviousChar");registerOverwritableCommand("compositionType");registerOverwritableCommand("compositionStart");registerOverwritableCommand("compositionEnd");registerOverwritableCommand("paste");registerOverwritableCommand("cut");class ViewController{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){CoreNavigationCommands.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){CoreNavigationCommands.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){CoreNavigationCommands.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),CoreNavigationCommands.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),CoreNavigationCommands.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){CoreNavigationCommands.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){CoreNavigationCommands.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){CoreNavigationCommands.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){CoreNavigationCommands.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){CoreNavigationCommands.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){CoreNavigationCommands.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){CoreNavigationCommands.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){CoreNavigationCommands.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){CoreNavigationCommands.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class RenderedLinesCollection{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new BugIndicatingError("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let r=0,o=0;for(let l=i;l<=s;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(o===0?(r=c,o=1):o++)}if(e=s&&a<=r&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),r=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>r)return null;if(i+e>r)return this._lines.splice(e-this._rendLineNumberStart,r-e+1);const o=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),s=!0}}return s}}class VisibleLinesCollection{constructor(e){this._lineFactory=e,this.domNode=this._createDomNode(),this._linesCollection=new RenderedLinesCollection(this._lineFactory)}_createDomNode(){const e=createFastDomNode(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(146)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const o=t,a=Math.min(i,r.rendLineNumberStart-1);o<=a&&(this._insertLinesBefore(r,o,a,s,t),r.linesLength+=a-o+1)}else if(r.rendLineNumberStart0&&(this._removeLinesBefore(r,o),r.linesLength-=o)}if(r.rendLineNumberStart=t,r.rendLineNumberStart+r.linesLength-1i){const o=Math.max(0,i-r.rendLineNumberStart+1),l=r.linesLength-1-o+1;l>0&&(this._removeLinesAfter(r,l),r.linesLength-=l)}return this._finishRendering(r,!1,s),r}_renderUntouchedLines(e,t,i,s,r){const o=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=o+l;a[l].layoutLine(c,s[c-r],this._viewportData.lineHeight)}}_insertLinesBefore(e,t,i,s,r){const o=[];let a=0;for(let l=t;l<=i;l++)o[a++]=this._lineFactory.createLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");pr._ttPolicy&&(t=pr._ttPolicy.createHTML(t)),s.innerHTML=t;for(let r=0;re}),pr._sb=new StringBuilder(1e5);let ViewLayerRenderer=pr;class ViewOverlays extends ViewPart{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new VisibleLinesCollection({createLine:()=>new ViewOverlayLine(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);applyFontInfo(this.domNode,i),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),r.appendString(o),r.appendString(""),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i))}}class ContentViewOverlays extends ViewOverlays{constructor(e){super(e);const i=this._context.configuration.options.get(146);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(146);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class MarginViewOverlays extends ViewOverlays{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),applyFontInfo(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;applyFontInfo(this.domNode,t.get(50));const i=t.get(146);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class ViewUserInputEvents{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)==null||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)==null||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)==null||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)==null||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)==null||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return ViewUserInputEvents.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new Position$1(e.afterLineNumber,1)).lineNumber}}}const blockDecorations="";class BlockDecorations extends ViewPart{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(146),s=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==s&&(this.contentWidth=s,e=!0);const r=i.contentLeft;return this.contentLeft!==r&&(this.contentLeft=r,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const s of i){if(!s.options.blockClassName)continue;let r=this.blocks[t];r||(r=this.blocks[t]=createFastDomNode(document.createElement("div")),this.domNode.appendChild(r));let o,a;s.options.blockIsAfterEnd?(o=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!1),a=e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0)):(o=e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!0),a=s.range.isEmpty()&&!s.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(s.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(s.range.endLineNumber,!0));const[l,c,d,u]=s.options.blockPadding??[0,0,0,0];r.setClassName("blockDecorations-block "+s.options.blockClassName),r.setLeft(this.contentLeft-u),r.setWidth(this.contentWidth+u+c),r.setTop(o-e.scrollTop-l),r.setHeight(a-o+l+d),t++}for(let s=t;s0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const r=e.top,o=r,a=e.top+e.height,l=s.viewportHeight-a,c=r-i,d=o>=i,u=a,f=l>=i;let g=e.left;return g+t>s.scrollLeft+s.viewportWidth&&(g=s.scrollLeft+s.viewportWidth-t),gl){const f=u-(l-s);u-=f,i-=f}if(u=_,S=u+i<=f.height-v;return this._fixedOverflowWidgets?{fitsAbove:C,aboveTop:Math.max(d,_),fitsBelow:S,belowTop:u,left:m}:{fitsAbove:C,aboveTop:r,fitsBelow:S,belowTop:o,left:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new Coordinate(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var o,a;const t=r(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),i=((o=this._secondaryAnchor.viewPosition)==null?void 0:o.lineNumber)===((a=this._primaryAnchor.viewPosition)==null?void 0:a.lineNumber)?this._secondaryAnchor.viewPosition:null,s=r(i,this._affinity,this._lineHeight);return{primary:t,secondary:s};function r(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const f=l.column===1&&c===3?0:u.left,g=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new AnchorCoordinate(g,f,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(50);let r=t.left;return re.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){var t;if(!this._renderData||this._renderData.kind==="offViewport"){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,((t=this._renderData)==null?void 0:t.kind)==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&safeInvoke(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&safeInvoke(this._actual.afterRender,this._actual,this._renderData.position)}}class PositionPair{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class Coordinate{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class AnchorCoordinate{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function safeInvoke(n,e,...t){try{return n.call(e,...t)}catch{return null}}const currentLineHighlight="";class AbstractLineHighlightOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(146);this._renderLineHighlight=t.get(97),this._renderLineHighlightOnlyWhenFocus=t.get(98),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Selection$1(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const r of this._selections)t.add(r.positionLineNumber);const i=Array.from(t);i.sort((r,o)=>r-o),equals$1(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const s=this._selections.every(r=>r.isEmpty());return this._selectionIsEmpty!==s&&(this._selectionIsEmpty=s,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);return this._renderLineHighlight=t.get(97),this._renderLineHighlightOnlyWhenFocus=t.get(98),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=[];for(let o=t;o<=i;o++){const a=o-t;s[a]=""}if(this._wordWrap){const o=this._renderOne(e,!1);for(const a of this._cursorLineNumbers){const l=this._context.viewModel.coordinatesConverter,c=l.convertViewPositionToModelPosition(new Position$1(a,1)).lineNumber,d=l.convertModelPositionToViewPosition(new Position$1(c,1)).lineNumber,u=l.convertModelPositionToViewPosition(new Position$1(c,this._context.viewModel.model.getLineMaxColumn(c))).lineNumber,f=Math.max(d,t),g=Math.min(u,i);for(let m=f;m<=g;m++){const _=m-t;s[_]=o}}}const r=this._renderOne(e,!0);for(const o of this._cursorLineNumbers){if(oi)continue;const a=o-t;s[a]=r}this._renderData=s}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class CurrentLineHighlightOverlay extends AbstractLineHighlightOverlay{_renderOne(e,t){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class CurrentLineMarginHighlightOverlay extends AbstractLineHighlightOverlay{_renderOne(e,t){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}registerThemingParticipant((n,e)=>{const t=n.getColor(editorLineHighlight);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(editorLineHighlightBorder)){const i=n.getColor(editorLineHighlightBorder);i&&(e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),isHighContrast(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}});const decorations="";class DecorationsOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:Range$2.compareRangesUsingStarts(l.range,c.range)});const r=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,a=[];for(let l=r;l<=o;l++){const c=l-r;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let o=0,a=t.length;o',d=Math.max(l.range.startLineNumber,s),u=Math.min(l.range.endLineNumber,r);for(let f=d;f<=u;f++){const g=f-s;i[g]+=c}}}_renderNormalDecorations(e,t,i){const s=e.visibleRange.startLineNumber;let r=null,o=!1,a=null,l=!1;for(let c=0,d=t.length;c';a[f]+=C}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class EditorScrollbar extends ViewPart{constructor(e,t,i,s){super(e);const r=this._context.configuration.options,o=r.get(104),a=r.get(75),l=r.get(40),c=r.get(107),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+getThemeTypeSelector(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new SmoothScrollableElement(t.domNode,d,this._context.viewLayout.getScrollable())),PartFingerprints.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=createFastDomNode(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(f,g,m)=>{const _={};if(g){const v=f.scrollTop;v&&(_.scrollTop=this._context.viewLayout.getCurrentScrollTop()+v,f.scrollTop=0)}if(m){const v=f.scrollLeft;v&&(_.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+v,f.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(_,1)};this._register(addDisposableListener(i.domNode,"scroll",f=>u(i.domNode,!0,!0))),this._register(addDisposableListener(t.domNode,"scroll",f=>u(t.domNode,!0,!1))),this._register(addDisposableListener(s.domNode,"scroll",f=>u(s.domNode,!0,!1))),this._register(addDisposableListener(this.scrollbarDomNode.domNode,"scroll",f=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(146);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(73).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(104)||e.hasChanged(75)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(104),s=t.get(75),r=t.get(40),o=t.get(107),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:r,scrollPredominantAxis:o};this.scrollbar.updateOptions(a)}return e.hasChanged(146)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+getThemeTypeSelector(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}const glyphMargin="";class DecorationToRender{constructor(e,t,i,s,r){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=s,this._decorationToRenderBrand=void 0,this.zIndex=r??0}}class LineDecorationToRender{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class VisibleLineDecorationsToRender{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class DedupOverlay extends DynamicViewOverlay{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new VisibleLineDecorationsToRender}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNames)continue;const c=Math.max(a,i),d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(c,0)),u=this._context.viewModel.glyphLanes.getLanesAtLine(d.lineNumber).indexOf(r.preference.lane);t.push(new WidgetBasedGlyphRenderRequest(c,u,r.preference.zIndex,r))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.laneIndex===s.laneIndex?i.zIndex===s.zIndex?s.type===i.type?i.type===0&&s.type===0?i.className0;){const s=t.peek();if(!s)break;const r=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.laneIndex===s.laneIndex);if(!r||r.length===0)break;const o=r[0];if(o.type===0){const a=[];for(const l of r){if(l.zIndex!==o.zIndex||l.type!==o.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(o.accept(a.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],r=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(r),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class DecorationBasedGlyphRenderRequest{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new DecorationBasedGlyph(this.lineNumber,this.laneIndex,e)}}class WidgetBasedGlyphRenderRequest{constructor(e,t,i,s){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=s,this.type=1}}class DecorationBasedGlyph{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}const indentGuides="";class IndentGuidesOverlay extends DynamicViewOverlay{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(147),s=t.get(50);this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(147),s=t.get(50);return this._spaceWidth=s.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*s.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var s;const i=e.selections[0].getPosition();return(s=this._primaryPosition)!=null&&s.equals(i)?!1:(this._primaryPosition=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var l,c;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,s=e.scrollWidth,r=this._primaryPosition,o=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),r),a=[];for(let d=t;d<=i;d++){const u=d-t,f=o[u];let g="";const m=((l=e.visibleRangeForPosition(new Position$1(d,1)))==null?void 0:l.left)??0;for(const _ of f){const v=_.column===-1?m+(_.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Position$1(d,_.column)).left;if(v>s||this._maxIndentLeft>0&&v>this._maxIndentLeft)break;const C=_.horizontalLine?_.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",S=_.horizontalLine?(((c=e.visibleRangeForPosition(new Position$1(d,_.horizontalLine.endColumn)))==null?void 0:c.left)??v+this._spaceWidth)-v:this._spaceWidth;g+=`
    `}a[u]=g}this._renderResult=a}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?HorizontalGuidesState.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?HorizontalGuidesState.EnabledForActive:HorizontalGuidesState.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,r=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const f=new Array;d.push(f);const g=s?s[u-e]:[],m=new ArrayQueue(g),_=r?r[u-e]:0;for(let v=1;v<=_;v++){const C=(v-1)*c+1,S=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||g.length===0)&&o<=u&&u<=a&&v===l;f.push(...m.takeWhile(L=>L.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function transparentToUndefined(n){if(!(n&&n.isTransparent()))return n}registerThemingParticipant((n,e)=>{const t=[{bracketColor:editorBracketHighlightingForeground1,guideColor:editorBracketPairGuideBackground1,guideColorActive:editorBracketPairGuideActiveBackground1},{bracketColor:editorBracketHighlightingForeground2,guideColor:editorBracketPairGuideBackground2,guideColorActive:editorBracketPairGuideActiveBackground2},{bracketColor:editorBracketHighlightingForeground3,guideColor:editorBracketPairGuideBackground3,guideColorActive:editorBracketPairGuideActiveBackground3},{bracketColor:editorBracketHighlightingForeground4,guideColor:editorBracketPairGuideBackground4,guideColorActive:editorBracketPairGuideActiveBackground4},{bracketColor:editorBracketHighlightingForeground5,guideColor:editorBracketPairGuideBackground5,guideColorActive:editorBracketPairGuideActiveBackground5},{bracketColor:editorBracketHighlightingForeground6,guideColor:editorBracketPairGuideBackground6,guideColorActive:editorBracketPairGuideActiveBackground6}],i=new BracketPairGuidesClassNames,s=[{indentColor:editorIndentGuide1,indentColorActive:editorActiveIndentGuide1},{indentColor:editorIndentGuide2,indentColorActive:editorActiveIndentGuide2},{indentColor:editorIndentGuide3,indentColorActive:editorActiveIndentGuide3},{indentColor:editorIndentGuide4,indentColorActive:editorActiveIndentGuide4},{indentColor:editorIndentGuide5,indentColorActive:editorActiveIndentGuide5},{indentColor:editorIndentGuide6,indentColorActive:editorActiveIndentGuide6}],r=t.map(a=>{const l=n.getColor(a.bracketColor),c=n.getColor(a.guideColor),d=n.getColor(a.guideColorActive),u=transparentToUndefined(transparentToUndefined(c)??(l==null?void 0:l.transparent(.3))),f=transparentToUndefined(transparentToUndefined(d)??l);if(!(!u||!f))return{guideColor:u,guideColorActive:f}}).filter(isDefined),o=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=transparentToUndefined(l),u=transparentToUndefined(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(isDefined);if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});const viewLines="";class DomReadingContext{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class LastRenderedData{constructor(){this._currentVisibleRange=new Range$2(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class HorizontalRevealRangeRequest{constructor(e,t,i,s,r,o,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=r,this.stopScrollTop=o,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class HorizontalRevealSelectionsRequest{constructor(e,t,i,s,r){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=r,this.type="selections";let o=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;lnew ViewLine(this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,PartFingerprints.write(this.domNode,8),this.domNode.setClassName(`view-lines ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),applyFontInfo(this.domNode,r),this._maxLineWidth=0,this._asyncUpdateLineWidths=new RunOnceScheduler(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new RunOnceScheduler(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new LastRenderedData,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(116).enabled,this._maxNumberStickyLines=s.get(116).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(147)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),s=t.get(147);return this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(101),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(116).enabled,this._maxNumberStickyLines=t.get(116).maxLineCount,applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(146)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new ViewLineOptions(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++)this._visibleLines.getVisibleLine(r).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let r=t;r<=i;r++)s=this._visibleLines.getVisibleLine(r).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new HorizontalRevealRangeRequest(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new HorizontalRevealSelectionsRequest(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const r=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,r),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new Position$1(s,1);const r=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(so)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),r}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=Range$2.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const r=[];let o=0;const a=new DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(s.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=s.startLineNumber;u<=s.endLineNumber;u++){if(ud)continue;const f=u===s.startLineNumber?s.startColumn:1,g=u!==s.endLineNumber,m=g?this._context.viewModel.getLineMaxColumn(u):s.endColumn,_=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,f,m,a);if(_){if(t&&uthis._visibleLines.getEndLineNumber())return null;const s=new DomReadingContext(this.domNode.domNode,this._textRangeRestingSpot),r=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),r}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new HorizontalPosition(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,r=!0;for(let o=t;o<=i;o++){const a=this._visibleLines.getVisibleLine(o);if(e&&!a.getWidthIsFast()){r=!1;continue}s=Math.max(s,a.getWidth(null))}return r&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),r}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++){const o=this._visibleLines.getVisibleLine(r);if(o.needsMonospaceFontCheck()){const a=o.getWidth(null);a>t&&(t=a,e=r)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let r=i;r<=s;r++)this._visibleLines.getVisibleLine(r).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),isLinux&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let r=i;r<=s;r++)if(this._visibleLines.getVisibleLine(r).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let C=r[0].startLineNumber,S=r[0].endLineNumber;for(let w=1,L=r.length;wl){if(!d)return-1;v=u}else if(o===5||o===6)if(o===6&&a<=u&&f<=c)v=a;else{const C=Math.max(5*this._lineHeight,l*.2),S=u-C,w=f-l;v=Math.max(w,S)}else if(o===1||o===2)if(o===2&&a<=u&&f<=c)v=a;else{const C=(u+f)/2;v=Math.max(0,C-l/2)}else v=this._computeMinimumScrolling(a,c,u,f,o===3,o===4);return v}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(146),s=t.left,r=s+t.width-i.verticalScrollbarWidth;let o=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)o=Math.min(o,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)o=Math.min(o,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(o=Math.max(0,o-rg.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,r,o,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,r,o){e=e|0,t=t|0,i=i|0,s=s|0,r=!!r,o=!!o;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}};rg.HORIZONTAL_EXTRA_PX=30;let ViewLines=rg;const linesDecorations="";class LinesDecorationsOverlay extends DedupOverlay{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(146);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(146);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let r=0,o=t.length;r',l=[];for(let c=t;c<=i;c++){const d=c-t,u=s[d].getDecorations();let f="";for(const g of u){let m='
    ';r[a]=c}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}const minimap="",ro=class ro{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=ro._clamp(e),this.g=ro._clamp(t),this.b=ro._clamp(i),this.a=ro._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}};ro.Empty=new ro(0,0,0,0);let RGBA8=ro;const og=class og extends Disposable{static getInstance(){return this._INSTANCE||(this._INSTANCE=new og),this._INSTANCE}constructor(){super(),this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(TokenizationRegistry.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=TokenizationRegistry.getColorMap();if(!e){this._colors=[RGBA8.Empty],this._backgroundIsLight=!0;return}this._colors=[RGBA8.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}};og._INSTANCE=null;let MinimapTokensColorTracker=og;const allCharCodes=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),getCharIndex=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class MinimapCharRenderer{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=MinimapCharRenderer.soften(e,12/15),this.charDataLight=MinimapCharRenderer.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,r=e.length;se.width||i+m>e.height){console.warn("bad render request outside image data");return}const _=d?this.charDataLight:this.charDataNormal,v=getCharIndex(s,c),C=e.width*4,S=a.r,w=a.g,L=a.b,I=r.r-S,N=r.g-w,R=r.b-L,T=Math.max(o,l),A=e.data;let F=v*f*g,B=i*C+t*4;for(let W=0;We.width||i+u>e.height){console.warn("bad render request outside image data");return}const f=e.width*4,g=.5*(r/255),m=o.r,_=o.g,v=o.b,C=s.r-m,S=s.g-_,w=s.b-v,L=m+C*g,I=_+S*g,N=v+w*g,R=Math.max(r,a),T=e.data;let A=i*f+t*4;for(let F=0;F{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=charTable[n[t]]<<4|charTable[n[t+1]]&15;return e},prebakedMiniMaps={1:createSingleCallFunction(()=>decodeData("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:createSingleCallFunction(()=>decodeData("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class MinimapCharRendererFactory{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return prebakedMiniMaps[e]?i=new MinimapCharRenderer(prebakedMiniMaps[e](),e):i=MinimapCharRendererFactory.createFromSampleData(MinimapCharRendererFactory.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const r of allCharCodes)i.fillText(String.fromCharCode(r),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=MinimapCharRendererFactory._downsample(e,t);return new MinimapCharRenderer(s,t)}static _downsampleChar(e,t,i,s,r){const o=1*r,a=2*r;let l=s,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dMinimapCharRendererFactory.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=MinimapOptions._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=MinimapOptions._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(minimapBackground);return i?new RGBA8(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(minimapForegroundOpacity);return t?RGBA8._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(editorForeground);return i?new RGBA8(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class MinimapLayout{constructor(e,t,i,s,r,o,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=r,this.sliderHeight=o,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,r,o,a,l,c,d,u){const f=e.pixelRatio,g=e.minimapLineHeight,m=Math.floor(e.canvasInnerHeight/g),_=e.lineHeight;if(e.minimapHeightIsEditorHeight){let N=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(N+=Math.max(0,r-e.lineHeight-e.paddingBottom));const R=Math.max(1,Math.floor(r*r/N)),T=Math.max(0,e.minimapHeight-R),A=T/(d-r),F=c*A,B=T>0,W=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),G=Math.floor(e.paddingTop/e.lineHeight);return new MinimapLayout(c,d,B,A,F,R,G,1,Math.min(a,W))}let v;if(o&&i!==a){const N=i-t+1;v=Math.floor(N*g/f)}else{const N=r/_;v=Math.floor(N*g/f)}const C=Math.floor(e.paddingTop/_);let S=Math.floor(e.paddingBottom/_);if(e.scrollBeyondLastLine){const N=r/_;S=Math.max(S,N-1)}let w;if(S>0){const N=r/_;w=(C+a+S-N-1)*g/f}else w=Math.max(0,(C+a)*g/f-v);w=Math.min(e.minimapHeight-v,w);const L=w/(d-r),I=c*L;if(m>=C+a+S){const N=w>0;return new MinimapLayout(c,d,N,L,I,v,C,1,a)}else{let N;t>1?N=t+C:N=Math.max(1,c/_);let R,T=Math.max(1,Math.floor(N-I*f/g));Tc&&(T=Math.min(T,u.startLineNumber),R=Math.max(R,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?B=(t-T+R+F)*g/f:B=c/e.paddingTop*(R+F)*g/f,new MinimapLayout(c,d,!0,L,B,v,R,T,A)}}}const ag=class ag{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}};ag.INVALID=new ag(-1);let MinimapLine=ag;class RenderData{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new RenderedLinesCollection({createLine:()=>MinimapLine.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,r=i.length;s1){for(let C=0,S=s-1;C0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let r=this.minimapLines.length-1;r>=0&&!(this.minimapLines[r]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=MinimapSamplingState.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let r=0,o=t-e+1;r{var r;return!((r=s.options.minimap)!=null&&r.sectionHeaderStyle)});if(this._samplingState){const s=[];for(const r of i){if(!r.options.minimap)continue;const o=r.range,a=this._samplingState.modelLineToMinimapLine(o.startLineNumber),l=this._samplingState.modelLineToMinimapLine(o.endLineNumber);s.push(new ViewModelDecoration(new Range$2(a,o.startColumn,l,o.endColumn),r.options))}return s}return i}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.minimapLineHeight,r=this.options.sectionHeaderFontSize/i;return e=Math.floor(Math.max(1,e-r)),this._getMinimapDecorationsInViewport(e,t).filter(o=>{var a;return!!((a=o.options.minimap)!=null&&a.sectionHeaderStyle)})}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const s=this._samplingState.minimapLines[e-1],r=this._samplingState.minimapLines[t-1];i=new Range$2(s,1,r,this._context.viewModel.getLineMaxColumn(r))}else i=new Range$2(e,1,t,this._context.viewModel.getLineMaxColumn(t));return this._context.viewModel.getMinimapDecorationsInRange(i)}getSectionHeaderText(e,t){var o;const i=(o=e.options.minimap)==null?void 0:o.sectionHeaderText;if(!i)return null;const s=this._sectionHeaderCache.get(i);if(s)return s;const r=t(i);return this._sectionHeaderCache.set(i,r),r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new Range$2(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class InnerMinimap extends Disposable{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(minimapSelection),this._domNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=createFastDomNode(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=createFastDomNode(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=createFastDomNode(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=createFastDomNode(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=createFastDomNode(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=addStandardDisposableListener(this._domNode.domNode,EventType$1.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=getDomNodePagePosition(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const r=this._model.options.minimapLineHeight,o=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(o/r)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new GlobalPointerMoveMonitor,this._sliderPointerDownListener=addStandardDisposableListener(this._slider.domNode,EventType$1.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Gesture.addTarget(this._domNode.domNode),this._sliderTouchStartListener=addDisposableListener(this._domNode.domNode,EventType.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=addDisposableListener(this._domNode.domNode,EventType.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=addStandardDisposableListener(this._domNode.domNode,EventType.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const r=(o,a)=>{const l=getDomNodePagePosition(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(isWindows&&c>POINTER_DRAG_RESET_DISTANCE){this._model.setScrollTop(i.scrollTop);return}const d=o-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&r(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>r(o.pageY,o.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new MinimapBuffers(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)==null||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)==null||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(minimapSelection),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=MinimapLayout.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Range$2.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((f,g)=>(f.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:r}=this._model.options,o=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,s,r);const d=new ContiguousLineMap(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,o),this._renderDecorationsLineHighlights(c,i,d,e,o);const u=new ContiguousLineMap(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,o,l,a,s),this._renderDecorationsHighlights(c,i,u,e,o,l,a,s),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,s,r){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=0,a=0;for(const l of t){const c=s.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let m=d;m<=u;m++)i.set(m,!0);const f=s.getYForLineNumber(d,r),g=s.getYForLineNumber(u,r);a>=f||(a>o&&e.fillRect(MINIMAP_GUTTER_WIDTH,o,e.canvas.width,a-o),o=f),a=g}a>o&&e.fillRect(MINIMAP_GUTTER_WIDTH,o,e.canvas.width,a-o)}_renderDecorationsLineHighlights(e,t,i,s,r){const o=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==1)continue;const d=s.intersectWithViewport(l.range);if(!d)continue;const[u,f]=d,g=c.getColor(this._theme.value);if(!g||g.isTransparent())continue;let m=o.get(g.toString());m||(m=g.transparent(.5).toString(),o.set(g.toString(),m)),e.fillStyle=m;for(let _=u;_<=f;_++){if(i.has(_))continue;i.set(_,!0);const v=s.getYForLineNumber(u,r);e.fillRect(MINIMAP_GUTTER_WIDTH,v,e.canvas.width,r)}}}_renderSelectionsHighlights(e,t,i,s,r,o,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=s.intersectWithViewport(c);if(!d)continue;const[u,f]=d;for(let g=u;g<=f;g++)this.renderDecorationOnLine(e,i,c,this._selectionColor,s,g,r,r,o,a,l)}}_renderDecorationsHighlights(e,t,i,s,r,o,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=s.intersectWithViewport(c.range);if(!u)continue;const[f,g]=u,m=d.getColor(this._theme.value);if(!(!m||m.isTransparent()))for(let _=f;_<=g;_++)switch(d.position){case 1:this.renderDecorationOnLine(e,i,c.range,m,s,_,r,r,o,a,l);continue;case 2:{const v=s.getYForLineNumber(_,r),C=2;this.renderDecoration(e,m,C,v,GUTTER_DECORATION_WIDTH,r);continue}}}}renderDecorationOnLine(e,t,i,s,r,o,a,l,c,d,u){const f=r.getYForLineNumber(o,l);if(f+a<0||f>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:m}=i,_=g===o?i.startColumn:1,v=m===o?i.endColumn:this._model.getLineMaxColumn(o),C=this.getXOffsetForPosition(t,o,_,c,d,u),S=this.getXOffsetForPosition(t,o,v,c,d,u);this.renderDecoration(e,s,C,f,S-C,a)}getXOffsetForPosition(e,t,i,s,r,o){if(i===1)return MINIMAP_GUTTER_WIDTH;if((i-1)*r>=o)return o;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[MINIMAP_GUTTER_WIDTH];let d=MINIMAP_GUTTER_WIDTH;for(let u=1;u=o){l[u]=o;break}l[u]=m,d=m}e.set(t,l)}return i-1v.range.startLineNumber-C.range.startLineNumber);const m=InnerMinimap._fitSectionHeader.bind(null,f,o-MINIMAP_GUTTER_WIDTH);for(const v of g){const C=e.getYForLineNumber(v.range.startLineNumber,t)+i,S=C-i,w=S+2,L=this._model.getSectionHeaderText(v,m);InnerMinimap._renderSectionLabel(f,L,((_=v.options.minimap)==null?void 0:_.sectionHeaderStyle)===2,l,d,o,S,r,C,w)}}static _fitSectionHeader(e,t,i){if(!i)return i;const s="…",r=e.measureText(i).width,o=e.measureText(s).width;if(r<=t||r<=o)return i;const a=i.length,l=r/i.length,c=Math.floor((t-o)/l)-1;let d=Math.ceil(c/2);for(;d>0&&/\s/.test(i[d-1]);)--d;return i.substring(0,d)+s+i.substring(a-(c-d))}static _renderSectionLabel(e,t,i,s,r,o,a,l,c,d){t&&(e.fillStyle=s,e.fillRect(0,a,o,l),e.fillStyle=r,e.fillText(t,MINIMAP_GUTTER_WIDTH,c)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(o,d),e.closePath(),e.stroke())}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,s=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const K=this._lastRenderData._get();return new RenderData(e,K.imageData,K.lines)}const r=this._getBuffer();if(!r)return null;const[o,a,l]=InnerMinimap._renderUntouchedLines(r,e.topPaddingLineCount,t,i,s,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),d=this._model.getOptions().tabSize,u=this._model.options.defaultBackgroundColor,f=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,m=this._model.tokensColorTracker,_=m.backgroundIsLight(),v=this._model.options.renderMinimap,C=this._model.options.charRenderer(),S=this._model.options.fontScale,w=this._model.options.minimapCharWidth,I=(v===1?2:2+1)*S,N=s>I?Math.floor((s-I)/2):0,R=f.a/255,T=new RGBA8(Math.round((f.r-u.r)*R+u.r),Math.round((f.g-u.g)*R+u.g),Math.round((f.b-u.b)*R+u.b),255);let A=e.topPaddingLineCount*s;const F=[];for(let K=0,ee=i-t+1;K=0&&BS)return;const W=v.charCodeAt(I);if(W===9){const G=f-(I+N)%f;N+=G-1,L+=G*o}else if(W===32)L+=o;else{const G=isFullWidthCharacter(W)?2:1;for(let j=0;jS)return}}}}}class ContiguousLineMap{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,r=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}const overlayWidgets="";class ViewOverlayWidgets extends ViewPart{constructor(e,t){super(e),this._viewDomNode=t;const s=this._context.configuration.options.get(146);this._widgets={},this._verticalScrollbarWidth=s.verticalScrollbarWidth,this._minimapWidth=s.minimap.minimapWidth,this._horizontalScrollbarHeight=s.horizontalScrollbarHeight,this._editorHeight=s.height,this._editorWidth=s.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=createFastDomNode(document.createElement("div")),PartFingerprints.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(146);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=createFastDomNode(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),e.allowEditorOverflow?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],s=t?t.preference:null,r=t==null?void 0:t.stackOridinal;return i.preference===s&&i.stack===r?(this._updateMaxMinWidth(),!1):(i.preference=s,i.stack=r,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var i,s;let e=0;const t=Object.keys(this._widgets);for(let r=0,o=t.length;r0);t.sort((s,r)=>(this._widgets[s].stack||0)-(this._widgets[r].stack||0));for(let s=0,r=t.length;s=3){const r=Math.floor(s/3),o=Math.floor(s/3),a=s-r-o,l=e,c=l+r,d=l+r+a;return[[0,l,c,l,d,l,c,l],[0,r,a,r+a,o,r+a+o,a+o,r+a+o]]}else if(i===2){const r=Math.floor(s/2),o=s-r,a=e,l=a+r;return[[0,a,a,a,l,a,a,a],[0,r,r,r,o,r+o,r+o,r+o]]}else{const r=e,o=s;return[[0,r,r,r,r,r,r,r],[0,o,o,o,o,o,o,o]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&Color.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class DecorationsOverviewRuler extends ViewPart{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=createFastDomNode(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=TokenizationRegistry.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new Position$1(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Settings(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t1&&(s=t===0?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:s})}return this._cursorPositions.sort((t,i)=>Position$1.compare(t.position,i.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?Color.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(OverviewRulerDecorationsGroup.compareByRenderingProps),this._actualShouldRender===1&&!OverviewRulerDecorationsGroup.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!equals$1(this._renderedCursorPositions,this._cursorPositions,(m,_)=>m.position.lineNumber===_.position.lineNumber&&m.color===_.color)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,r=this._settings.lineHeight,o=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=s/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=Color.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=Color.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):u.clearRect(0,0,i,s);const f=this._settings.x,g=this._settings.w;for(const m of t){const _=m.color,v=m.data;u.fillStyle=_;let C=0,S=0,w=0;for(let L=0,I=v.length/3;Ls&&(W=s-d),A=W-d,F=W+d}A>w+1||N!==C?(L!==0&&u.fillRect(f[C],S,g[C],w-S),C=N,S=A,w=F):F>w&&(w=F)}u.fillRect(f[C],S,g[C],w-S)}if(!this._settings.hideCursor){const m=2*this._settings.pixelRatio|0,_=m/2|0,v=this._settings.x[7],C=this._settings.w[7];let S=-100,w=-100,L=null;for(let I=0,N=this._cursorPositions.length;Is&&(A=s-_);const F=A-_,B=F+m;F>w+1||R!==L?(I!==0&&L&&u.fillRect(v,S,C,w-S),S=F,w=B):B>w&&(w=B),L=R,u.fillStyle=R}L&&u.fillRect(v,S,C,w-S)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,s),u.moveTo(1,0),u.lineTo(i,0),u.stroke())}}class ColorZone{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class OverviewRulerZone{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(_=i-v);const C=d.color;let S=this._color2Id[C];S||(S=++this._lastAssignedId,this._color2Id[C]=S,this._id2Color[S]=C);const w=new ColorZone(_-v,_+v,S);d.setColorZone(w),a.push(w)}return this._colorZonesInvalid=!1,a.sort(ColorZone.compare),a}}class OverviewRuler extends ViewEventHandler{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=createFastDomNode(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new OverviewZoneManager(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(67)),this._zoneManager.setPixelRatio(i.get(144)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(67)&&(this._zoneManager.setLineHeight(t.get(67)),this._render()),e.hasChanged(144)&&(this._zoneManager.setPixelRatio(t.get(144)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),r=this._domNode.domNode.getContext("2d");return r.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(r,i,s,e),!0}_renderOneLane(e,t,i,s){let r=0,o=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==r?(e.fillRect(0,o,s,a-o),r=c,e.fillStyle=i[r],o=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,o,s,a-o),o=d,a=u)}e.fillRect(0,o,s,a-o)}}const rulers="";class Rulers extends ViewPart{constructor(e){super(e),this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(103),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(103),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=createFastDomNode(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(r),this.domNode.appendChild(a),this._renderedRulers.push(a),o--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(146);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(104);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}const selections="";class HorizontalRangeWithStyle{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class LineVisibleRangesWithStyle{constructor(e,t){this.lineNumber=e,this.ranges=t}}function toStyledRange(n){return new HorizontalRangeWithStyle(n)}function toStyled(n){return new LineVisibleRangesWithStyle(n.lineNumber,n.ranges.map(toStyledRange))}const yi=class yi extends DynamicViewOverlay{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(102),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let r=null,o=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!r&&c=0;c--)i[c].lineNumber===l&&(o=i[c].ranges[0]);r&&!r.startStyle&&(r=null),o&&!o.startStyle&&(o=null)}for(let a=0,l=t.length;a0){const m=t[a-1].ranges[0].left,_=t[a-1].ranges[0].left+t[a-1].ranges[0].width;abs(d-m)m&&(f.top=1),abs(u-_)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const r=!!s[0].ranges[0].startStyle,o=s[0].lineNumber,a=s[s.length-1].lineNumber;for(let l=0,c=s.length;l1,c)}this._previousFrameVisibleRangesWithStyle=r,this._renderResult=t.map(([o,a])=>o+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}};yi.SELECTION_CLASS_NAME="selected-text",yi.SELECTION_TOP_LEFT="top-left-radius",yi.SELECTION_BOTTOM_LEFT="bottom-left-radius",yi.SELECTION_TOP_RIGHT="top-right-radius",yi.SELECTION_BOTTOM_RIGHT="bottom-right-radius",yi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",yi.ROUNDED_PIECE_WIDTH=10;let SelectionsOverlay=yi;registerThemingParticipant((n,e)=>{const t=n.getColor(editorSelectionForeground);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function abs(n){return n<0?-n:n}const viewCursors="";class ViewCursorRenderData{constructor(e,t,i,s,r,o,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=r,this.textContent=o,this.textContentClassName=a}}var CursorPlurality;(function(n){n[n.Single=0]="Single",n[n.MultiPrimary=1]="MultiPrimary",n[n.MultiSecondary=2]="MultiSecondary"})(CursorPlurality||(CursorPlurality={}));class ViewCursor{constructor(e,t){this._context=e;const i=this._context.configuration.options,s=i.get(50);this._cursorStyle=i.get(28),this._lineHeight=i.get(67),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setClassName(`cursor ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),applyFontInfo(this._domNode,s),this._domNode.setDisplay("none"),this._position=new Position$1(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case CursorPlurality.Single:this._pluralityClass="";break;case CursorPlurality.MultiPrimary:this._pluralityClass="cursor-primary";break;case CursorPlurality.MultiSecondary:this._pluralityClass="cursor-secondary";break}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(67),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,r]=getCharContainingOffset(i,t-1);return[new Position$1(e,s+1),i.substring(s,r)]}_prepareRender(e){let t="",i="";const[s,r]=this._getGraphemeAwarePosition();if(this._cursorStyle===TextEditorCursorStyle$1.Line||this._cursorStyle===TextEditorCursorStyle$1.LineThin){const f=e.visibleRangeForPosition(s);if(!f||f.outsideRenderedLine)return null;const g=getWindow(this._domNode.domNode);let m;this._cursorStyle===TextEditorCursorStyle$1.Line?(m=computeScreenAwareSize(g,this._lineCursorWidth>0?this._lineCursorWidth:2),m>2&&(t=r,i=this._getTokenClassName(s))):m=computeScreenAwareSize(g,1);let _=f.left,v=0;m>=2&&_>=1&&(v=1,_-=v);const C=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new ViewCursorRenderData(C,_,v,m,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new Range$2(s.lineNumber,s.column,s.lineNumber,s.column+r.length),!1);if(!o||o.length===0)return null;const a=o[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=r===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===TextEditorCursorStyle$1.Block&&(t=r,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===TextEditorCursorStyle$1.Underline||this._cursorStyle===TextEditorCursorStyle$1.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new ViewCursorRenderData(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${MOUSE_CURSOR_TEXT_CSS_CLASS_NAME} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}const iu=class iu extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(92),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ViewCursor(this._context,CursorPlurality.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=createFastDomNode(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new TimeoutTimer,this._cursorFlatBlinkInterval=new WindowIntervalTimer,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(92),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const r=this._secondaryCursors.length-t.length;for(let o=0;o{for(let s=0,r=e.ranges.length;s{this._isVisible?this._hide():this._show()},iu.BLINK_INTERVAL,getWindow(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},iu.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case TextEditorCursorStyle$1.Line:e+=" cursor-line-style";break;case TextEditorCursorStyle$1.Block:e+=" cursor-block-style";break;case TextEditorCursorStyle$1.Underline:e+=" cursor-underline-style";break;case TextEditorCursorStyle$1.LineThin:e+=" cursor-line-thin-style";break;case TextEditorCursorStyle$1.BlockOutline:e+=" cursor-block-outline-style";break;case TextEditorCursorStyle$1.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=[{class:".cursor",foreground:editorCursorForeground,background:editorCursorBackground},{class:".cursor-primary",foreground:editorMultiCursorPrimaryForeground,background:editorMultiCursorPrimaryBackground},{class:".cursor-secondary",foreground:editorMultiCursorSecondaryForeground,background:editorMultiCursorSecondaryBackground}];for(const i of t){const s=n.getColor(i.foreground);if(s){let r=n.getColor(i.background);r||(r=s.opposite()),e.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${s}; border-color: ${s}; color: ${r}; }`),isHighContrast(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${r}; border-right: 1px solid ${r}; }`)}}});const invalidFunc=()=>{throw new Error("Invalid change accessor")};class ViewZones extends ViewPart{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(146);this._lineHeight=t.get(67),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=createFastDomNode(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const r=Object.keys(this._zones);for(let o=0,a=r.length;o{const s={addZone:r=>(t=!0,this._addZone(i,r)),removeZone:r=>{r&&(t=this._removeZone(i,r)||t)},layoutZone:r=>{r&&(t=this._layoutZone(i,r)||t)}};safeInvoke1Arg(e,s),s.addZone=invalidFunc,s.removeZone=invalidFunc,s.layoutZone=invalidFunc}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),r={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:createFastDomNode(t.domNode),marginDomNode:t.marginDomNode?createFastDomNode(t.marginDomNode):null};return this._safeCallOnComputedHeight(r.delegate,i.heightInPx),r.domNode.setPosition("absolute"),r.domNode.domNode.style.width="100%",r.domNode.setDisplay("none"),r.domNode.setAttribute("monaco-view-zone",r.whitespaceId),this.domNode.appendChild(r.domNode),r.marginDomNode&&(r.marginDomNode.setPosition("absolute"),r.marginDomNode.domNode.style.width="100%",r.marginDomNode.setDisplay("none"),r.marginDomNode.setAttribute("monaco-view-zone",r.whitespaceId),this.marginDomNode.appendChild(r.marginDomNode)),this._zones[r.whitespaceId]=r,this.setShouldRender(),r.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){onUnexpectedError(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){onUnexpectedError(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,s=!0);const r=Object.keys(this._zones);for(let o=0,a=r.length;oa)continue;const g=f.startLineNumber===a?f.startColumn:c.minColumn,m=f.endLineNumber===a?f.endColumn:c.maxColumn;g=F.endOffset&&(A++,F=i&&i[A]),G!==9&&G!==32||f&&!N&&W<=T)continue;if(u&&W>=R&&W<=T&&G===32){const K=W-1>=0?a.charCodeAt(W-1):0,ee=W+1=0?a.charCodeAt(W-1):0;if(G===32&&K!==32&&K!==9)continue}if(i&&(!F||F.startOffset>W||F.endOffset<=W))continue;const j=e.visibleRangeForPosition(new Position$1(t,W+1));j&&(o?(B=Math.max(B,j.left),G===9?I+=this._renderArrow(g,v,j.left):I+=``):G===9?I+=`
    ${L?String.fromCharCode(65515):String.fromCharCode(8594)}
    `:I+=`
    ${String.fromCharCode(w)}
    `)}return o?(B=Math.round(B+v),``+I+""):I}_renderArrow(e,t,i){const s=t/7,r=t,o=e/2,a=i,l={x:0,y:s/2},c={x:100/125*r,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},f={x:u.x+.35*c.x,y:u.y-.35*c.x},g={x:f.x,y:-f.y},m={x:u.x,y:-u.y},_={x:d.x,y:-d.y},v={x:c.x,y:-c.y},C={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class WhitespaceOptions{constructor(e){const t=e.options,i=t.get(50),s=t.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(100),this.renderWithSVG=!0):(this.renderWhitespace=t.get(100),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(67),this.stopRenderingLineAfter=t.get(118)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class ViewportData{constructor(e,t,i,s){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.lineHeight=t.lineHeight|0,this.whitespaceViewportData=i,this._model=s,this.visibleRange=new Range$2(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class EditorTheme{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class ViewContext{constructor(e,t,i){this.configuration=e,this.theme=new EditorTheme(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}var __decorate$1T=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1T=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let View$1=class extends ViewEventHandler{constructor(e,t,i,s,r,o,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Selection$1(1,1,1,1)],this._renderAnimationFrame=null;const l=new ViewController(t,s,r,e);this._context=new ViewContext(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(TextAreaHandler,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=createFastDomNode(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=createFastDomNode(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=createFastDomNode(document.createElement("div")),PartFingerprints.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new EditorScrollbar(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ViewLines(this._context,this._linesContent),this._viewZones=new ViewZones(this._context),this._viewParts.push(this._viewZones);const c=new DecorationsOverviewRuler(this._context);this._viewParts.push(c);const d=new ScrollDecorationViewPart(this._context);this._viewParts.push(d);const u=new ContentViewOverlays(this._context);this._viewParts.push(u),u.addDynamicOverlay(new CurrentLineHighlightOverlay(this._context)),u.addDynamicOverlay(new SelectionsOverlay(this._context)),u.addDynamicOverlay(new IndentGuidesOverlay(this._context)),u.addDynamicOverlay(new DecorationsOverlay(this._context)),u.addDynamicOverlay(new WhitespaceOverlay(this._context));const f=new MarginViewOverlays(this._context);this._viewParts.push(f),f.addDynamicOverlay(new CurrentLineMarginHighlightOverlay(this._context)),f.addDynamicOverlay(new MarginViewLineDecorationsOverlay(this._context)),f.addDynamicOverlay(new LinesDecorationsOverlay(this._context)),f.addDynamicOverlay(new LineNumbersOverlay(this._context)),this._glyphMarginWidgets=new GlyphMarginWidgets(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new Margin(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(f.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new ViewContentWidgets(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ViewCursors(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new ViewOverlayWidgets(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const m=new Rulers(this._context);this._viewParts.push(m);const _=new BlockDecorations(this._context);this._viewParts.push(_);const v=new Minimap(this._context);if(this._viewParts.push(v),c){const C=this._scrollbar.getOverviewRulerLayoutInfo();C.parent.insertBefore(c.getDomNode(),C.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(m.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(v.getDomNode()),this._overflowGuardContainer.appendChild(_.domNode),this.domNode.appendChild(this._overflowGuardContainer),o?(o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),o.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new PointerHandler(this._context,l,this._createPointerHandlerHelper()))}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],s=0;i=i.concat(e.getAllMarginDecorations().map(r=>{var a,l;const o=((a=r.options.glyphMargin)==null?void 0:a.position)??GlyphMarginLane.Center;return s=Math.max(s,r.range.endLineNumber),{range:r.range,lane:o,persist:(l=r.options.glyphMargin)==null?void 0:l.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(r=>{const o=e.validateRange(r.preference.range);return s=Math.max(s,o.endLineNumber),{range:o,lane:r.preference.lane}})),i.sort((r,o)=>Range$2.compareRangesUsingStarts(r.range,o.range)),t.reset(s);for(const r of i)t.push(r.lane,r.range,r.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new PointerHandlerLastRenderData(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new Position$1(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(146);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(143)+" "+getThemeTypeSelector(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){var e;if(this._store.isDisposed)throw new BugIndicatingError;if(this._renderAnimationFrame===null){const t=this._createCoordinatedRendering();this._renderAnimationFrame=EditorRenderingCoordinator.INSTANCE.scheduleCoordinatedRendering({window:getWindow((e=this.domNode)==null?void 0:e.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new BugIndicatingError;try{return t.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new BugIndicatingError;return t.renderText()},prepareRender:(i,s)=>{if(this._store.isDisposed)throw new BugIndicatingError;return t.prepareRender(i,s)},render:(i,s)=>{if(this._store.isDisposed)throw new BugIndicatingError;return t.render(i,s)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();safeInvokeNoArg(()=>e.prepareRenderText());const t=safeInvokeNoArg(()=>e.renderText());if(t){const[i,s]=t;safeInvokeNoArg(()=>e.prepareRender(i,s)),safeInvokeNoArg(()=>e.render(i,s))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}inputLatency.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new ViewportData(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),[e,new RenderingContext(this._context.viewLayout,i,this._viewLines)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new Position$1(s.lineNumber,s.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?ViewUserInputEvents.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new OverviewRuler(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,s,r;this._contentWidgets.setWidgetPosition(e.widget,((t=e.position)==null?void 0:t.position)??null,((i=e.position)==null?void 0:i.secondaryPosition)??null,((s=e.position)==null?void 0:s.preference)??null,((r=e.position)==null?void 0:r.positionAffinity)??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};View$1=__decorate$1T([__param$1T(6,IInstantiationService)],View$1);function safeInvokeNoArg(n){try{return n()}catch(e){return onUnexpectedError(e),null}}const lg=class lg{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[i,s]of this._animationFrameRunners)s.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,runAtThisOrScheduleAtNextAnimationFrame(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)safeInvokeNoArg(()=>i.prepareRenderText());const t=[];for(let i=0,s=e.length;ir.renderText())}for(let i=0,s=e.length;ir.prepareRender(a,l))}for(let i=0,s=e.length;ir.render(a,l))}}};lg.INSTANCE=new lg;let EditorRenderingCoordinator=lg;class ModelLineProjectionData{constructor(e,t,i,s,r){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=s,this.wrappedTextIndentLength=r}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;rthis.injectionOffsets[r];r++)s0?this.breakOffsets[r-1]:0,t===0)if(e<=o)s=r-1;else if(e>l)i=r+1;else break;else if(e=l)i=r+1;else break}let a=e-o;return r>0&&(a+=this.wrappedTextIndentLength),new OutputPosition(r,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(r!==s)return this.offsetInInputWithInjectionsToOutputPosition(r,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new OutputPosition(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&hasRightCursorStop(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(hasLeftCursorStop(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let r=i.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[i.injectedTextIndex]&&!(hasRightCursorStop(this.injectionOptions[r].cursorStops)||(s-=this.injectionOptions[r].content.length,hasLeftCursorStop(this.injectionOptions[r].cursorStops)));)r--;return s}}else if(t===1||t===4){let s=i.offsetInInputWithInjections+i.length,r=i.injectedTextIndex;for(;r+1=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)s-=this.injectionOptions[r-1].content.length,r--;return s}assertNever()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let r=0;re)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:o};s+=o}}}}function hasRightCursorStop(n){return n==null?!0:n===InjectedTextCursorStops.Right||n===InjectedTextCursorStops.Both}function hasLeftCursorStop(n){return n==null?!0:n===InjectedTextCursorStops.Left||n===InjectedTextCursorStops.Both}class OutputPosition{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Position$1(e+this.outputLineIndex,this.outputOffset+1)}}const ttPolicy$2=createTrustedTypesPolicy("domLineBreaksComputer",{createHTML:n=>n});class DOMLineBreaksComputerFactory{static create(e){return new DOMLineBreaksComputerFactory(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,s,r){const o=[],a=[];return{addRequest:(l,c,d)=>{o.push(l),a.push(c)},finalize:()=>createLineBreaks$1(assertIsDefined(this.targetWindow.deref()),o,e,t,i,s,r,a)}}}function createLineBreaks$1(n,e,t,i,s,r,o,a){function l(A){const F=a[A];if(F){const B=LineInjectedText.applyInjectedText(e[A],F),W=F.map(j=>j.options),G=F.map(j=>j.column-1);return new ModelLineProjectionData(G,W,[B.length],[],0)}else return null}if(s===-1){const A=[];for(let F=0,B=e.length;Fc?(B=0,W=0):G=c-ee}const j=F.substr(B),K=renderLine(j,W,i,G,m,f);_[A]=B,v[A]=W,C[A]=j,S[A]=K[0],w[A]=K[1]}const L=m.build(),I=(ttPolicy$2==null?void 0:ttPolicy$2.createHTML(L))??L;g.innerHTML=I,g.style.position="absolute",g.style.top="10000",o==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),n.document.body.appendChild(g);const N=document.createRange(),R=Array.prototype.slice.call(g.children,0),T=[];for(let A=0;AQ.options),U=q.map(Q=>Q.column-1)):(ee=null,U=null),T[A]=new ModelLineProjectionData(U,ee,B,K,G)}return g.remove(),T}function renderLine(n,e,t,i,s,r){if(r!==0){const f=String(r);s.appendString('
    ');const o=n.length;let a=e,l=0;const c=[],d=[];let u=0");for(let f=0;f"),c[f]=l,d[f]=a;const g=u;u=f+1"),c[n.length]=l,d[n.length]=a,s.appendString("
    "),[c,d]}function readLineBreaks(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),r=[];try{discoverBreaks(n,s,i,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function discoverBreaks(n,e,t,i,s,r,o,a){if(i===r||(s=s||readClientRect(n,e,t[i],t[i+1]),o=o||readClientRect(n,e,t[r],t[r+1]),Math.abs(s[0].top-o[0].top)<=.1))return;if(i+1===r){a.push(r);return}const l=i+(r-i)/2|0,c=readClientRect(n,e,t[l],t[l+1]);discoverBreaks(n,e,t,i,s,l,c,a),discoverBreaks(n,e,t,l,c,r,o,a)}function readClientRect(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class CodeEditorContributions extends Disposable{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new DisposableMap),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){onUnexpectedError(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(runWhenWindowIdle(getWindow(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(runWhenWindowIdle(getWindow(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(runWhenWindowIdle(getWindow(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return runWhenWindowIdle(getWindow((e=this._editor)==null?void 0:e.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){onUnexpectedError(i)}}}}class InternalEditorAction{constructor(e,t,i,s,r,o,a){this.id=e,this.label=t,this.alias=i,this.metadata=s,this._precondition=r,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}class MonospaceLineBreaksComputerFactory{static create(e){return new MonospaceLineBreaksComputerFactory(e.get(135),e.get(134))}constructor(e,t){this.classifier=new WrappingCharacterClassifier(e,t)}createLineBreaksComputer(e,t,i,s,r){const o=[],a=[],l=[];return{addRequest:(c,d,u)=>{o.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,f=o.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let arrPool1=[],arrPool2=[];function createLineBreaksFromPreviousLineBreaks(n,e,t,i,s,r,o,a){if(s===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,f=computeWrappedTextIndentLength(t,i,s,r,o),g=s-f,m=arrPool1,_=arrPool2;let v=0,C=0,S=0,w=s;const L=d.length;let I=0;if(I>=0){let N=Math.abs(u[I]-w);for(;I+1=N)break;N=R,I++}}for(;IN&&(N=C,R=S);let T=0,A=0,F=0,B=0;if(R<=w){let G=R,j=N===0?0:t.charCodeAt(N-1),K=N===0?0:n.get(j),ee=!0;for(let U=N;UC&&canBreak(j,K,Q,ce,c)&&(T=q,A=G),G+=ie,G>w){q>C?(F=q,B=G-ie):(F=U+1,B=G),G-A>g&&(T=0),ee=!1;break}j=Q,K=ce}if(ee){v>0&&(m[v]=d[d.length-1],_[v]=u[d.length-1],v++);break}}if(T===0){let G=R,j=t.charCodeAt(N),K=n.get(j),ee=!1;for(let U=N-1;U>=C;U--){const q=U+1,Q=t.charCodeAt(U);if(Q===9){ee=!0;break}let ce,ie;if(isLowSurrogate(Q)?(U--,ce=0,ie=2):(ce=n.get(Q),ie=isFullWidthCharacter(Q)?r:1),G<=w){if(F===0&&(F=q,B=G),G<=w-g)break;if(canBreak(Q,ce,j,K,c)){T=q,A=G;break}}G-=ie,j=Q,K=ce}if(T!==0){const U=g-(B-A);if(U<=i){const q=t.charCodeAt(F);let Q;isHighSurrogate(q)?Q=2:Q=computeCharWidth(q,B,i,r),U-Q<0&&(T=0)}}if(ee){I--;continue}}if(T===0&&(T=F,A=B),T<=C){const G=t.charCodeAt(C);isHighSurrogate(G)?(T=C+2,A=S+2):(T=C+1,A=S+computeCharWidth(G,S,i,r))}for(C=T,m[v]=T,S=A,_[v]=A,v++,w=A+g;I<0||I=W)break;W=G,I++}}return v===0?null:(m.length=v,_.length=v,arrPool1=e.breakOffsets,arrPool2=e.breakOffsetsVisibleColumn,e.breakOffsets=m,e.breakOffsetsVisibleColumn=_,e.wrappedTextIndentLength=f,e)}function createLineBreaks(n,e,t,i,s,r,o,a){const l=LineInjectedText.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(A=>A.options),d=t.map(A=>A.column-1)):(c=null,d=null),s===-1)return c?new ModelLineProjectionData(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new ModelLineProjectionData(d,c,[l.length],[],0):null;const f=a==="keepAll",g=computeWrappedTextIndentLength(l,i,s,r,o),m=s-g,_=[],v=[];let C=0,S=0,w=0,L=s,I=l.charCodeAt(0),N=n.get(I),R=computeCharWidth(I,0,i,r),T=1;isHighSurrogate(I)&&(R+=1,I=l.charCodeAt(1),N=n.get(I),T++);for(let A=T;AL&&((S===0||R-w>m)&&(S=F,w=R-G),_[C]=S,v[C]=w,C++,L=w+m,S=0),I=B,N=W}return C===0&&(!t||t.length===0)?null:(_[C]=u,v[C]=R,new ModelLineProjectionData(d,c,_,v,g))}function computeCharWidth(n,e,t,i){return n===9?t-e%t:isFullWidthCharacter(n)||n<32?i:1}function tabCharacterWidth(n,e){return e-n%e}function canBreak(n,e,t,i,s){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!s&&e===3&&i!==2||!s&&i===3&&e!==1)}function computeWrappedTextIndentLength(n,e,t,i,s){let r=0;if(s!==0){const o=firstNonWhitespaceIndex(n);if(o!==-1){for(let l=0;lt&&(r=0)}}return r}class Cursor{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new SingleCursorState(new Range$2(1,1,1,1),0,0,new Position$1(1,1),0),new SingleCursorState(new Range$2(1,1,1,1),0,0,new Position$1(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new CursorState$1(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Selection$1.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Selection$1.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),r=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,o),l=this._validatePositionWithCache(e,r,s,a);return i.equals(o)&&s.equals(a)&&r.equals(l)?t:new SingleCursorState(Range$2.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=Cursor._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),r=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),a=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new SingleCursorState(s,t.selectionStartKind,r,o,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),r=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new SingleCursorState(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,r,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),r=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new SingleCursorState(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),r=e.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new Range$2(s.lineNumber,s.column,r.lineNumber,r.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new SingleCursorState(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class CursorCollection{constructor(e){this.context=e,this.cursors=[new Cursor(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return findFirstMin(this.cursors,compareBy(e=>e.viewState.position,Position$1.compare)).viewState.position}getBottomMostViewPosition(){return findLastMax(this.cursors,compareBy(e=>e.viewState.position,Position$1.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(CursorState$1.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let r=0;r=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,Range$2.compareRangesUsingStarts));for(let i=0;iu&&_.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class CursorContext{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class ViewCompositionStartEvent{constructor(){this.type=0}}class ViewCompositionEndEvent{constructor(){this.type=1}}class ViewConfigurationChangedEvent{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class ViewCursorStateChangedEvent{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class ViewDecorationsChangedEvent{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class ViewFlushedEvent{constructor(){this.type=5}}class ViewFocusChangedEvent{constructor(e){this.type=6,this.isFocused=e}}class ViewLanguageConfigurationEvent{constructor(){this.type=7}}class ViewLineMappingChangedEvent{constructor(){this.type=8}}class ViewLinesChangedEvent{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class ViewLinesDeletedEvent{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class ViewLinesInsertedEvent{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class ViewRevealRangeRequestEvent{constructor(e,t,i,s,r,o,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=r,this.revealHorizontal=o,this.scrollType=a,this.type=12}}class ViewScrollChangedEvent{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class ViewThemeChangedEvent{constructor(e){this.theme=e,this.type=14}}class ViewTokensChangedEvent{constructor(e){this.type=15,this.ranges=e}}class ViewTokensColorsChangedEvent{constructor(){this.type=16}}let ViewZonesChangedEvent$1=class{constructor(){this.type=17}};class ViewModelEventDispatcher extends Disposable{constructor(){super(),this._onEvent=this._register(new Emitter$1),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class ViewModelEventsCollector{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class ContentSizeChangedEvent{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new ContentSizeChangedEvent(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class FocusChangedEvent{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new FocusChangedEvent(this.oldHasFocus,e.hasFocus)}}class ScrollChangedEvent{constructor(e,t,i,s,r,o,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=r,this.scrollLeft=o,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new ScrollChangedEvent(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class ViewZonesChangedEvent{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class HiddenAreasChangedEvent{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class CursorStateChangedEvent{constructor(e,t,i,s,r,o,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=r,this.reason=o,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let r=0;r0){const e=this._cursors.getSelections();for(let t=0;to&&(s=s.slice(0,o),r=!0);const a=CursorModelState.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,r)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,s,r,o){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=Range$2.fromPositions(a[0],a[0]),e.emitViewEvent(new ViewRevealRangeRequestEvent(t,i,l,c,s,r,o))}revealPrimary(e,t,i,s,r,o){const l=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new ViewRevealRangeRequestEvent(t,i,null,l,s,r,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const r=CursorState$1.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,r)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const r=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,CursorState$1.fromModelSelections(r))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,CursorState$1.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,r){const o=CursorModelState.from(this._model,this);if(o.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new ViewCursorStateChangedEvent(l,a,i)),!s||s.cursorState.length!==o.cursorState.length||o.cursorState.some((c,d)=>!c.modelState.equals(s.cursorState[d].modelState))){const c=s?s.cursorState.map(u=>u.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new CursorStateChangedEvent(c,a,d,o.modelVersionId,t||"keyboard",i,r))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const o=r.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=r.text.length-o[2].length-1,u=r.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,s){let r=null;t==="snippet"&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);const o=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(r)for(let u=0,f=r.length;u0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const r=CursorModelState.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){onUnexpectedError(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,r,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return AutoClosedAction.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new CompositionState(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(TypeOperations.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let r=0;for(;r{const c=l.getPosition();return new Selection$1(c.lineNumber,c.column+r,c.lineNumber,c.column+r)});this.setSelections(e,o,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(TypeOperations.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,r))},e,o)}paste(e,t,i,s,r){this._executeEdit(()=>{this._executeEditOperation(TypeOperations.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,r,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(DeleteOperations.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new EditOperationResult(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new EditOperationResult(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class CursorModelState{static from(e,t){return new CursorModelState(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class CommandExecutor{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(s,i);for(let o=0,a=s.trackedRanges.length;o0&&(o[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,o,c=>{const d=[];for(let g=0;gg.identifier.minor-m.identifier.minor,f=[];for(let g=0;g0?(d[g].sort(u),f[g]=t[g].computeCursorState(e.model,{getInverseEditOperations:()=>d[g],getTrackedSelection:m=>{const _=parseInt(m,10),v=e.model._getTrackedRange(e.trackedRanges[_]);return e.trackedRangesDirection[_]===0?new Selection$1(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn):new Selection$1(v.endLineNumber,v.endColumn,v.startLineNumber,v.startColumn)}})):f[g]=e.selectionsBefore[g];return f});a||(a=e.selectionsBefore);const l=[];for(const c in r)r.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{Range$2.isEmpty(u)&&f===""||s.push({identifier:{major:t,minor:r++},range:u,text:f,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:o,addTrackedEditOperation:(u,f,g)=>{a=!0,o(u,f,g)},trackSelection:(u,f)=>{const g=Selection$1.liftSelection(u);let m;if(g.isEmpty())if(typeof f=="boolean")f?m=2:m=3;else{const C=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===C?m=2:m=3}else m=1;const _=e.trackedRanges.length,v=e.model._setTrackedRange(null,g,m);return e.trackedRanges[_]=v,e.trackedRangesDirection[_]=g.getDirection(),_.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return onUnexpectedError(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-Range$2.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;ir.identifier.major?o=s.identifier.major:o=r.identifier.major,t[o.toString()]=!0;for(let a=0;a0&&i--}}return t}}class CompositionLineState{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class CompositionState{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new CompositionLineState(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=CompositionState._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=CompositionState._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let r=0,o=this._original.length;r>>1;t===e[o].afterLineNumber?i{t=!0,s=s|0,r=r|0,o=o|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new EditorWhitespace(l,s,r,o,a)),l},changeOneWhitespace:(s,r,o)=>{t=!0,r=r|0,o=o|0,this._pendingChanges.change({id:s,newAfterLineNumber:r,newHeight:o})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const s=new Set;for(const l of i)s.add(l.id);const r=new Map;for(const l of t)r.set(l.id,l);const o=l=>{const c=[];for(const d of l)if(!s.has(d.id)){if(r.has(d.id)){const u=r.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=o(this._arr).concat(o(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=aa.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,r=t;for(;s=a+i)s=o+1;else{if(e>=a)return o;r=o}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,r=this.getVerticalOffsetForLineNumber(s)|0;let o=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=o+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=r,f=u;const g=5e5;let m=0;r>=g&&(m=Math.floor(r/g)*g,m=Math.floor(m/i)*i,f-=m);const _=[],v=e+(t-e)/2;let C=-1;for(let I=s;I<=o;I++){if(C===-1){const N=u,R=u+i;(N<=v&&vv)&&(C=I)}for(u+=i,_[I-s]=f,f+=i;d===I;)f+=c,u+=c,a++,a>=l?d=o+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){o=I;break}}C===-1&&(C=o);const S=this.getVerticalOffsetForLineNumber(o)|0;let w=s,L=o;return wt&&L--,{bigNumbersDelta:m,startLineNumber:s,endLineNumber:o,relativeVerticalOffset:_,centeredLineNumber:C,completelyVisibleStartLineNumber:w,completelyVisibleEndLineNumber:L,lineHeight:this._lineHeight}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),r=this.getHeightForWhitespaceIndex(i);if(e>=s+r)return-1;for(;t=a+l)t=o+1;else{if(e>=a)return o;i=o}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),r=this.getIdForWhitespaceIndex(t),o=this.getAfterLineNumberForWhitespaceIndex(t);return{id:r,afterLineNumber:o,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const r=[];for(let o=i;o<=s;o++){const a=this.getVerticalOffsetForWhitespaceIndex(o),l=this.getHeightForWhitespaceIndex(o);if(a>=t)break;r.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:a,height:l})}return r}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}},aa.INSTANCE_COUNT=0,aa);const SMOOTH_SCROLLING_TIME=125;class EditorScrollDimensions{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class EditorScrollable extends Disposable{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Emitter$1),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new EditorScrollDimensions(0,0,0,0),this._scrollable=this._register(new Scrollable({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new ContentSizeChangedEvent(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class ViewLayout extends Disposable{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,r=s.get(146),o=s.get(84);this._linesLayout=new LinesLayout$1(t,s.get(67),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new EditorScrollable(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new EditorScrollDimensions(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(115)?SMOOTH_SCROLLING_TIME:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(67)&&this._linesLayout.setLineHeight(t.get(67)),e.hasChanged(84)){const i=t.get(84);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(146)){const i=t.get(146),s=i.contentWidth,r=i.height,o=this._scrollable.getScrollDimensions(),a=o.contentWidth;this._scrollable.setScrollDimensions(new EditorScrollDimensions(s,o.contentWidth,r,this._getContentHeight(s,r,a)))}else this._updateHeight();e.hasChanged(115)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(104);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let r=this._linesLayout.getLinesTotalHeight();return s.get(106)?r+=Math.max(0,t-s.get(67)-s.get(84).bottom):s.get(104).ignoreHorizontalScrollbarInContentHeight||(r+=this._getHorizontalScrollbarHeight(e,i)),r}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new EditorScrollDimensions(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Viewport(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(147),s=e.get(50),r=e.get(146);if(i.isViewportWrapping){const o=e.get(73);return t>r.contentWidth+s.typicalHalfwidthCharacterWidth&&o.enabled&&o.side==="right"?t+r.verticalScrollbarWidth:t}else{const o=e.get(105)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+o+r.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new EditorScrollDimensions(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class ViewModelDecorations{constructor(e,t,i,s,r){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=r,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,r=e.options;let o;if(r.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new Position$1(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new Position$1(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);o=new Range$2(a.lineNumber,a.column,l.lineNumber,l.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new ViewModelDecoration(o,r),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new Range$2(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,filterValidationDecorations(this.configuration.options),t,i),r=e.startLineNumber,o=e.endLineNumber,a=[];let l=0;const c=[];for(let d=r;d<=o;d++)c[d-r]=[];for(let d=0,u=s.length;dt===1)}function isModelDecorationInString(n,e){return testTokensInRange(n,e.range,t=>t===2)}function testTokensInRange(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),r=i===e.startLineNumber,o=i===e.endLineNumber;let a=r?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function createModelLineProjection(n,e){return n===null?e?IdentityModelLineProjection.INSTANCE:HiddenModelLineProjection.INSTANCE:new ModelLineProjection(n,e)}class ModelLineProjection{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,r=this._projectionData.breakOffsets[i];let o;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new LineInjectedText(0,0,c+1,this._projectionData.injectionOptions[d],0));o=LineInjectedText.applyInjectedText(e.getLineContent(t),a).substring(s,r)}else o=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:r+1});return i>0&&(o=spaces(this._projectionData.wrappedTextIndentLength)+o),o}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,r,o,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let g=0,m=0;for(let _=0;_0?l.breakOffsets[_-1]:0,S=l.breakOffsets[_];for(;mS)break;if(C0?l.wrappedTextIndentLength:0,T=R+Math.max(L-C,0),A=R+Math.min(I-C,S-C);T!==A&&v.push(new SingleLineInlineDecoration(T,A,N.inlineClassName,N.inlineClassNameAffectsLetterSpacing))}}if(I<=S)g+=w,m++;else break}}}let f;c?f=e.tokenization.getLineTokens(t).withInserted(c.map((g,m)=>({offset:g,text:d[m].content,tokenMetadata:LineTokens.defaultTokenMetadata}))):f=e.tokenization.getLineTokens(t);for(let g=i;g0?s.wrappedTextIndentLength:0,o=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],l=e.sliceAndInflate(o,a,r);let c=l.getLineContent();i>0&&(c=spaces(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,f=i+1=_spaces.length)for(let e=1;e<=n;e++)_spaces[e]=_makeSpaces(e);return _spaces[n]}function _makeSpaces(n){return new Array(n+1).join(" ")}class ViewModelLinesFromProjectedModel{constructor(e,t,i,s,r,o,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=r,this.tabSize=o,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new CoordinatesConverter(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),r=i.length,o=this.createLineBreaksComputer(),a=new ArrayQueue(LineInjectedText.fromDecorations(s));for(let _=0;_C.lineNumber===_+1);o.addRequest(i[_],v,t?t[_]:null)}const l=o.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(_=>this.model.getDecorationRange(_)).sort(Range$2.compareRangesUsingStarts);let u=1,f=0,g=-1,m=g+1=u&&v<=f,S=createModelLineProjection(l[_],!C);c[_]=S.getViewLineCount(),this.modelLineProjections[_]=S}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new ConstantTimePrefixSumComputer(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(f=>this.model.validateRange(f)),i=normalizeLineRanges(t),s=this.hiddenAreasDecorationIds.map(f=>this.model.getDecorationRange(f)).sort(Range$2.compareRangesUsingStarts);if(i.length===s.length){let f=!1;for(let g=0;g({range:f,options:ModelDecorationOptions.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,r);const o=i;let a=1,l=0,c=-1,d=c+1=a&&g<=l?this.modelLineProjections[f].isVisible()&&(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!1),m=!0):(u=!0,this.modelLineProjections[f].isVisible()||(this.modelLineProjections[f]=this.modelLineProjections[f].setVisible(!0),m=!0)),m){const _=this.modelLineProjections[f].getViewLineCount();this.projectedModelLineLineCounts.setValue(f,_)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,r){const o=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===s,d=this.wordBreak===r;if(o&&a&&l&&c&&d)return!1;const u=o&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=r;let f=null;if(u){f=[];for(let g=0,m=this.modelLineProjections.length;g2&&!this.modelLineProjections[t-2].isVisible(),o=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=s.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,m=u+1,_=m+(r-l)-1,c=!0):rt?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,r.lineNumber,o.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new ViewLineInfo(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Position$1(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Position$1(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),r=new Array;let o=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let f=d;f{if(g.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||g.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const _=this.convertModelPositionToViewPosition(d.modelLineNumber,g.horizontalLine.endColumn),v=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,g.horizontalLine.endColumn);return v.lineNumber===d.modelLineWrappedLineIdx?new IndentGuide(g.visibleColumn,m,g.className,new IndentGuideHorizontalLine(g.horizontalLine.top,_.column),-1,-1):v.lineNumber!!g))}}return o}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let r=[];const o=[],a=[],l=i.lineNumber-1,c=s.lineNumber-1;let d=null;for(let m=l;m<=c;m++){const _=this.modelLineProjections[m];if(_.isVisible()){const v=_.getViewLineNumberOfModelPosition(0,m===l?i.column:1),C=_.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(m+1)),S=C-v+1;let w=0;S>1&&_.getViewLineMinColumn(this.model,m+1,C)===1&&(w=v===0?1:2),o.push(S),a.push(w),d===null&&(d=new Position$1(m+1,0))}else d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,m)),d=null)}d!==null&&(r=r.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const u=t-e+1,f=new Array(u);let g=0;for(let m=0,_=r.length;m<_;m++){let v=r[m];const C=Math.min(u-g,o[m]),S=a[m];let w;S===2?w=0:S===1?w=1:w=C;for(let L=0;Lt&&(m=!0,g=t-r+1),u.getViewLinesData(this.model,c+1,f,g,r-e,i,l),r+=g,m)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),r=s.index,o=s.remainder,a=this.modelLineProjections[r],l=a.getViewLineMinColumn(this.model,r+1,o),c=a.getViewLineMaxColumn(this.model,r+1,o);tc&&(t=c);const d=a.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new Position$1(r+1,d)).equals(i)?new Position$1(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new Range$2(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new Position$1(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Range$2(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,r=!1){const o=this.model.validatePosition(new Position$1(e,t)),a=o.lineNumber,l=o.column;let c=a-1,d=!1;if(r)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new Position$1(s?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let f;return d?r?f=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):f=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):f=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),f}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Range$2.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Range$2(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const r=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(r,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,r){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Range$2(o.lineNumber,1,a.lineNumber,a.column),t,i,s,r);let l=[];const c=o.lineNumber-1,d=a.lineNumber-1;let u=null;for(let _=c;_<=d;_++)if(this.modelLineProjections[_].isVisible())u===null&&(u=new Position$1(_+1,_===c?o.column:1));else if(u!==null){const C=this.model.getLineMaxColumn(_);l=l.concat(this.model.getDecorationsInRange(new Range$2(u.lineNumber,u.column,_,C),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new Range$2(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((_,v)=>{const C=Range$2.compareRangesUsingStarts(_.range,v.range);return C===0?_.idv.id?1:0:C});const f=[];let g=0,m=null;for(const _ of l){const v=_.id;m!==v&&(m=v,f[g++]=_)}return f}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function normalizeLineRanges(n){if(n.length===0)return[];const e=n.slice();e.sort(Range$2.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let r=1,o=e.length;rs+1?(t.push(new Range$2(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new Range$2(i,1,s,1)),t}class ViewLineInfo{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class ViewLineInfoGroupedByModelRange{constructor(e,t){this.modelRange=e,this.viewLines=t}}class CoordinatesConverter{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class ViewModelLinesFromModelAsIs{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new IdentityCoordinatesConverter(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new ViewLinesDeletedEvent(t,i)}onModelLinesInserted(e,t,i,s){return new ViewLinesInsertedEvent(t,i)}onModelLineChanged(e,t,i){return[!1,new ViewLinesChangedEvent(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let r=0;rt)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}const MAX_LANE=GlyphMarginLane.Right;class GlyphMarginLanesModel{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*MAX_LANE/8))}reset(e){const t=Math.ceil((e+1)*MAX_LANE/8);this.lanes.length>>3]|=1<>>3]&1<>>3]&1<this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=ViewportStart.create(this.model),this.glyphLanes=new GlyphMarginLanesModel(0),this.model.isTooLargeForTokenization())this._lines=new ViewModelLinesFromModelAsIs(this.model);else{const u=this._configuration.options,f=u.get(50),g=u.get(140),m=u.get(147),_=u.get(139),v=u.get(130);this._lines=new ViewModelLinesFromProjectedModel(this._editorId,this.model,s,r,f,this.model.getOptions().tabSize,g,m.wrappingColumn,_,v)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new CursorsController(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new ViewLayout(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new ViewScrollChangedEvent(u)),this._eventDispatcher.emitOutgoingEvent(new ScrollChangedEvent(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new ViewModelDecorations(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const f=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(f,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(MinimapTokensColorTracker.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new ViewTokensColorsChangedEvent)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ViewThemeChangedEvent(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new Range$2(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new ViewFocusChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new FocusChangedEvent(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new ViewCompositionStartEvent)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new ViewCompositionEndEvent)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Position$1(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new StableViewport(t,this._viewportStart.startLineDelta)}return new StableViewport(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,r=s.get(50),o=s.get(140),a=s.get(147),l=s.get(139),c=s.get(130);this._lines.setWrappingSettings(r,o,a.wrappingColumn,l,c)&&(e.emitViewEvent(new ViewFlushedEvent),e.emitViewEvent(new ViewLineMappingChangedEvent),e.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(92)&&(this._decorations.reset(),e.emitViewEvent(new ViewDecorationsChangedEvent(null))),t.hasChanged(99)&&(this._decorations.reset(),e.emitViewEvent(new ViewDecorationsChangedEvent(null))),e.emitViewEvent(new ViewConfigurationChangedEvent(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),CursorConfiguration.shouldRecreate(t)&&(this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,r=!1;const o=e instanceof InternalModelContentChangeEvent?e.rawContentChangedEvent.changes:e.changes,a=e instanceof InternalModelContentChangeEvent?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of o)switch(u.changeType){case 4:{for(let f=0;f!_.ownerId||_.ownerId===this._editorId)),l.addRequest(g,m,null)}break}case 2:{let f=null;u.injectedText&&(f=u.injectedText.filter(g=>!g.ownerId||g.ownerId===this._editorId)),l.addRequest(u.detail,f,null);break}}const c=l.finalize(),d=new ArrayQueue(c);for(const u of o)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new ViewFlushedEvent),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const f=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesDeleted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 4:{const f=d.takeCount(u.detail.length),g=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,f);g!==null&&(i.emitViewEvent(g),this.viewLayout.onLinesInserted(g.fromLineNumber,g.toLineNumber)),s=!0;break}case 2:{const f=d.dequeue(),[g,m,_,v]=this._lines.onModelLineChanged(a,u.lineNumber,f);r=g,m&&i.emitViewEvent(m),_&&(i.emitViewEvent(_),this.viewLayout.onLinesInserted(_.fromLineNumber,_.toLineNumber)),v&&(i.emitViewEvent(v),this.viewLayout.onLinesDeleted(v.fromLineNumber,v.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&r&&(i.emitViewEvent(new ViewLineMappingChangedEvent),i.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),r=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:r+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof InternalModelContentChangeEvent&&i.emitOutgoingEvent(new ModelContentChangedEvent(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new ViewLanguageConfigurationEvent),this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ModelLanguageConfigurationChangedEvent(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ModelLanguageChangedEvent(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new ViewFlushedEvent),t.emitViewEvent(new ViewLineMappingChangedEvent),t.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new CursorConfiguration(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ModelOptionsChangedEvent(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new ViewDecorationsChangedEvent(e)),this._eventDispatcher.emitOutgoingEvent(new ModelDecorationsChangedEvent(e))}))}setHiddenAreas(e,t){var o;this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let r=!1;try{const a=this._eventDispatcher.beginEmitViewEvents();r=this._lines.setHiddenAreas(i),r&&(a.emitViewEvent(new ViewFlushedEvent),a.emitViewEvent(new ViewLineMappingChangedEvent),a.emitViewEvent(new ViewDecorationsChangedEvent(null)),this._cursor.onLineMappingChanged(a),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged());const l=(o=s.viewportStartModelPosition)==null?void 0:o.lineNumber;l&&i.some(d=>d.startLineNumber<=l&&l<=d.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new HiddenAreasChangedEvent)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(146),t=this._configuration.options.get(67),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),r=Math.max(1,s.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Range$2(r,this.getLineMinColumn(r),o,this.getLineMaxColumn(o)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let r=0,o=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(o"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=firstNonWhitespaceIndex(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=lastNonWhitespaceIndex(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),r=this.getTabSize(),o=this._lines.getViewLineData(e);return o.inlineDecorations&&(t=[...t,...o.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new ViewLineRenderingData(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,s,o.tokens,t,r,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new MinimapLinesRenderingData(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,filterValidationDecorations(this._configuration.options)),i=new OverviewRulerDecorations;for(const s of t){const r=s.options,o=r.overviewRuler;if(!o)continue;const a=o.position;if(a===0)continue;const l=o.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,r.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const s=t.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),s=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(s)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const s=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(Range$2.compareRangesUsingStarts);let r=!1,o=!1;for(const l of e)l.isEmpty()?r=!0:o=!0;if(!o){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+s);return c}if(r&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===PLAINTEXT_LANGUAGE_ID||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new Range$2(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const r=this._configuration.options.get(50),o=this._getColorMap(),l=/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===EDITOR_FONT_DEFAULTS.fontFamily;let c;return l?c=EDITOR_FONT_DEFAULTS.fontFamily:(c=r.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${EDITOR_FONT_DEFAULTS.fontFamily}`),{mode:i,html:`
    `+this._getHTMLToCopy(s,o)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=r;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),f=c===i?s-1:0,g=c===r?o-1:u.length;u===""?l+="
    ":l+=tokenizeLineToHTML(u,d.inflate(),t,f,g,a,isWindows)}return l}_getColorMap(){const e=TokenizationRegistry.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new ReadOnlyEditAttemptEvent);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,r){this._executeCursorEdit(o=>this._cursor.compositionType(o,e,t,i,s,r))}paste(e,t,i,s){this._executeCursorEdit(r=>this._cursor.paste(r,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealAll(s,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Range$2(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Range$2(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,r){this._withViewEventsCollector(o=>o.emitViewEvent(new ViewRevealRangeRequestEvent(e,!1,i,null,s,t,r)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new ViewZonesChangedEvent$1),this._eventDispatcher.emitOutgoingEvent(new ViewZonesChangedEvent))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class ViewportStart{static create(e){const t=e._setTrackedRange(null,new Range$2(1,1,1,1),1);return new ViewportStart(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,r){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=r}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Position$1(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new Range$2(i.lineNumber,i.column,i.lineNumber,i.column),1),r=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=o-r}invalidate(){this._isValid=!1}}class OverviewRulerDecorations{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,r){const o=this._asMap[e];if(o){const a=o.data,l=a[a.length-3],c=a[a.length-1];if(l===r&&c+1>=i){s>c&&(a[a.length-1]=s);return}a.push(r,i,s)}else{const a=new OverviewRulerDecorationsGroup(e,t,[r,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class HiddenAreasModel{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&rangeArraysEqual(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>mergeLineRangeArray(t,i),[]);return rangeArraysEqual(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function mergeLineRangeArray(n,e){const t=[];let i=0,s=0;for(;i=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1S=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CodeEditorWidget_1,El;let CodeEditorWidget=(El=class extends Disposable{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}constructor(e,t,i,s,r,o,a,l,c,d,u,f){super(),this.languageConfigurationService=u,this._deliveryQueue=createEventDeliveryQueue(),this._contributions=this._register(new CodeEditorContributions),this._onDidDispose=this._register(new Emitter$1),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new BooleanEventEmitter({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new BooleanEventEmitter({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new InteractionEmitter(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new Emitter$1({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onBeginUpdate=this._register(new Emitter$1),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new Emitter$1),this.onEndUpdate=this._onEndUpdate.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),r.willCreateCodeEditor();const g={...t};this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++EDITOR_ID,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?MenuId.SimpleEditorContext:MenuId.EditorContext),g,d)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const C=this._configuration.options;if(v.hasChanged(146)){const S=C.get(146);this._onDidLayoutChange.fire(S)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=r,this._commandService=o,this._themeService=l,this._register(new EditorContextKeysManager(this,this._contextKeyService)),this._register(new EditorModeContext(this,this._contextKeyService,f)),this._instantiationService=this._register(s.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService]))),this._modelData=null,this._focusTracker=new CodeEditorWidgetFocusTracker(e,this._overflowWidgetsDomNode),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let m;Array.isArray(i.contributions)?m=i.contributions:m=EditorExtensionsRegistry.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const v of EditorExtensionsRegistry.getEditorActions()){if(this._actions.has(v.id)){onUnexpectedError(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const C=new InternalEditorAction(v.id,v.label,v.alias,v.metadata,v.precondition??void 0,S=>this._instantiationService.invokeFunction(w=>Promise.resolve(v.runEditorCommand(w,this,S))),this._contextKeyService);this._actions.set(C.id,C)}const _=()=>!this._configuration.options.get(92)&&this._configuration.options.get(36).enabled;this._register(new DragAndDropObserver(this._domElement,{onDragOver:v=>{if(!_())return;const C=this.getTargetAtClientPoint(v.clientX,v.clientY);C!=null&&C.position&&this.showDropIndicatorAt(C.position)},onDrop:async v=>{if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const C=this.getTargetAtClientPoint(v.clientX,v.clientY);C!=null&&C.position&&this._onDropIntoEditor.fire({position:C.position,event:v})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)==null||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,s){return new EditorConfiguration(e,t,i,this._domElement,s)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return EditorType.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?WordOperations.getWordAtPosition(this._modelData.model,this._configuration.options.get(132),this._configuration.options.get(131),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` +`?i=1:e&&e.lineEnding&&e.lineEnding===`\r +`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const s={oldModelUrl:((t=this._modelData)==null?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(s);const r=this.hasTextFocus(),o=this._detachModel();this._attachModel(i),r&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(s),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?CodeEditorWidget_1._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?CodeEditorWidget_1._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const r=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(r);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,s)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return CodeEditorWidget_1._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}setHiddenAreas(e,t){var i;(i=this._modelData)==null||i.viewModel.setHiddenAreas(e.map(s=>Range$2.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return CursorColumns.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Position$1.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!Range$2.isIRange(e))throw new Error("Invalid arguments");const r=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(r);this._modelData.viewModel.revealRange("api",i,o,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!Position$1.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=Selection$1.isISelection(e),s=Range$2.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const r={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(r,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Selection$1(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new Range$2(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!Range$2.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Range$2.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,r=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())==null||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const r=i;this._type(e,r.text||"");return}case"replacePreviousChar":{const r=i;this._compositionType(e,r.text||"",r.replaceCharCnt||0,0,0);return}case"compositionType":{const r=i;this._compositionType(e,r.text||"",r.replacePrevCharCnt||0,r.replaceNextCharCnt||0,r.positionDelta||0);return}case"paste":{const r=i;this._paste(e,r.text||"",r.pasteOnNewLine||!1,r.multicursorText||null,r.mode||null,r.clipboardEvent);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,onUnexpectedError);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,r){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,r,e)}_paste(e,t,i,s,r,o){if(!this._modelData)return;const a=this._modelData.viewModel,l=a.getSelection().getStartPosition();a.paste(t,i,s,e);const c=a.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({clipboardEvent:o,range:new Range$2(l.lineNumber,l.column,c.lineNumber,c.column),languageId:r})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=EditorExtensionsRegistry.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(r=>{Promise.resolve(s.runEditorCommand(r,this,i)).then(void 0,onUnexpectedError)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(92)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(92)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(92))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new EditorDecorationsCollection(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,filterValidationDecorations(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,filterValidationDecorations(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(i=>i.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(146)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(146),r=CodeEditorWidget_1._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),o=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:r,left:o,height:i.get(67)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){applyFontInfo(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new ViewModel$1(this._id,this._configuration,e,DOMLineBreaksComputerFactory.create(getWindow(this._domElement)),MonospaceLineBreaksComputerFactory.create(this._configuration.options),a=>scheduleAtNextAnimationFrame(getWindow(this._domElement),a),this.languageConfigurationService,this._themeService,i,{batchChanges:a=>{try{return this._beginUpdate(),a()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(80),f=localize("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(Severity.Warning,f,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:localize("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,f=a.selections.length;u{this._paste("keyboard",r,o,a,l)},type:r=>{this._type("keyboard",r)},compositionType:(r,o,a,l)=>{this._compositionType("keyboard",r,o,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(r,o,a,l)=>{const c={text:r,pasteOnNewLine:o,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:r=>{const o={text:r};this._commandService.executeCommand("type",o)},compositionType:(r,o,a,l)=>{if(a||l){const c={text:r,replacePrevCharCnt:o,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:r,replaceCharCnt:o};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new ViewUserInputEvents(e.coordinatesConverter);return i.onKeyDown=r=>this._onKeyDown.fire(r),i.onKeyUp=r=>this._onKeyUp.fire(r),i.onContextMenu=r=>this._onContextMenu.fire(r),i.onMouseMove=r=>this._onMouseMove.fire(r),i.onMouseLeave=r=>this._onMouseLeave.fire(r),i.onMouseDown=r=>this._onMouseDown.fire(r),i.onMouseUp=r=>this._onMouseUp.fire(r),i.onMouseDrag=r=>this._onMouseDrag.fire(r),i.onMouseDrop=r=>this._onMouseDrop.fire(r),i.onMouseDropCanceled=r=>this._onMouseDropCanceled.fire(r),i.onMouseWheel=r=>this._onMouseWheel.fire(r),[new View$1(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){var i;if((i=this._contributionsDisposable)==null||i.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new Range$2(e.lineNumber,e.column,e.lineNumber,e.column),options:CodeEditorWidget_1.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,this._updateCounter===0&&this._onEndUpdate.fire()}},CodeEditorWidget_1=El,El.dropIntoEditorDecorationOptions=ModelDecorationOptions.register({description:"workbench-dnd-target",className:"dnd-target"}),El);CodeEditorWidget=CodeEditorWidget_1=__decorate$1S([__param$1S(3,IInstantiationService),__param$1S(4,ICodeEditorService),__param$1S(5,ICommandService),__param$1S(6,IContextKeyService),__param$1S(7,IThemeService),__param$1S(8,INotificationService),__param$1S(9,IAccessibilityService),__param$1S(10,ILanguageConfigurationService),__param$1S(11,ILanguageFeaturesService)],CodeEditorWidget);let EDITOR_ID=0;class ModelData{constructor(e,t,i,s,r,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=r,this.attachedView=o}dispose(){dispose(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}class BooleanEventEmitter extends Disposable{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new Emitter$1(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Emitter$1(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class InteractionEmitter extends Emitter$1{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class EditorContextKeysManager extends Disposable{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=EditorContextKeys.editorSimpleInput.bindTo(t),this._editorFocus=EditorContextKeys.focus.bindTo(t),this._textInputFocus=EditorContextKeys.textInputFocus.bindTo(t),this._editorTextFocus=EditorContextKeys.editorTextFocus.bindTo(t),this._tabMovesFocus=EditorContextKeys.tabMovesFocus.bindTo(t),this._editorReadonly=EditorContextKeys.readOnly.bindTo(t),this._inDiffEditor=EditorContextKeys.inDiffEditor.bindTo(t),this._editorColumnSelection=EditorContextKeys.columnSelection.bindTo(t),this._hasMultipleSelections=EditorContextKeys.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=EditorContextKeys.hasNonEmptySelection.bindTo(t),this._canUndo=EditorContextKeys.canUndo.bindTo(t),this._canRedo=EditorContextKeys.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(TabFocus.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(TabFocus.getTabFocusMode()),this._editorReadonly.set(e.get(92)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class EditorModeContext extends Disposable{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=EditorContextKeys.languageId.bindTo(t),this._hasCompletionItemProvider=EditorContextKeys.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=EditorContextKeys.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=EditorContextKeys.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=EditorContextKeys.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=EditorContextKeys.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=EditorContextKeys.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=EditorContextKeys.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=EditorContextKeys.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=EditorContextKeys.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=EditorContextKeys.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=EditorContextKeys.hasReferenceProvider.bindTo(t),this._hasRenameProvider=EditorContextKeys.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=EditorContextKeys.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=EditorContextKeys.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=EditorContextKeys.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=EditorContextKeys.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=EditorContextKeys.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=EditorContextKeys.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=EditorContextKeys.isInEmbeddedEditor.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===Schemas.walkThroughSnippet||e.uri.scheme===Schemas.vscodeChatCodeBlock)})}}class CodeEditorWidgetFocusTracker extends Disposable{constructor(e,t){super(),this._onChange=this._register(new Emitter$1),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(trackFocus(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(trackFocus(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class EditorDecorationsCollection{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}const squigglyStart=encodeURIComponent("");function getSquigglySVGData(n){return squigglyStart+encodeURIComponent(n.toString())+squigglyEnd}const dotdotdotStart=encodeURIComponent('');function getDotDotDotSVGData(n){return dotdotdotStart+encodeURIComponent(n.toString())+dotdotdotEnd}registerThemingParticipant((n,e)=>{const t=n.getColor(editorErrorForeground);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${getSquigglySVGData(t)}") repeat-x bottom left; }`);const i=n.getColor(editorWarningForeground);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${getSquigglySVGData(i)}") repeat-x bottom left; }`);const s=n.getColor(editorInfoForeground);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${getSquigglySVGData(s)}") repeat-x bottom left; }`);const r=n.getColor(editorHintForeground);r&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${getDotDotDotSVGData(r)}") no-repeat bottom left; }`);const o=n.getColor(editorUnnecessaryCodeOpacity);o&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o.rgba.a}; }`)});const style$1="";class StableEditorScrollState{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new StableEditorScrollState(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-r}return new StableEditorScrollState(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=r}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}function joinCombine(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let r=0,o=0;for(;rd?(s.push(l),o++):(s.push(i(a,l)),r++,o++)}for(;r`Apply decorations from ${e.debugName}`},s=>{const r=e.read(s);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function appendRemoveOnDispose(n,e){return n.appendChild(e),toDisposable(()=>{e.remove()})}function prependRemoveOnDispose(n,e){return n.prepend(e),toDisposable(()=>{e.remove()})}class ObservableElementSizeObserver extends Disposable{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new ElementSizeObserver(e,t)),this._width=observableValue(this,this.elementSizeObserver.getWidth()),this._height=observableValue(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>transaction(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function animatedObservable(n,e,t){let i=e.get(),s=i,r=i;const o=observableValue("animatedValue",i);let a=-1;const l=300;let c;t.add(autorunHandleChanges({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,f)=>(u.didChange(e)&&(f.animate=f.animate||u.change),!0)},(u,f)=>{c!==void 0&&(n.cancelAnimationFrame(c),c=void 0),s=r,i=e.read(u),a=Date.now()-(f.animate?0:l),d()}));function d(){const u=Date.now()-a;r=Math.floor(easeOutExpo(u,s,i-s,l)),u{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const ug=class ug{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${ug._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};ug._counter=0;let ManagedOverlayWidget=ug;function applyStyle(n,e){return autorun(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),n.style[i]=s})}function applyViewZones(n,e,t,i){const s=new DisposableStore,r=[];return s.add(autorunWithStore((o,a)=>{const l=e.read(o),c=new Map,d=new Map;t&&t(!0),n.changeViewZones(u=>{for(const f of r)u.removeZone(f),i==null||i.delete(f);r.length=0;for(const f of l){const g=u.addZone(f);f.setZoneId&&f.setZoneId(g),r.push(g),i==null||i.add(g),c.set(f,g)}}),t&&t(!1),a.add(autorunHandleChanges({createEmptyChangeSummary(){return{zoneIds:[]}},handleChange(u,f){const g=d.get(u.changedObservable);return g!==void 0&&f.zoneIds.push(g),!0}},(u,f)=>{for(const g of l)g.onChange&&(d.set(g.onChange,c.get(g)),g.onChange.read(u));t&&t(!0),n.changeViewZones(g=>{for(const m of f.zoneIds)g.layoutZone(m)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const a of r)o.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),s}class DisposableCancellationTokenSource extends CancellationTokenSource$1{dispose(){super.dispose(!0)}}function translatePosition(n,e){const t=findLast(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return Range$2.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return Range$2.fromPositions(new Position$1(s,n.column))}if(!t.innerChanges)return Range$2.fromPositions(new Position$1(t.modified.startLineNumber,1));const i=findLast(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return Range$2.fromPositions(new Position$1(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=lengthBetweenPositions(i.originalRange.getEndPosition(),n);return Range$2.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function lengthBetweenPositions(n,e){return n.lineNumber===e.lineNumber?new TextLength(0,e.column-n.column):new TextLength(e.lineNumber-n.lineNumber,e.column-1)}function filterWithPrevious(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}class RefCounted{static create(e,t=void 0){return new BaseRefCounted(e,e,t)}static createWithDisposable(e,t,i=void 0){const s=new DisposableStore;return s.add(t),s.add(e),new BaseRefCounted(e,s,i)}}class BaseRefCounted extends RefCounted{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new ClonedRefCounted(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class ClonedRefCounted extends RefCounted{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}const accessibleDiffViewer="";var __decorate$1R=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1R=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const accessibleDiffViewerInsertIcon=registerIcon("diff-review-insert",Codicon.add,localize("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),accessibleDiffViewerRemoveIcon=registerIcon("diff-review-remove",Codicon.remove,localize("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),accessibleDiffViewerCloseIcon=registerIcon("diff-review-close",Codicon.close,localize("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));var du;let AccessibleDiffViewer=(du=class extends Disposable{constructor(e,t,i,s,r,o,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=r,this._height=o,this._diffs=a,this._models=l,this._instantiationService=c,this._state=derivedWithStore(this,(d,u)=>{const f=this._visible.read(d);if(this._parentNode.style.visibility=f?"visible":"hidden",!f)return null;const g=u.add(this._instantiationService.createInstance(ViewModel,this._diffs,this._models,this._setVisible,this._canClose)),m=u.add(this._instantiationService.createInstance(View,this._parentNode,g,this._width,this._height,this._models));return{model:g,view:m}}).recomputeInitiallyAndOnChange(this._store)}next(){transaction(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){transaction(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){transaction(e=>{this._setVisible(!1,e)})}},du._ttPolicy=createTrustedTypesPolicy("diffReview",{createHTML:e=>e}),du);AccessibleDiffViewer=__decorate$1R([__param$1R(8,IInstantiationService)],AccessibleDiffViewer);let ViewModel=class extends Disposable{constructor(e,t,i,s,r){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=r,this._groups=observableValue(this,[]),this._currentGroupIdx=observableValue(this,0),this._currentElementIdx=observableValue(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>{var l;return(l=this.currentGroup.read(a))==null?void 0:l.lines[o]}),this._register(autorun(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const l=computeViewElementGroups(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());transaction(c=>{const d=this._models.getModifiedPosition();if(d){const u=l.findIndex(f=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(o);(a==null?void 0:a.type)===LineType.Deleted?this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===LineType.Added&&this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(autorun(o=>{const a=this.currentElement.read(o);if(a&&a.type!==LineType.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(Range$2.fromPositions(new Position$1(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||subtransaction(t,s=>{this._currentGroupIdx.set(OffsetRange.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||transaction(i=>{this._currentElementIdx.set(OffsetRange.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&transaction(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===LineType.Deleted?this._models.originalReveal(Range$2.fromPositions(new Position$1(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==LineType.Header?Range$2.fromPositions(new Position$1(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};ViewModel=__decorate$1R([__param$1R(4,IAccessibilitySignalService)],ViewModel);const viewElementGroupLineMargin=3;function computeViewElementGroups(n,e,t){const i=[];for(const s of groupAdjacentBy(n,(r,o)=>o.modified.startLineNumber-r.modified.endLineNumberExclusive<2*viewElementGroupLineMargin)){const r=[];r.push(new HeaderViewElement);const o=new LineRange$1(Math.max(1,s[0].original.startLineNumber-viewElementGroupLineMargin),Math.min(s[s.length-1].original.endLineNumberExclusive+viewElementGroupLineMargin,e+1)),a=new LineRange$1(Math.max(1,s[0].modified.startLineNumber-viewElementGroupLineMargin),Math.min(s[s.length-1].modified.endLineNumberExclusive+viewElementGroupLineMargin,t+1));forEachAdjacent(s,(d,u)=>{const f=new LineRange$1(d?d.original.endLineNumberExclusive:o.startLineNumber,u?u.original.startLineNumber:o.endLineNumberExclusive),g=new LineRange$1(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);f.forEach(m=>{r.push(new UnchangedLineViewElement(m,g.startLineNumber+(m-f.startLineNumber)))}),u&&(u.original.forEach(m=>{r.push(new DeletedLineViewElement(u,m))}),u.modified.forEach(m=>{r.push(new AddedLineViewElement(u,m))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new ViewElementGroup(new LineRangeMapping(l,c),r))}return i}var LineType;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(LineType||(LineType={}));class ViewElementGroup{constructor(e,t){this.range=e,this.lines=t}}class HeaderViewElement{constructor(){this.type=LineType.Header}}class DeletedLineViewElement{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=LineType.Deleted,this.modifiedLineNumber=void 0}}class AddedLineViewElement{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=LineType.Added,this.originalLineNumber=void 0}}class UnchangedLineViewElement{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=LineType.Unchanged}}let View=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=r,this._languageService=o,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new ActionBar(a)),this._register(autorun(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Action("diffreview.close",localize("label.close","Close"),"close-diff-review "+ThemeIcon.asClassName(accessibleDiffViewerCloseIcon),!0,async()=>t.close()),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new DomScrollableElement(this._content,{})),reset$1(this.domNode,this._scrollbar.getDomNode(),a),this._register(autorun(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(toDisposable(()=>{reset$1(this.domNode)})),this._register(applyStyle(this.domNode,{width:this._width,height:this._height})),this._register(applyStyle(this._content,{width:this._width,height:this._height})),this._register(autorunWithStore((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(addStandardDisposableListener(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",localize("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),applyFontInfo(s,i.get(50)),reset$1(this._content,s);const r=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!r||!o)return;const a=r.getOptions(),l=o.getOptions(),c=i.get(67),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let f;if(u.type===LineType.Header){const m=document.createElement("div");m.className="diff-review-row",m.setAttribute("role","listitem");const _=d.range,v=this._model.currentGroupIndex.get(),C=this._model.groups.get().length,S=N=>N===0?localize("no_lines_changed","no lines changed"):N===1?localize("one_line_changed","1 line changed"):localize("more_lines_changed","{0} lines changed",N),w=S(_.original.length),L=S(_.modified.length);m.setAttribute("aria-label",localize({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",v+1,C,_.original.startLineNumber,w,_.modified.startLineNumber,L));const I=document.createElement("div");I.className="diff-review-cell diff-review-summary",I.appendChild(document.createTextNode(`${v+1}/${C}: @@ -${_.original.startLineNumber},${_.original.length} +${_.modified.startLineNumber},${_.modified.length} @@`)),m.appendChild(I),f=m}else f=this._createRow(u,c,this._width.get(),t,r,a,i,o,l);s.appendChild(f);const g=derived(m=>this._model.currentElement.read(m)===u);e.add(autorun(m=>{const _=g.read(m);f.tabIndex=_?0:-1,_&&f.focus()})),e.add(addDisposableListener(f,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,r,o,a,l,c){const d=s.get(146),u=d.glyphMarginWidth+d.lineNumbersWidth,f=a.get(146),g=10+f.glyphMarginWidth+f.lineNumbersWidth;let m="diff-review-row",_="";const v="diff-review-spacer";let C=null;switch(e.type){case LineType.Added:m="diff-review-row line-insert",_=" char-insert",C=accessibleDiffViewerInsertIcon;break;case LineType.Deleted:m="diff-review-row line-delete",_=" char-delete",C=accessibleDiffViewerRemoveIcon;break}const S=document.createElement("div");S.style.minWidth=i+"px",S.className=m,S.setAttribute("role","listitem"),S.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,S.appendChild(w);const L=document.createElement("span");L.style.width=u+"px",L.style.minWidth=u+"px",L.className="diff-review-line-number"+_,e.originalLineNumber!==void 0?L.appendChild(document.createTextNode(String(e.originalLineNumber))):L.innerText=" ",w.appendChild(L);const I=document.createElement("span");I.style.width=g+"px",I.style.minWidth=g+"px",I.style.paddingRight="10px",I.className="diff-review-line-number"+_,e.modifiedLineNumber!==void 0?I.appendChild(document.createTextNode(String(e.modifiedLineNumber))):I.innerText=" ",w.appendChild(I);const N=document.createElement("span");if(N.className=v,C){const A=document.createElement("span");A.className=ThemeIcon.asClassName(C),A.innerText="  ",N.appendChild(A)}else N.innerText="  ";w.appendChild(N);let R;if(e.modifiedLineNumber!==void 0){let A=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);AccessibleDiffViewer._ttPolicy&&(A=AccessibleDiffViewer._ttPolicy.createHTML(A)),w.insertAdjacentHTML("beforeend",A),R=l.getLineContent(e.modifiedLineNumber)}else{let A=this._getLineHtml(r,s,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);AccessibleDiffViewer._ttPolicy&&(A=AccessibleDiffViewer._ttPolicy.createHTML(A)),w.insertAdjacentHTML("beforeend",A),R=r.getLineContent(e.originalLineNumber)}R.length===0&&(R=localize("blankLine","blank"));let T="";switch(e.type){case LineType.Unchanged:e.originalLineNumber===e.modifiedLineNumber?T=localize({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",R,e.originalLineNumber):T=localize("equalLine","{0} original line {1} modified line {2}",R,e.originalLineNumber,e.modifiedLineNumber);break;case LineType.Added:T=localize("insertLine","+ {0} modified line {1}",R,e.modifiedLineNumber);break;case LineType.Deleted:T=localize("deleteLine","- {0} original line {1}",R,e.originalLineNumber);break}return S.setAttribute("aria-label",T),S}_getLineHtml(e,t,i,s,r){const o=e.getLineContent(s),a=t.get(50),l=LineTokens.createEmpty(o,r),c=ViewLineRenderingData.isBasicASCII(o,e.mightContainNonBasicASCII()),d=ViewLineRenderingData.containsRTL(o,c,e.mightContainRTL());return renderViewLine2(new RenderLineInput(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,o,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(118),t.get(100),t.get(95),t.get(51)!==EditorFontLigatures.OFF,null)).html}};View=__decorate$1R([__param$1R(5,ILanguageService)],View);class AccessibleDiffViewerModelFromEditors{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}registerColor("diffEditor.move.border","#8b8b8b9c",localize("diffEditor.move.border","The border color for text that got moved in the diff editor."));registerColor("diffEditor.moveActive.border","#FFA500",localize("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));registerColor("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},localize("diffEditor.unchangedRegionShadow","The color of the shadow around unchanged region widgets."));const diffInsertIcon=registerIcon("diff-insert",Codicon.add,localize("diffInsertIcon","Line decoration for inserts in the diff editor.")),diffRemoveIcon=registerIcon("diff-remove",Codicon.remove,localize("diffRemoveIcon","Line decoration for removals in the diff editor.")),diffLineAddDecorationBackgroundWithIndicator=ModelDecorationOptions.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+ThemeIcon.asClassName(diffInsertIcon),marginClassName:"gutter-insert"}),diffLineDeleteDecorationBackgroundWithIndicator=ModelDecorationOptions.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+ThemeIcon.asClassName(diffRemoveIcon),marginClassName:"gutter-delete"}),diffLineAddDecorationBackground=ModelDecorationOptions.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),diffLineDeleteDecorationBackground=ModelDecorationOptions.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),diffAddDecoration=ModelDecorationOptions.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),diffWholeLineAddDecoration=ModelDecorationOptions.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),diffAddDecorationEmpty=ModelDecorationOptions.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),diffDeleteDecoration=ModelDecorationOptions.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),diffWholeLineDeleteDecoration=ModelDecorationOptions.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),diffDeleteDecorationEmpty=ModelDecorationOptions.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var __decorate$1Q=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1Q=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},WorkerBasedDocumentDiffProvider_1;const IDiffProviderFactoryService=createDecorator("diffProviderFactoryService");let WorkerBasedDiffProviderFactoryService=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(WorkerBasedDocumentDiffProvider,e)}};WorkerBasedDiffProviderFactoryService=__decorate$1Q([__param$1Q(0,IInstantiationService)],WorkerBasedDiffProviderFactoryService);registerSingleton(IDiffProviderFactoryService,WorkerBasedDiffProviderFactoryService,1);var Ll;let WorkerBasedDocumentDiffProvider=(Ll=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new Emitter$1,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)==null||e.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new DetailedLineRangeMapping(new LineRange$1(1,2),new LineRange$1(1,t.getLineCount()+1),[new RangeMapping(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=WorkerBasedDocumentDiffProvider_1.diffCache.get(r);if(a&&a.context===o)return a.result;const l=StopWatch.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:(c==null?void 0:c.quitEarly)??!0,detectedMoves:i.computeMoves?(c==null?void 0:c.moves.length)??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return WorkerBasedDocumentDiffProvider_1.diffCache.size>10&&WorkerBasedDocumentDiffProvider_1.diffCache.delete(WorkerBasedDocumentDiffProvider_1.diffCache.keys().next().value),WorkerBasedDocumentDiffProvider_1.diffCache.set(r,{result:c,context:o}),c}setOptions(e){var i;let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((i=this.diffAlgorithmOnDidChangeSubscription)==null||i.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},WorkerBasedDocumentDiffProvider_1=Ll,Ll.diffCache=new Map,Ll);WorkerBasedDocumentDiffProvider=WorkerBasedDocumentDiffProvider_1=__decorate$1Q([__param$1Q(1,IEditorWorkerService),__param$1Q(2,ITelemetryService)],WorkerBasedDocumentDiffProvider);function isHotReloadEnabled(){return env$1&&!!env$1.VSCODE_DEV}function registerHotReloadHandler(n){if(isHotReloadEnabled()){const e=registerGlobalHotReloadHandler();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function registerGlobalHotReloadHandler(){hotReloadHandlers||(hotReloadHandlers=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{const t={config:{mode:void 0},...e},i=[];for(const s of hotReloadHandlers){const r=s(t);r&&i.push(r)}if(i.length>0)return s=>{let r=!1;for(const o of i)o(s)&&(r=!0);return r}}),hotReloadHandlers}let hotReloadHandlers;isHotReloadEnabled()&®isterHotReloadHandler(({oldExports:n,newSrc:e,config:t})=>{if(t.mode==="patch-prototype")return i=>{var s,r;for(const o in i){const a=i[o];if(console.log(`[hot-reload] Patching prototype methods of '${o}'`,{exportedItem:a}),typeof a=="function"&&a.prototype){const l=n[o];if(l){for(const c of Object.getOwnPropertyNames(a.prototype)){const d=Object.getOwnPropertyDescriptor(a.prototype,c),u=Object.getOwnPropertyDescriptor(l.prototype,c);((s=d==null?void 0:d.value)==null?void 0:s.toString())!==((r=u==null?void 0:u.value)==null?void 0:r.toString())&&console.log(`[hot-reload] Patching prototype method '${o}.${c}'`),Object.defineProperty(l.prototype,c,d)}i[o]=l}}}return!0}});function readHotReloadableExport(n,e){return observeHotReloadableExports([n],e),n}function observeHotReloadableExports(n,e){isHotReloadEnabled()&&observableSignalFromEvent("reload",i=>registerHotReloadHandler(({oldExports:s})=>{if([...Object.values(s)].some(r=>n.includes(r)))return r=>(i(void 0),!0)})).read(e)}var __decorate$1P=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1P=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorViewModel=class extends Disposable{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=observableValue(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=observableValue(this,void 0),this.diff=this._diff,this._unchangedRegions=observableValue(this,void 0),this.unchangedRegions=derived(this,a=>{var l;return this._options.hideUnchangedRegions.read(a)?((l=this._unchangedRegions.read(a))==null?void 0:l.regions)??[]:(transaction(c=>{var d;for(const u of((d=this._unchangedRegions.get())==null?void 0:d.regions)||[])u.collapseAll(c)}),[])}),this.movedTextToCompare=observableValue(this,void 0),this._activeMovedText=observableValue(this,void 0),this._hoveredMovedText=observableValue(this,void 0),this.activeMovedText=derived(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new CancellationTokenSource$1,this._diffProvider=derived(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=observableSignalFromEvent("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(toDisposable(()=>this._cancellationTokenSource.cancel()));const s=observableSignal("contentChangedSignal"),r=this._register(new RunOnceScheduler(()=>s.trigger(void 0),200));this._register(autorun(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(m=>m.isDragged.read(a)))return;const c=l.originalDecorationIds.map(m=>e.original.getDecorationRange(m)).map(m=>m?LineRange$1.fromRangeInclusive(m):void 0),d=l.modifiedDecorationIds.map(m=>e.modified.getDecorationRange(m)).map(m=>m?LineRange$1.fromRangeInclusive(m):void 0),u=l.regions.map((m,_)=>!c[_]||!d[_]?void 0:new UnchangedRegion(c[_].startLineNumber,d[_].startLineNumber,c[_].length,m.visibleLineCountTop.read(a),m.visibleLineCountBottom.read(a))).filter(isDefined),f=[];let g=!1;for(const m of groupAdjacentBy(u,(_,v)=>_.getHiddenModifiedRange(a).endLineNumberExclusive===v.getHiddenModifiedRange(a).startLineNumber))if(m.length>1){g=!0;const _=m.reduce((C,S)=>C+S.lineCount,0),v=new UnchangedRegion(m[0].originalLineNumber,m[0].modifiedLineNumber,_,m[0].visibleLineCountTop.get(),m[m.length-1].visibleLineCountBottom.get());f.push(v)}else f.push(m[0]);if(g){const m=e.original.deltaDecorations(l.originalDecorationIds,f.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(l.modifiedDecorationIds,f.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));transaction(v=>{this._unchangedRegions.set({regions:f,originalDecorationIds:m,modifiedDecorationIds:_},v)})}}));const o=(a,l,c)=>{const d=UnchangedRegion.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let u;const f=this._unchangedRegions.get();if(f){const v=f.originalDecorationIds.map(L=>e.original.getDecorationRange(L)).map(L=>L?LineRange$1.fromRangeInclusive(L):void 0),C=f.modifiedDecorationIds.map(L=>e.modified.getDecorationRange(L)).map(L=>L?LineRange$1.fromRangeInclusive(L):void 0);let w=filterWithPrevious(f.regions.map((L,I)=>{if(!v[I]||!C[I])return;const N=v[I].length;return new UnchangedRegion(v[I].startLineNumber,C[I].startLineNumber,N,Math.min(L.visibleLineCountTop.get(),N),Math.min(L.visibleLineCountBottom.get(),N-L.visibleLineCountTop.get()))}).filter(isDefined),(L,I)=>!I||L.modifiedLineNumber>=I.modifiedLineNumber+I.lineCount&&L.originalLineNumber>=I.originalLineNumber+I.lineCount).map(L=>new LineRangeMapping(L.getHiddenOriginalRange(c),L.getHiddenModifiedRange(c)));w=LineRangeMapping.clip(w,LineRange$1.ofLength(1,e.original.getLineCount()),LineRange$1.ofLength(1,e.modified.getLineCount())),u=LineRangeMapping.inverse(w,e.original.getLineCount(),e.modified.getLineCount())}const g=[];if(u)for(const v of d){const C=u.filter(S=>S.original.intersectsStrict(v.originalUnchangedRange)&&S.modified.intersectsStrict(v.modifiedUnchangedRange));g.push(...v.setVisibleRanges(C,l))}else g.push(...d);const m=e.original.deltaDecorations((f==null?void 0:f.originalDecorationIds)||[],g.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations((f==null?void 0:f.modifiedDecorationIds)||[],g.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:g,originalDecorationIds:m,modifiedDecorationIds:_},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=TextEditInfo.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=TextEditInfo.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(autorunWithStore(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),r.cancel(),s.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),readHotReloadableExport(DefaultLinesDiffComputer,a),readHotReloadableExport(optimizeSequenceDiffs,a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(g=>{const m=TextEditInfo.fromModelContentChanges(g.changes);d=combineTextEditInfos(d,m)}));let u=[];l.add(e.modified.onDidChangeContent(g=>{const m=TextEditInfo.fromModelContentChanges(g.changes);u=combineTextEditInfos(u,m)}));let f=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(f=normalizeDocumentDiff(f,e.original,e.modified),f=(e.original,e.modified,void 0)??f,f=(e.original,e.modified,void 0)??f,transaction(g=>{o(f,g),this._lastDiff=f;const m=DiffState.fromDiffResult(f);this._diff.set(m,g),this._isDiffUpToDate.set(!0,g);const _=this.movedTextToCompare.get();this.movedTextToCompare.set(_?this._lastDiff.moves.find(v=>v.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)):void 0,g)}))}))}ensureModifiedLineIsVisible(e,t,i){var r,o;if(((r=this.diff.get())==null?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())==null?void 0:o.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var r,o;if(((r=this.diff.get())==null?void 0:r.mappings.length)===0)return;const s=((o=this._unchangedRegions.get())==null?void 0:o.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await waitForState(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var s;const t=(s=e.collapsedRegions)==null?void 0:s.map(r=>LineRange$1.deserialize(r.range)),i=this._unchangedRegions.get();!i||!t||transaction(r=>{for(const o of i.regions)for(const a of t)if(o.modifiedUnchangedRange.intersect(a)){o.setHiddenModifiedRange(a,r);break}})}};DiffEditorViewModel=__decorate$1P([__param$1P(2,IDiffProviderFactoryService)],DiffEditorViewModel);function normalizeDocumentDiff(n,e,t){return{changes:n.changes.map(i=>new DetailedLineRangeMapping(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>normalizeRangeMapping(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function normalizeRangeMapping(n,e,t){let i=n.originalRange,s=n.modifiedRange;return i.startColumn===1&&s.startColumn===1&&(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew DiffMapping(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class DiffMapping{constructor(e){this.lineRangeMapping=e}}class UnchangedRegion{static fromDiffs(e,t,i,s,r){const o=DetailedLineRangeMapping.inverse(e,t,i),a=[];for(const l of o){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const f=c===1&&d===1,g=c+u===t+1&&d+u===i+1;(f||g)&&u>=r+s?(f&&!g&&(u-=r),g&&!f&&(c+=r,d+=r,u-=r),a.push(new UnchangedRegion(c,d,u,0,0))):u>=r*2+s&&(c+=r,d+=r,u-=r*2,a.push(new UnchangedRegion(c,d,u,0,0)))}return a}get originalUnchangedRange(){return LineRange$1.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return LineRange$1.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=observableValue(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=observableValue(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=derived(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=observableValue(this,void 0);const o=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(r,this.lineCount-s),0);softAssert(s===o),softAssert(r===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new LineRangeSet(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let r=this.originalLineNumber,o=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of s.ranges){const d=l===s.ranges.length-1;l++;const u=(d?a:c.endLineNumberExclusive)-o,f=new UnchangedRegion(r,o,u,0,0);f.setHiddenModifiedRange(c,t),i.push(f),r=f.originalUnchangedRange.endLineNumberExclusive,o=f.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return LineRange$1.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return LineRange$1.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&s{this._contextMenuService.showContextMenu({domForShadowRoot:f?i.getDomNode()??void 0:void 0,getAnchor:()=>({x:m,y:_}),getActions:()=>{const v=[],C=s.modified.isEmpty;return v.push(new Action("diff.clipboard.copyDeletedContent",C?s.original.length>1?localize("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):localize("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?localize("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):localize("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,async()=>{const w=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(w)})),s.original.length>1&&v.push(new Action("diff.clipboard.copyDeletedLineContent",C?localize("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+u):localize("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,async()=>{let w=this._originalTextModel.getLineContent(s.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` +`:`\r +`),await this._clipboardService.writeText(w)})),i.getOption(92)||v.push(new Action("diff.inline.revertChange",localize("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(addStandardDisposableListener(this._diffActions,"mousedown",m=>{if(!m.leftButton)return;const{top:_,height:v}=getDomNodePagePosition(this._diffActions),C=Math.floor(d/3);m.preventDefault(),g(m.posx,_+v+C)})),this._register(i.onMouseMove(m=>{(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(m=>{m.event.leftButton&&(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._getViewZoneId()&&(m.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,d),g(m.event.posx,m.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=getDomNodePagePosition(e),r=t-s,o=Math.floor(r/i),a=o*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function renderLines$1(n,e,t,i){applyFontInfo(i,e.fontInfo);const s=t.length>0,r=new StringBuilder(1e4);let o=0,a=0;const l=[];for(let f=0;f');const l=e.getLineContent(),c=ViewLineRenderingData.isBasicASCII(l,s),d=ViewLineRenderingData.containsRTL(l,c,r),u=renderViewLine(new RenderLineInput(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==EditorFontLigatures.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var __decorate$1O=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1O=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorViewZones=class extends Disposable{constructor(e,t,i,s,r,o,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=observableValue(this,0),this._originalScrollOffset=observableValue(this,0),this._originalScrollOffsetAnimated=animatedObservable(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=observableValue(this,0),this._modifiedScrollOffset=observableValue(this,0),this._modifiedScrollOffsetAnimated=animatedObservable(this._targetWindow,this._modifiedScrollOffset,this._store);const u=observableValue("invalidateAlignmentsState",0),f=this._register(new RunOnceScheduler(()=>{u.set(u.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||f.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(147)||w.hasChanged(67))&&f.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(147)||w.hasChanged(67))&&f.schedule()}));const g=this._diffModel.map(w=>w?observableFromEvent(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,L)=>w==null?void 0:w.read(L)),m=derived(w=>{const L=this._diffModel.read(w),I=L==null?void 0:L.diff.read(w);if(!L||!I)return null;u.read(w);const R=this._options.renderSideBySide.read(w);return computeRangeAlignment(this._editors.original,this._editors.modified,I.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,R)}),_=derived(w=>{var N;const L=(N=this._diffModel.read(w))==null?void 0:N.movedTextToCompare.read(w);if(!L)return null;u.read(w);const I=L.changes.map(R=>new DiffMapping(R));return computeRangeAlignment(this._editors.original,this._editors.modified,I,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function v(){const w=document.createElement("div");return w.className="diagonal-fill",w}const C=this._register(new DisposableStore);this.viewZones=derivedWithStore(this,(w,L)=>{var Q,ce,ie,Ce;C.clear();const I=m.read(w)||[],N=[],R=[],T=this._modifiedTopPadding.read(w);T>0&&R.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:T,showInHiddenAreas:!0,suppressMouseDown:!0});const A=this._originalTopPadding.read(w);A>0&&N.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:A,showInHiddenAreas:!0,suppressMouseDown:!0});const F=this._options.renderSideBySide.read(w),B=F||(Q=this._editors.modified._getViewModel())==null?void 0:Q.createLineBreaksComputer();if(B){const ae=this._editors.original.getModel();for(const be of I)if(be.diff)for(let De=be.originalRange.startLineNumber;Deae.getLineCount())return{orig:N,mod:R};B==null||B.addRequest(ae.getLineContent(De),null,null)}}const W=(B==null?void 0:B.finalize())??[];let G=0;const j=this._editors.modified.getOption(67),K=(ce=this._diffModel.read(w))==null?void 0:ce.movedTextToCompare.read(w),ee=((ie=this._editors.original.getModel())==null?void 0:ie.mightContainNonBasicASCII())??!1,U=((Ce=this._editors.original.getModel())==null?void 0:Ce.mightContainRTL())??!1,q=RenderOptions.fromEditor(this._editors.modified);for(const ae of I)if(ae.diff&&!F&&(!this._options.useTrueInlineDiffRendering.read(w)||!allowsTrueInlineDiffRendering(ae.diff))){if(!ae.originalRange.isEmpty){g.read(w);const De=document.createElement("div");De.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Te=this._editors.original.getModel();if(ae.originalRange.endLineNumberExclusive-1>Te.getLineCount())return{orig:N,mod:R};const xe=new LineSource(ae.originalRange.mapToLineArray(je=>Te.tokenization.getLineTokens(je)),ae.originalRange.mapToLineArray(je=>W[G++]),ee,U),ze=[];for(const je of ae.diff.innerChanges||[])ze.push(new InlineDecoration(je.originalRange.delta(-(ae.diff.original.startLineNumber-1)),diffDeleteDecoration.className,0));const Qe=renderLines$1(xe,q,ze,De),qe=document.createElement("div");if(qe.className="inline-deleted-margin-view-zone",applyFontInfo(qe,q.fontInfo),this._options.renderIndicators.read(w))for(let je=0;jeassertIsDefined(Le),qe,this._editors.modified,ae.diff,this._diffEditorWidget,Qe.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let je=0;je1&&N.push({afterLineNumber:ae.originalRange.startLineNumber+je,domNode:v(),heightInPx:(le-1)*j,showInHiddenAreas:!0,suppressMouseDown:!0})}R.push({afterLineNumber:ae.modifiedRange.startLineNumber-1,domNode:De,heightInPx:Qe.heightInLines*j,minWidthInPx:Qe.minWidthInPx,marginDomNode:qe,setZoneId(je){Le=je},showInHiddenAreas:!0,suppressMouseDown:!0})}const be=document.createElement("div");be.className="gutter-delete",N.push({afterLineNumber:ae.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:ae.modifiedHeightInPx,marginDomNode:be,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const be=ae.modifiedHeightInPx-ae.originalHeightInPx;if(be>0){if(K!=null&&K.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ae.originalRange.endLineNumberExclusive-1))continue;N.push({afterLineNumber:ae.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let De=function(){const xe=document.createElement("div");return xe.className="arrow-revert-change "+ThemeIcon.asClassName(Codicon.arrowRight),L.add(addDisposableListener(xe,"mousedown",ze=>ze.stopPropagation())),L.add(addDisposableListener(xe,"click",ze=>{ze.stopPropagation(),r.revert(ae.diff)})),$$e("div",{},xe)};if(K!=null&&K.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ae.modifiedRange.endLineNumberExclusive-1))continue;let Te;ae.diff&&ae.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(Te=De()),R.push({afterLineNumber:ae.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-be,marginDomNode:Te,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ae of _.read(w)??[]){if(!(K!=null&&K.lineRangeMapping.original.intersect(ae.originalRange))||!(K!=null&&K.lineRangeMapping.modified.intersect(ae.modifiedRange)))continue;const be=ae.modifiedHeightInPx-ae.originalHeightInPx;be>0?N.push({afterLineNumber:ae.originalRange.endLineNumberExclusive-1,domNode:v(),heightInPx:be,showInHiddenAreas:!0,suppressMouseDown:!0}):R.push({afterLineNumber:ae.modifiedRange.endLineNumberExclusive-1,domNode:v(),heightInPx:-be,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:N,mod:R}});let S=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!S&&(S=!0,this._editors.modified.setScrollLeft(w.scrollLeft),S=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!S&&(S=!0,this._editors.original.setScrollLeft(w.scrollLeft),S=!1)})),this._originalScrollTop=observableFromEvent(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=observableFromEvent(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(autorun(w=>{const L=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));L!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(L,1)})),this._register(autorun(w=>{const L=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));L!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(L,1)})),this._register(autorun(w=>{var N;const L=(N=this._diffModel.read(w))==null?void 0:N.movedTextToCompare.read(w);let I=0;if(L){const R=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();I=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-R}I>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(I,void 0)):I<0?(this._modifiedTopPadding.set(-I,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-I,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+I,void 0,!0)}))}};DiffEditorViewZones=__decorate$1O([__param$1O(8,IClipboardService),__param$1O(9,IContextMenuService)],DiffEditorViewZones);function computeRangeAlignment(n,e,t,i,s,r){const o=new ArrayQueue(getAdditionalLineHeights(n,i)),a=new ArrayQueue(getAdditionalLineHeights(e,s)),l=n.getOption(67),c=e.getOption(67),d=[];let u=0,f=0;function g(m,_){for(;;){let v=o.peek(),C=a.peek();if(v&&v.lineNumber>=m&&(v=void 0),C&&C.lineNumber>=_&&(C=void 0),!v&&!C)break;const S=v?v.lineNumber-u:Number.MAX_VALUE,w=C?C.lineNumber-f:Number.MAX_VALUE;Sw?(a.dequeue(),v={lineNumber:C.lineNumber-f+u,heightInPx:0}):(o.dequeue(),a.dequeue()),d.push({originalRange:LineRange$1.ofLength(v.lineNumber,1),modifiedRange:LineRange$1.ofLength(C.lineNumber,1),originalHeightInPx:l+v.heightInPx,modifiedHeightInPx:c+C.heightInPx,diff:void 0})}}for(const m of t){let w=function(L,I,N=!1){var B,W;if(LG.lineNumberG+j.heightInPx,0))??0,F=((W=a.takeWhile(G=>G.lineNumberG+j.heightInPx,0))??0;d.push({originalRange:R,modifiedRange:T,originalHeightInPx:R.length*l+A,modifiedHeightInPx:T.length*c+F,diff:m.lineRangeMapping}),S=L,C=I};const _=m.lineRangeMapping;g(_.original.startLineNumber,_.modified.startLineNumber);let v=!0,C=_.modified.startLineNumber,S=_.original.startLineNumber;if(r)for(const L of _.innerChanges||[]){L.originalRange.startColumn>1&&L.modifiedRange.startColumn>1&&w(L.originalRange.startLineNumber,L.modifiedRange.startLineNumber);const I=n.getModel(),N=L.originalRange.endLineNumber<=I.getLineCount()?I.getLineMaxColumn(L.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;L.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:o*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new Position$1(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return joinCombine(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function allowsTrueInlineDiffRendering(n){return n.innerChanges?n.innerChanges.every(e=>rangeIsSingleLine(e.modifiedRange)&&rangeIsSingleLine(e.originalRange)||e.originalRange.equalsRange(new Range$2(1,1,1,1))):!1}function rangeIsSingleLine(n){return n.startLineNumber===n.endLineNumber}const nu=class nu extends Disposable{constructor(e,t,i,s,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=r,this._originalScrollTop=observableFromEvent(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=observableFromEvent(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=observableSignalFromEvent("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=observableValue(this,0),this._modifiedViewZonesChangedSignal=observableSignalFromEvent("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=observableSignalFromEvent("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=derivedWithStore(this,(d,u)=>{var R;this._element.replaceChildren();const f=this._diffModel.read(d),g=(R=f==null?void 0:f.diff.read(d))==null?void 0:R.movedTexts;if(!g||g.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const m=this._originalEditorLayoutInfo.read(d),_=this._modifiedEditorLayoutInfo.read(d);if(!m||!_){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const v=g.map(T=>{function A(q,Q){const ce=Q.getTopForLineNumber(q.startLineNumber,!0),ie=Q.getTopForLineNumber(q.endLineNumberExclusive,!0);return(ce+ie)/2}const F=A(T.lineRangeMapping.original,this._editors.original),B=this._originalScrollTop.read(d),W=A(T.lineRangeMapping.modified,this._editors.modified),G=this._modifiedScrollTop.read(d),j=F-B,K=W-G,ee=Math.min(F,W),U=Math.max(F,W);return{range:new OffsetRange(ee,U),from:j,to:K,fromWithoutScroll:F,toWithoutScroll:W,move:T}});v.sort(tieBreakComparators(compareBy(T=>T.fromWithoutScroll>T.toWithoutScroll,booleanComparator),compareBy(T=>T.fromWithoutScroll>T.toWithoutScroll?T.fromWithoutScroll:-T.toWithoutScroll,numberComparator)));const C=LinesLayout.compute(v.map(T=>T.range)),S=10,w=m.verticalScrollbarWidth,L=(C.getTrackCount()-1)*10+S*2,I=w+L+(_.contentLeft-nu.movedCodeBlockPadding);let N=0;for(const T of v){const A=C.getTrack(N),F=w+S+A*10,B=15,W=15,G=I,j=_.glyphMarginWidth+_.lineNumbersWidth,K=18,ee=document.createElementNS("http://www.w3.org/2000/svg","rect");ee.classList.add("arrow-rectangle"),ee.setAttribute("x",`${G-j}`),ee.setAttribute("y",`${T.to-K/2}`),ee.setAttribute("width",`${j}`),ee.setAttribute("height",`${K}`),this._element.appendChild(ee);const U=document.createElementNS("http://www.w3.org/2000/svg","g"),q=document.createElementNS("http://www.w3.org/2000/svg","path");q.setAttribute("d",`M 0 ${T.from} L ${F} ${T.from} L ${F} ${T.to} L ${G-W} ${T.to}`),q.setAttribute("fill","none"),U.appendChild(q);const Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");Q.classList.add("arrow"),u.add(autorun(ce=>{q.classList.toggle("currentMove",T.move===f.activeMovedText.read(ce)),Q.classList.toggle("currentMove",T.move===f.activeMovedText.read(ce))})),Q.setAttribute("points",`${G-W},${T.to-B/2} ${G},${T.to} ${G-W},${T.to+B/2}`),U.appendChild(Q),this._element.appendChild(U),N++}this.width.set(L,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(toDisposable(()=>this._element.remove())),this._register(autorun(d=>{const u=this._originalEditorLayoutInfo.read(d),f=this._modifiedEditorLayoutInfo.read(d);!u||!f||(this._element.style.left=`${u.width-u.verticalScrollbarWidth}px`,this._element.style.height=`${u.height}px`,this._element.style.width=`${u.verticalScrollbarWidth+u.contentLeft-nu.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(recomputeInitiallyAndOnChange(this._state));const o=derived(d=>{const u=this._diffModel.read(d),f=u==null?void 0:u.diff.read(d);return f?f.movedTexts.map(g=>({move:g,original:new PlaceholderViewZone(constObservable(g.lineRangeMapping.original.startLineNumber-1),18),modified:new PlaceholderViewZone(constObservable(g.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(applyViewZones(this._editors.original,o.map(d=>d.map(u=>u.original)))),this._register(applyViewZones(this._editors.modified,o.map(d=>d.map(u=>u.modified)))),this._register(autorunWithStore((d,u)=>{const f=o.read(d);for(const g of f)u.add(new MovedBlockOverlayWidget(this._editors.original,g.original,g.move,"original",this._diffModel.get())),u.add(new MovedBlockOverlayWidget(this._editors.modified,g.modified,g.move,"modified",this._diffModel.get()))}));const a=observableSignalFromEvent("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=observableSignalFromEvent("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(autorunHandleChanges({createEmptyChangeSummary:()=>{},handleChange:(d,u)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)},d=>{a.read(d),l.read(d);const u=this._diffModel.read(d);if(!u)return;const f=u.diff.read(d);let g;if(f&&c==="original"){const m=this._editors.originalCursor.read(d);m&&(g=f.movedTexts.find(_=>_.lineRangeMapping.original.contains(m.lineNumber)))}if(f&&c==="modified"){const m=this._editors.modifiedCursor.read(d);m&&(g=f.movedTexts.find(_=>_.lineRangeMapping.modified.contains(m.lineNumber)))}g!==u.movedTextToCompare.get()&&u.movedTextToCompare.set(void 0,void 0),u.setActiveMovedText(g)}))}};nu.movedCodeBlockPadding=4;let MovedBlocksLinesFeature=nu;class LinesLayout{static compute(e){const t=[],i=[];for(const s of e){let r=t.findIndex(o=>!o.intersectsStrict(s));r===-1&&(t.length>=6?r=findMaxIdx(t,compareBy(a=>a.intersectWithRangeLength(s),numberComparator)):(r=t.length,t.push(new OffsetRangeSet))),t[r].addRange(s),i.push(r)}return new LinesLayout(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class MovedBlockOverlayWidget extends ViewZoneOverlayWidget{constructor(e,t,i,s,r){const o=h("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=r,this._nodes=h("div.diff-moved-code-block",{style:{marginRight:"4px"}},[h("div.text-content@textContent"),h("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const a=observableFromEvent(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(applyStyle(this._nodes.root,{paddingRight:a.map(f=>f.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?localize("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):localize("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?localize("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):localize("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new ActionBar(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Action("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new Action("","Compare",ThemeIcon.asClassName(Codicon.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(autorun(f=>{const g=this._diffModel.movedTextToCompare.read(f)===i;u.checked=g})),c.push(u,{icon:!1,label:!0})}}class DiffEditorDecorations extends Disposable{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=derived(this,r=>{const o=this._diffModel.read(r),a=o==null?void 0:o.diff.read(r);if(!a)return null;const l=this._diffModel.read(r).movedTextToCompare.read(r),c=this._options.renderIndicators.read(r),d=this._options.showEmptyDecorations.read(r),u=[],f=[];if(!l)for(const m of a.mappings)if(m.lineRangeMapping.original.isEmpty||u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:c?diffLineDeleteDecorationBackgroundWithIndicator:diffLineDeleteDecorationBackground}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:c?diffLineAddDecorationBackgroundWithIndicator:diffLineAddDecorationBackground}),m.lineRangeMapping.modified.isEmpty||m.lineRangeMapping.original.isEmpty)m.lineRangeMapping.original.isEmpty||u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:diffWholeLineDeleteDecoration}),m.lineRangeMapping.modified.isEmpty||f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:diffWholeLineAddDecoration});else{const _=this._options.useTrueInlineDiffRendering.read(r)&&allowsTrueInlineDiffRendering(m.lineRangeMapping);for(const v of m.lineRangeMapping.innerChanges||[])if(m.lineRangeMapping.original.contains(v.originalRange.startLineNumber)&&u.push({range:v.originalRange,options:v.originalRange.isEmpty()&&d?diffDeleteDecorationEmpty:diffDeleteDecoration}),m.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber)&&f.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()&&d&&!_?diffAddDecorationEmpty:diffAddDecoration}),_){const C=o.model.original.getValueInRange(v.originalRange);f.push({range:v.modifiedRange,options:{description:"deleted-text",before:{content:C,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const m of l.changes){const _=m.original.toInclusiveRange();_&&u.push({range:_,options:c?diffLineDeleteDecorationBackgroundWithIndicator:diffLineDeleteDecorationBackground});const v=m.modified.toInclusiveRange();v&&f.push({range:v,options:c?diffLineAddDecorationBackgroundWithIndicator:diffLineAddDecorationBackground});for(const C of m.innerChanges||[])u.push({range:C.originalRange,options:diffDeleteDecoration}),f.push({range:C.modifiedRange,options:diffAddDecoration})}const g=this._diffModel.read(r).activeMovedText.read(r);for(const m of a.movedTexts)u.push({range:m.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(m===g?" currentMove":""),blockPadding:[MovedBlocksLinesFeature.movedCodeBlockPadding,0,MovedBlocksLinesFeature.movedCodeBlockPadding,MovedBlocksLinesFeature.movedCodeBlockPadding]}}),f.push({range:m.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(m===g?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:f}}),this._register(applyObservableDecorations$1(this._editors.original,this._decorations.map(r=>(r==null?void 0:r.originalDecorations)||[]))),this._register(applyObservableDecorations$1(this._editors.modified,this._decorations.map(r=>(r==null?void 0:r.modifiedDecorations)||[])))}}class SashLayout{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=derivedWithSetter(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const r=this.dimensions.width.get();this._sashRatio.set(i/r,s)}),this._sashRatio=observableValue(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,o=100;return i<=o*2?s:ri-o?i-o:r}}class DiffEditorSash extends Disposable{constructor(e,t,i,s,r,o){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=r,this._resetSash=o,this._sash=this._register(new Sash(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(autorun(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(autorun(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}class EditorGutter extends Disposable{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=observableFromEvent(this,this._editor.onDidScrollChange,o=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(o=>o===0),this.modelAttached=observableFromEvent(this,this._editor.onDidChangeModel,o=>this._editor.hasModel()),this.editorOnDidChangeViewZones=observableSignalFromEvent("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=observableSignalFromEvent("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=observableSignal("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(h("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),r=new ResizeObserver(()=>{transaction(o=>{this.domNodeSizeChanged.trigger(o)})});r.observe(this._domNode),this._register(toDisposable(()=>r.disconnect())),this._register(autorun(o=>{s.className=this.isScrollTopZero.read(o)?"":"scroll-decoration"})),this._register(autorun(o=>this.render(o)))}dispose(){super.dispose(),reset$1(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),r=OffsetRange.ofStartAndLength(0,this._domNode.clientHeight);if(!r.isEmpty)for(const o of i){const a=new LineRange$1(o.startLineNumber,o.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);transaction(c=>{for(const d of l){if(!d.range.intersect(a))continue;s.delete(d.id);let u=this.views.get(d.id);if(u)u.item.set(d,c);else{const _=document.createElement("div");this._domNode.appendChild(_);const v=observableValue("item",d),C=this.itemProvider.createView(v,_);u=new ManagedGutterItemView(v,C,_),this.views.set(d.id,u)}const f=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t,m=(d.range.endLineNumberExclusive===1?Math.max(f,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(f,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-f;u.domNode.style.top=`${f}px`,u.domNode.style.height=`${m}px`,u.gutterItemView.layout(OffsetRange.ofStartAndLength(f,m),r)}})}for(const o of s){const a=this.views.get(o);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(o)}}}class ManagedGutterItemView{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}class ActionRunnerWithContext extends ActionRunner{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class TextModelText extends AbstractText{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new TextLength(e-1,t)}}const toolbar="";class ToolBar extends Disposable{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new EventMultiplexer),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new DisposableStore),i.hoverDelegate=i.hoverDelegate??this._register(createInstantHoverDelegate()),this.options=i,this.toggleMenuAction=this._register(new ToggleMenuAction(()=>{var s;return(s=this.toggleMenuActionViewItem)==null?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new ActionBar(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,r)=>{if(s.id===ToggleMenuAction.ID)return this.toggleMenuActionViewItem=new DropdownMenuActionViewItem(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ThemeIcon.asClassNameArray(i.moreIcon??Codicon.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const o=i.actionViewItemProvider(s,r);if(o)return o}if(s instanceof SubmenuAction){const o=new DropdownMenuActionViewItem(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return o.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(o),this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)),o}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var i,s;const t=(s=(i=this.options).getKeyBinding)==null?void 0:s.call(i,e);return(t==null?void 0:t.getLabel())??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const hg=class hg extends Action{constructor(e,t){t=t||localize("moreActions","More Actions..."),super(hg.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};hg.ID="toolbar.toggle.more";let ToggleMenuAction=hg;var __decorate$1N=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1N=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let WorkbenchToolBar=class extends ToolBar{constructor(e,t,i,s,r,o,a,l){super(e,r,{getKeyBinding:d=>o.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=r,this._keybindingService=o,this._commandService=a,this._sessionDisposables=this._store.add(new DisposableStore);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var d,u,f;this._sessionDisposables.clear();const s=e.slice(),r=t.slice(),o=[];let a=0;const l=[];let c=!1;if(((d=this._options)==null?void 0:d.hiddenItemStrategy)!==-1)for(let g=0;gv==null?void 0:v.id)),m=this._options.overflowBehavior.maxItems-g.size;let _=0;for(let v=0;v=m&&(s[v]=void 0,l[v]=C))}}coalesceInPlace(s),coalesceInPlace(l),super.setActions(s,Separator.join(l,r)),(o.length>0||s.length>0)&&this._sessionDisposables.add(addDisposableListener(this.getElement(),"contextmenu",g=>{var S,w,L,I,N;const m=new StandardMouseEvent(getWindow(this.getElement()),g),_=this.getItemAction(m.target);if(!_)return;m.preventDefault(),m.stopPropagation();const v=[];if(_ instanceof MenuItemAction&&_.menuKeybinding)v.push(_.menuKeybinding);else if(!(_ instanceof SubmenuItemAction||_ instanceof ToggleMenuAction)){const R=!!this._keybindingService.lookupKeybinding(_.id);v.push(createConfigureKeybindingAction(this._commandService,this._keybindingService,_.id,void 0,R))}if(o.length>0){let R=!1;if(a===1&&((S=this._options)==null?void 0:S.hiddenItemStrategy)===0){R=!0;for(let T=0;Tthis._menuService.resetHiddenStates(i)}))),C.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>m,getActions:()=>C,menuId:(L=this._options)==null?void 0:L.contextMenu,menuActionOptions:{renderShortTitle:!0,...(I=this._options)==null?void 0:I.menuOptions},skipTelemetry:typeof((N=this._options)==null?void 0:N.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};WorkbenchToolBar=__decorate$1N([__param$1N(2,IMenuService),__param$1N(3,IContextKeyService),__param$1N(4,IContextMenuService),__param$1N(5,IKeybindingService),__param$1N(6,ICommandService),__param$1N(7,ITelemetryService)],WorkbenchToolBar);let MenuWorkbenchToolBar=class extends WorkbenchToolBar{constructor(e,t,i,s,r,o,a,l,c){super(e,{resetMenu:t,...i},s,r,o,a,l,c),this._onDidChangeMenuItems=this._store.add(new Emitter$1),this.onDidChangeMenuItems=this._onDidChangeMenuItems.event;const d=this._store.add(s.createMenu(t,r,{emitEventsForSubmenuChanges:!0})),u=()=>{var m,_,v;const f=[],g=[];createAndFillInActionBarActions(d,i==null?void 0:i.menuOptions,{primary:f,secondary:g},(m=i==null?void 0:i.toolbarOptions)==null?void 0:m.primaryGroup,(_=i==null?void 0:i.toolbarOptions)==null?void 0:_.shouldInlineSubmenu,(v=i==null?void 0:i.toolbarOptions)==null?void 0:v.useSeparatorsInPrimaryActions),e.classList.toggle("has-no-actions",f.length===0&&g.length===0),super.setActions(f,g)};this._store.add(d.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),u()}setActions(){throw new BugIndicatingError("This toolbar is populated from a menu.")}};MenuWorkbenchToolBar=__decorate$1N([__param$1N(3,IMenuService),__param$1N(4,IContextKeyService),__param$1N(5,IContextMenuService),__param$1N(6,IKeybindingService),__param$1N(7,ICommandService),__param$1N(8,ITelemetryService)],MenuWorkbenchToolBar);var __decorate$1M=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1M=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const emptyArr$1=[],width=35;let DiffEditorGutter=class extends Disposable{constructor(e,t,i,s,r,o,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=r,this._boundarySashes=o,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(MenuId.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=observableFromEvent(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(d=>d.length>0),this._showSash=derived(this,d=>this._options.renderSideBySide.read(d)&&this._hasActions.read(d)),this.width=derived(this,d=>this._hasActions.read(d)?width:0),this.elements=h("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:width+"px"}},[]),this._currentDiff=derived(this,d=>{var m;const u=this._diffModel.read(d);if(!u)return;const f=(m=u.diff.read(d))==null?void 0:m.mappings,g=this._editors.modifiedCursor.read(d);if(g)return f==null?void 0:f.find(_=>_.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=derived(this,d=>{const u=this._diffModel.read(d),f=u==null?void 0:u.diff.read(d);if(!f)return emptyArr$1;const g=this._editors.modifiedSelections.read(d);if(g.every(C=>C.isEmpty()))return emptyArr$1;const m=new LineRangeSet(g.map(C=>LineRange$1.fromRangeInclusive(C))),v=f.mappings.filter(C=>C.lineRangeMapping.innerChanges&&m.intersects(C.lineRangeMapping.modified)).map(C=>({mapping:C,rangeMappings:C.lineRangeMapping.innerChanges.filter(S=>g.some(w=>Range$2.areIntersecting(S.modifiedRange,w)))}));return v.length===0||v.every(C=>C.rangeMappings.length===0)?emptyArr$1:v}),this._register(prependRemoveOnDispose(e,this.elements.root)),this._register(addDisposableListener(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(applyStyle(this.elements.root,{display:this._hasActions.map(d=>d?"block":"none")})),derivedDisposable(this,d=>this._showSash.read(d)?new DiffEditorSash(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,derivedWithSetter(this,f=>this._sashLayout.sashLeft.read(f)-width,(f,g)=>this._sashLayout.sashLeft.set(f+width,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store),this._register(new EditorGutter(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(d,u)=>{const f=this._diffModel.read(u);if(!f)return[];const g=f.diff.read(u);if(!g)return[];const m=this._selectedDiffs.read(u);if(m.length>0){const v=DetailedLineRangeMapping.fromRangeMappings(m.flatMap(C=>C.rangeMappings));return[new DiffGutterItem(v,!0,MenuId.DiffEditorSelectionToolbar,void 0,f.model.original.uri,f.model.modified.uri)]}const _=this._currentDiff.read(u);return g.mappings.map(v=>new DiffGutterItem(v.lineRangeMapping.withInnerChangesFromLineRanges(),v.lineRangeMapping===(_==null?void 0:_.lineRangeMapping),MenuId.DiffEditorHunkToolbar,void 0,f.model.original.uri,f.model.modified.uri))},createView:(d,u)=>this._instantiationService.createInstance(DiffToolBar,d,u,this)})),this._register(addDisposableListener(this.elements.gutter,EventType$1.MOUSE_WHEEL,d=>{this._editors.modified.getOption(104).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(d)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new TextModelText(this._editors.modifiedModel.get()),s=new TextModelText(this._editors.original.getModel());return new TextEdit(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};DiffEditorGutter=__decorate$1M([__param$1M(6,IInstantiationService),__param$1M(7,IContextKeyService),__param$1M(8,IMenuService)],DiffEditorGutter);class DiffGutterItem{constructor(e,t,i,s,r,o){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=r,this.modifiedUri=o}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let DiffToolBar=class extends Disposable{constructor(e,t,i,s){super(),this._item=e,this._elements=h("div.gutterItem",{style:{height:"20px",width:"34px"}},[h("div.background@background",{},[]),h("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,o=>o.showAlways),this._menuId=this._item.map(this,o=>o.menuId),this._isSmall=observableValue(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const r=this._register(s.createInstance(WorkbenchHoverDelegate,"element",!0,{position:{hoverPosition:1}}));this._register(appendRemoveOnDispose(t,this._elements.root)),this._register(autorun(o=>{const a=this._showAlways.read(o);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(autorunWithStore((o,a)=>{this._elements.buttons.replaceChildren();const l=a.add(s.createInstance(MenuWorkbenchToolBar,this._elements.buttons,this._menuId.read(o),{orientation:1,hoverDelegate:r,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(o)?1:3},hiddenItemStrategy:0,actionRunner:new ActionRunnerWithContext(()=>{const c=this._item.get(),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}}),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,r=i;let o=e.start+s;const a=OffsetRange.tryCreate(r,t.endExclusive-r-i),l=OffsetRange.tryCreate(e.start+r,e.endExclusive-i-r);l&&a&&l.start{const s=oo._map.get(e);s&&(oo._map.delete(e),s.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new TransactionImpl(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){var t;super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=observableValue(this,this.editor.getModel()),this.model=this._model,this.isReadonly=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(92)),this._versionId=observableValueOpts({owner:this,lazy:!0},((t=this.editor.getModel())==null?void 0:t.getVersionId())??null),this.versionId=this._versionId,this._selections=observableValueOpts({owner:this,equalsFn:equalsIfDefined(itemsEquals(Selection$1.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.isFocused=observableFromEvent(this,i=>{const s=this.editor.onDidFocusEditorWidget(i),r=this.editor.onDidBlurEditorWidget(i);return{dispose(){s.dispose(),r.dispose()}}},()=>this.editor.hasWidgetFocus()),this.value=derivedWithSetter(this,i=>{var s;return this.versionId.read(i),((s=this.model.read(i))==null?void 0:s.getValue())??""},(i,s)=>{const r=this.model.get();r!==null&&i!==r.getValue()&&r.setValue(i)}),this.valueIsEmpty=derived(this,i=>{var s;return this.versionId.read(i),((s=this.editor.getModel())==null?void 0:s.getValueLength())===0}),this.cursorSelection=derivedOpts({owner:this,equalsFn:equalsIfDefined(Selection$1.selectionsEqual)},i=>{var s;return((s=this.selections.read(i))==null?void 0:s[0])??null}),this.onDidType=observableSignal(this),this.scrollTop=observableFromEvent(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=observableFromEvent(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=observableFromEvent(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(i=>i.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(i=>i.decorationsLeft),this.contentWidth=observableFromEvent(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this._overlayWidgetCounter=0,this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(i=>{var s;this._beginUpdate();try{this._versionId.set(((s=this.editor.getModel())==null?void 0:s.getVersionId())??null,this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(i=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}}))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var e;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(((e=this.editor.getModel())==null?void 0:e.getVersionId())??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e){return observableFromEvent(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e))}setDecorations(e){const t=new DisposableStore,i=this.editor.createDecorationsCollection();return t.add(autorunOpts({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const r=e.read(s);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._overlayWidgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const s=autorun(r=>{e.position.read(r),e.minContentWidthInPx.read(r),this.editor.layoutOverlayWidget(i)});return toDisposable(()=>{s.dispose(),this.editor.removeOverlayWidget(i)})}};oo._map=new Map;let ObservableCodeEditor=oo;function reactToChange(n,e){return autorunWithStoreHandleChanges({createEmptyChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(n)){const s=t.change;s!==void 0&&i.deltas.push(s),i.didChange=!0}return!0}},(t,i)=>{const s=n.read(t);i.didChange&&e(s,i.deltas)})}function reactToChangeWithStore(n,e){const t=new DisposableStore,i=reactToChange(n,(s,r)=>{t.clear(),e(s,r,t)});return{dispose(){i.dispose(),t.dispose()}}}var __decorate$1L=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1L=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HideUnchangedRegionsFeature_1,kl;let HideUnchangedRegionsFeature=(kl=class extends Disposable{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=s,this._modifiedOutlineSource=derivedDisposable(this,l=>{const c=this._editors.modifiedModel.read(l),d=HideUnchangedRegionsFeature_1._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();transaction(d=>{for(const u of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(u.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();transaction(d=>{for(const u of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(u.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(u.getEndPosition().lineNumber,0,d)})}));const r=this._diffModel.map((l,c)=>{var u;const d=(l==null?void 0:l.unchangedRegions.read(c))??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===((u=this._editors.modifiedModel.read(c))==null?void 0:u.getLineCount())?[]:d});this.viewZones=derivedWithStore(this,(l,c)=>{const d=this._modifiedOutlineSource.read(l);if(!d)return{origViewZones:[],modViewZones:[]};const u=[],f=[],g=this._options.renderSideBySide.read(l),m=this._options.compactMode.read(l),_=r.read(l);for(let v=0;v<_.length;v++){const C=_[v];if(!C.shouldHideControls(l)&&!(m&&(v===0||v===_.length-1)))if(m){{const S=derived(this,L=>C.getHiddenOriginalRange(L).startLineNumber-1),w=new PlaceholderViewZone(S,12);u.push(w),c.add(new CompactCollapsedCodeOverlayWidget(this._editors.original,w,C,!g))}{const S=derived(this,L=>C.getHiddenModifiedRange(L).startLineNumber-1),w=new PlaceholderViewZone(S,12);f.push(w),c.add(new CompactCollapsedCodeOverlayWidget(this._editors.modified,w,C))}}else{{const S=derived(this,L=>C.getHiddenOriginalRange(L).startLineNumber-1),w=new PlaceholderViewZone(S,24);u.push(w),c.add(new CollapsedCodeOverlayWidget(this._editors.original,w,C,C.originalUnchangedRange,!g,d,L=>this._diffModel.get().ensureModifiedLineIsVisible(L,2,void 0),this._options))}{const S=derived(this,L=>C.getHiddenModifiedRange(L).startLineNumber-1),w=new PlaceholderViewZone(S,24);f.push(w),c.add(new CollapsedCodeOverlayWidget(this._editors.modified,w,C,C.modifiedUnchangedRange,!1,d,L=>this._diffModel.get().ensureModifiedLineIsVisible(L,2,void 0),this._options))}}}return{origViewZones:u,modViewZones:f}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new MarkdownString(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(localize("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ThemeIcon.asClassName(Codicon.fold),zIndex:10001};this._register(applyObservableDecorations$1(this._editors.original,derived(this,l=>{const c=r.read(l),d=c.map(u=>({range:u.originalUnchangedRange.toInclusiveRange(),options:o}));for(const u of c)u.shouldHideControls(l)&&d.push({range:Range$2.fromPositions(new Position$1(u.originalLineNumber,1)),options:a});return d}))),this._register(applyObservableDecorations$1(this._editors.modified,derived(this,l=>{const c=r.read(l),d=c.map(u=>({range:u.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const u of c)u.shouldHideControls(l)&&d.push({range:LineRange$1.ofLength(u.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(autorun(l=>{const c=r.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(isDefined)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(isDefined))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const f=u.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,u=this._diffModel.get();if(!u)return;const f=u.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(d));if(!f)return;f.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},HideUnchangedRegionsFeature_1=kl,kl._breadcrumbsSourceFactory=observableValue(HideUnchangedRegionsFeature_1,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),kl);HideUnchangedRegionsFeature=HideUnchangedRegionsFeature_1=__decorate$1L([__param$1L(3,IInstantiationService)],HideUnchangedRegionsFeature);class CompactCollapsedCodeOverlayWidget extends ViewZoneOverlayWidget{constructor(e,t,i,s=!1){const r=h("div.diff-hidden-lines-widget");super(e,t,r.root),this._unchangedRegion=i,this._hide=s,this._nodes=h("div.diff-hidden-lines-compact",[h("div.line-left",[]),h("div.text@text",[]),h("div.line-right",[])]),r.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(autorun(o=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(o).length,l=localize("hiddenLines","{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class CollapsedCodeOverlayWidget extends ViewZoneOverlayWidget{constructor(e,t,i,s,r,o,a,l){const c=h("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=r,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=h("div.diff-hidden-lines",[h("div.top@top",{title:localize("diff.hiddenLines.top","Click or drag to show more above")}),h("div.center@content",{style:{display:"flex"}},[h("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[$$e("a",{title:localize("showUnchangedRegion","Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...renderLabelWithIcons("$(unfold)"))]),h("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),h("div.bottom@bottom",{title:localize("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?reset$1(this._nodes.first):this._register(applyStyle(this._nodes.first,{width:observableCodeEditor(this._editor).layoutInfoContentLeft})),this._register(autorun(u=>{const f=this._unchangedRegion.visibleLineCountTop.read(u)+this._unchangedRegion.visibleLineCountBottom.read(u)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!f),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),this._nodes.top.classList.toggle("canMoveBottom",!f);const g=this._unchangedRegion.isDragged.read(u),m=this._editor.getDomNode();m&&(m.classList.toggle("draggingUnchangedRegion",!!g),g==="top"?(m.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(u)>0),m.classList.toggle("canMoveBottom",!f)):g==="bottom"?(m.classList.toggle("canMoveTop",!f),m.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(u)>0)):(m.classList.toggle("canMoveTop",!1),m.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(addDisposableListener(this._nodes.top,"mousedown",u=>{if(u.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const _=getWindow(this._nodes.top),v=addDisposableListener(_,"mousemove",S=>{const L=S.clientY-f;g=g||Math.abs(L)>2;const I=Math.round(L/d.getOption(67)),N=Math.max(0,Math.min(m+I,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(N,void 0)}),C=addDisposableListener(_,"mouseup",S=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),v.dispose(),C.dispose()})})),this._register(addDisposableListener(this._nodes.bottom,"mousedown",u=>{if(u.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),u.preventDefault();const f=u.clientY;let g=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const _=getWindow(this._nodes.bottom),v=addDisposableListener(_,"mousemove",S=>{const L=S.clientY-f;g=g||Math.abs(L)>2;const I=Math.round(L/d.getOption(67)),N=Math.max(0,Math.min(m-I,this._unchangedRegion.getMaxVisibleLineCountBottom())),R=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(N,void 0);const T=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(T-R))}),C=addDisposableListener(_,"mouseup",S=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!g){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),v.dispose(),C.dispose()})})),this._register(autorun(u=>{const f=[];if(!this._hide){const g=i.getHiddenModifiedRange(u).length,m=localize("hiddenLines","{0} hidden lines",g),_=$$e("span",{title:localize("diff.hiddenLines.expandAll","Double click to unfold")},m);_.addEventListener("dblclick",S=>{S.button===0&&(S.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(u),C=this._modifiedOutlineSource.getBreadcrumbItems(v,u);if(C.length>0){f.push($$e("span",void 0,"  |  "));for(let S=0;S{this._revealModifiedHiddenLine(w.startLineNumber)}}}}reset$1(this._nodes.others,...f)}))}}var __decorate$1K=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1K=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OverviewRulerFeature_1,yo;let OverviewRulerFeature=(yo=class extends Disposable{constructor(e,t,i,s,r,o,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=r,this._modifiedEditorLayoutInfo=o,this._themeService=a,this.width=OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=observableFromEvent(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=derived(f=>{const g=l.read(f),m=g.getColor(diffOverviewRulerInserted)||(g.getColor(diffInserted)||defaultInsertColor).transparent(2),_=g.getColor(diffOverviewRulerRemoved)||(g.getColor(diffRemoved)||defaultRemoveColor).transparent(2);return{insertColor:m,removeColor:_}}),d=createFastDomNode(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const u=h("div.diffOverview",{style:{position:"absolute",top:"0px",width:OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(appendRemoveOnDispose(u,d.domNode)),this._register(addStandardDisposableListener(u,EventType$1.POINTER_DOWN,f=>{this._editors.modified.delegateVerticalScrollbarPointerDown(f)})),this._register(addDisposableListener(u,EventType$1.MOUSE_WHEEL,f=>{this._editors.modified.delegateScrollFromMouseWheelEvent(f)},{passive:!1})),this._register(appendRemoveOnDispose(this._rootElement,u)),this._register(autorunWithStore((f,g)=>{const m=this._diffModel.read(f),_=this._editors.original.createOverviewRuler("original diffOverviewRuler");_&&(g.add(_),g.add(appendRemoveOnDispose(u,_.getDomNode())));const v=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(v&&(g.add(v),g.add(appendRemoveOnDispose(u,v.getDomNode()))),!_||!v)return;const C=observableSignalFromEvent("viewZoneChanged",this._editors.original.onDidChangeViewZones),S=observableSignalFromEvent("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=observableSignalFromEvent("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),L=observableSignalFromEvent("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);g.add(autorun(I=>{var B;C.read(I),S.read(I),w.read(I),L.read(I);const N=c.read(I),R=(B=m==null?void 0:m.diff.read(I))==null?void 0:B.mappings;function T(W,G,j){const K=j._getViewModel();return K?W.filter(ee=>ee.length>0).map(ee=>{const U=K.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(ee.startLineNumber,1)),q=K.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(ee.endLineNumberExclusive,1)),Q=q.lineNumber-U.lineNumber;return new OverviewRulerZone(U.lineNumber,q.lineNumber,Q,G.toString())}):[]}const A=T((R||[]).map(W=>W.lineRangeMapping.original),N.removeColor,this._editors.original),F=T((R||[]).map(W=>W.lineRangeMapping.modified),N.insertColor,this._editors.modified);_==null||_.setZones(A),v==null||v.setZones(F)})),g.add(autorun(I=>{const N=this._rootHeight.read(I),R=this._rootWidth.read(I),T=this._modifiedEditorLayoutInfo.read(I);if(T){const A=OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH-2*OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH;_.setLayout({top:0,height:N,right:A+OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH,width:OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH}),v.setLayout({top:0,height:N,right:0,width:OverviewRulerFeature_1.ONE_OVERVIEW_WIDTH});const F=this._editors.modifiedScrollTop.read(I),B=this._editors.modifiedScrollHeight.read(I),W=this._editors.modified.getOption(104),G=new ScrollbarState(W.verticalHasArrows?W.arrowSize:0,W.verticalScrollbarSize,0,T.height,B,F);d.setTop(G.getSliderPosition()),d.setHeight(G.getSliderSize())}else d.setTop(0),d.setHeight(0);u.style.height=N+"px",u.style.left=R-OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(OverviewRulerFeature_1.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},OverviewRulerFeature_1=yo,yo.ONE_OVERVIEW_WIDTH=15,yo.ENTIRE_DIFF_OVERVIEW_WIDTH=yo.ONE_OVERVIEW_WIDTH*2,yo);OverviewRulerFeature=OverviewRulerFeature_1=__decorate$1K([__param$1K(6,IThemeService)],OverviewRulerFeature);const emptyArr=[];class RevertButtonsFeature extends Disposable{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=derived(this,r=>{const o=this._diffModel.read(r),a=o==null?void 0:o.diff.read(r);if(!a)return emptyArr;const l=this._editors.modifiedSelections.read(r);if(l.every(f=>f.isEmpty()))return emptyArr;const c=new LineRangeSet(l.map(f=>LineRange$1.fromRangeInclusive(f))),u=a.mappings.filter(f=>f.lineRangeMapping.innerChanges&&c.intersects(f.lineRangeMapping.modified)).map(f=>({mapping:f,rangeMappings:f.lineRangeMapping.innerChanges.filter(g=>l.some(m=>Range$2.areIntersecting(g.modifiedRange,m)))}));return u.length===0||u.every(f=>f.rangeMappings.length===0)?emptyArr:u}),this._register(autorunWithStore((r,o)=>{if(!this._options.shouldRenderOldRevertArrows.read(r))return;const a=this._diffModel.read(r),l=a==null?void 0:a.diff.read(r);if(!a||!l||a.movedTextToCompare.read(r))return;const c=[],d=this._selectedDiffs.read(r),u=new Set(d.map(f=>f.mapping));if(d.length>0){const f=this._editors.modifiedSelections.read(r),g=o.add(new RevertButton(f[f.length-1].positionLineNumber,this._widget,d.flatMap(m=>m.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}for(const f of l.mappings)if(!u.has(f)&&!f.lineRangeMapping.modified.isEmpty&&f.lineRangeMapping.innerChanges){const g=o.add(new RevertButton(f.lineRangeMapping.modified.startLineNumber,this._widget,f.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(g),c.push(g)}o.add(toDisposable(()=>{for(const f of c)this._editors.modified.removeGlyphMarginWidget(f)}))}))}}const fg=class fg extends Disposable{getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${fg.counter++}`,this._domNode=h("div.revertButton",{title:this._revertSelection?localize("revertSelectedChanges","Revert Selected Changes"):localize("revertChange","Revert Change")},[renderIcon(Codicon.arrowRight)]).root,this._register(addDisposableListener(this._domNode,EventType$1.MOUSE_DOWN,r=>{r.button!==2&&(r.stopPropagation(),r.preventDefault())})),this._register(addDisposableListener(this._domNode,EventType$1.MOUSE_UP,r=>{r.stopPropagation(),r.preventDefault()})),this._register(addDisposableListener(this._domNode,EventType$1.CLICK,r=>{this._diffs instanceof LineRangeMapping?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),r.stopPropagation(),r.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:GlyphMarginLane.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};fg.counter=0;let RevertButton=fg;function observableConfigValue(n,e,t){return observableFromEventOpts({debugName:()=>`Configuration Key "${n}"`},i=>t.onDidChangeConfiguration(s=>{s.affectsConfiguration(n)&&i(s)}),()=>t.getValue(n)??e)}function bindContextKey(n,e,t){const i=n.bindTo(e);return autorunOpts({debugName:()=>`Set Context Key "${n.key}"`},s=>{i.set(t(s))})}var __decorate$1J=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1J=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorEditors=class extends Disposable{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,r,o,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=r,this._instantiationService=o,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new Emitter$1),this.modifiedScrollTop=observableFromEvent(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=observableFromEvent(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=observableCodeEditor(this.modified),this.originalObs=observableCodeEditor(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=observableFromEvent(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=derivedOpts({owner:this,equalsFn:Position$1.equals},l=>{var c;return((c=this.modifiedSelections.read(l)[0])==null?void 0:c.getPosition())??new Position$1(1,1)}),this.originalCursor=observableFromEvent(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new Position$1(1,1)),this._argCodeEditorWidgetOptions=null,this._register(autorunHandleChanges({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const r=this._createInnerEditor(e,t,i,s);return this._register(r.onDidContentSizeChange(o=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=EditorOptions.revealHorizontalRightPadding.defaultValue+OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var i;e||(e="");const t=localize("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(i=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:i.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};DiffEditorEditors=__decorate$1J([__param$1J(5,IInstantiationService),__param$1J(6,IKeybindingService)],DiffEditorEditors);const gg=class gg extends Disposable{constructor(){super(...arguments),this._id=++gg.idCounter,this._onDidDispose=this._register(new Emitter$1),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};gg.idCounter=0;let DelegatingEditor=gg;var __decorate$1I=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1I=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorOptions=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=observableValue(this,0),this._screenReaderMode=observableFromEvent(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=derived(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=derived(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=derived(this,s=>this.compactMode.read(s)&&this.shouldRenderInlineViewInSmartMode.read(s)?!1:this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=derived(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=derived(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=derived(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=derived(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=derived(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=derived(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=derived(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=derived(this,s=>this._options.read(s).maxComputationTime),this.showMoves=derived(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=derived(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=derived(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=derived(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=derived(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=derived(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=derived(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=derived(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=derived(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.compactMode=derived(this,s=>this._options.read(s).compactMode),this.trueInlineDiffRenderingEnabled=derived(this,s=>this._options.read(s).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=derived(this,s=>!this.renderSideBySide.read(s)&&this.trueInlineDiffRenderingEnabled.read(s)),this.hideUnchangedRegions=derived(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=derived(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=derived(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=derived(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount),this._model=observableValue(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,s=>derivedConstOnceDefined(this,r=>{const o=s==null?void 0:s.diff.read(r);return o?isSimpleDiff(o,this.trueInlineDiffRenderingEnabled.read(r)):void 0})).flatten().map(this,s=>!!s),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...validateDiffEditorOptions(e,diffEditorDefaultOptions)};this._options=observableValue(this,i)}updateOptions(e){const t=validateDiffEditorOptions(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};DiffEditorOptions=__decorate$1I([__param$1I(1,IAccessibilityService)],DiffEditorOptions);function isSimpleDiff(n,e){return n.mappings.every(t=>isInsertion(t.lineRangeMapping)||isDeletion(t.lineRangeMapping)||e&&allowsTrueInlineDiffRendering(t.lineRangeMapping))}function isInsertion(n){return n.original.length===0}function isDeletion(n){return n.modified.length===0}function validateDiffEditorOptions(n,e){var t,i,s,r,o,a,l,c;return{enableSplitViewResizing:boolean(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:clampedFloat(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:boolean(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:boolean(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:clampedInt(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:clampedInt(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:boolean(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:boolean(n.renderIndicators,e.renderIndicators),originalEditable:boolean(n.originalEditable,e.originalEditable),diffCodeLens:boolean(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:boolean(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:stringSet(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:stringSet(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:boolean(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:boolean((t=n.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:boolean((i=n.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:boolean((s=n.experimental)==null?void 0:s.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:boolean(((r=n.hideUnchangedRegions)==null?void 0:r.enabled)??((o=n.experimental)==null?void 0:o.collapseUnchangedRegions),e.hideUnchangedRegions.enabled),contextLineCount:clampedInt((a=n.hideUnchangedRegions)==null?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:clampedInt((l=n.hideUnchangedRegions)==null?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:clampedInt((c=n.hideUnchangedRegions)==null?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:boolean(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:boolean(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:clampedInt(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:boolean(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:boolean(n.renderGutterMenu,e.renderGutterMenu),compactMode:boolean(n.compactMode,e.compactMode)}}var __decorate$1H=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1H=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorWidget=class extends DelegatingEditor{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,s,r,o,a,l){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=h("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[h("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),h("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),h("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(disposableObservableValue(this,void 0)),this._diffModel=derived(this,L=>{var I;return(I=this._diffModelSrc.read(L))==null?void 0:I.object}),this.onDidChangeModel=Event$1.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService]))),this._boundarySashes=observableValue(this,void 0),this._accessibleDiffViewerShouldBeVisible=observableValue(this,!1),this._accessibleDiffViewerVisible=derived(this,L=>this._options.onlyShowAccessibleDiffViewer.read(L)?!0:this._accessibleDiffViewerShouldBeVisible.read(L)),this._movedBlocksLinesPart=observableValue(this,void 0),this._layoutInfo=derived(this,L=>{var U,q;const I=this._rootSizeObserver.width.read(L),N=this._rootSizeObserver.height.read(L);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=N+"px";const R=this._sash.read(L),T=this._gutter.read(L),A=(T==null?void 0:T.width.read(L))??0,F=((U=this._overviewRulerPart.read(L))==null?void 0:U.width)??0;let B,W,G,j,K;if(!!R){const Q=R.sashLeft.read(L),ce=((q=this._movedBlocksLinesPart.read(L))==null?void 0:q.width.read(L))??0;B=0,W=Q-A-ce,K=Q-A,G=Q,j=I-G-F}else{K=0;const Q=this._options.inlineViewHideOriginalLineNumbers.read(L);B=A,Q?W=0:W=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(L)),G=A+W,j=I-G-F}return this.elements.original.style.left=B+"px",this.elements.original.style.width=W+"px",this._editors.original.layout({width:W,height:N},!0),T==null||T.layout(K),this.elements.modified.style.left=G+"px",this.elements.modified.style.width=j+"px",this._editors.modified.layout({width:j,height:N},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((L,I)=>L==null?void 0:L.diff.read(I)),this.onDidUpdateDiff=Event$1.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(toDisposable(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new ObservableElementSizeObserver(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(DiffEditorOptions,t),this._register(autorun(L=>{this._options.setWidth(this._rootSizeObserver.width.read(L))})),this._contextKeyService.createKey(EditorContextKeys.isEmbeddedDiffEditor.key,!1),this._register(bindContextKey(EditorContextKeys.isEmbeddedDiffEditor,this._contextKeyService,L=>this._options.isInEmbeddedEditor.read(L))),this._register(bindContextKey(EditorContextKeys.comparingMovedCode,this._contextKeyService,L=>{var I;return!!((I=this._diffModel.read(L))!=null&&I.movedTextToCompare.read(L))})),this._register(bindContextKey(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,L=>this._options.couldShowInlineViewBecauseOfSize.read(L))),this._register(bindContextKey(EditorContextKeys.diffEditorInlineMode,this._contextKeyService,L=>!this._options.renderSideBySide.read(L))),this._register(bindContextKey(EditorContextKeys.hasChanges,this._contextKeyService,L=>{var I,N;return(((N=(I=this._diffModel.read(L))==null?void 0:I.diff.read(L))==null?void 0:N.mappings.length)??0)>0})),this._editors=this._register(this._instantiationService.createInstance(DiffEditorEditors,this.elements.original,this.elements.modified,this._options,i,(L,I,N,R)=>this._createInnerEditor(L,I,N,R))),this._register(bindContextKey(EditorContextKeys.diffEditorOriginalWritable,this._contextKeyService,L=>this._options.originalEditable.read(L))),this._register(bindContextKey(EditorContextKeys.diffEditorModifiedWritable,this._contextKeyService,L=>!this._options.readOnly.read(L))),this._register(bindContextKey(EditorContextKeys.diffEditorOriginalUri,this._contextKeyService,L=>{var I;return((I=this._diffModel.read(L))==null?void 0:I.model.original.uri.toString())??""})),this._register(bindContextKey(EditorContextKeys.diffEditorModifiedUri,this._contextKeyService,L=>{var I;return((I=this._diffModel.read(L))==null?void 0:I.model.modified.uri.toString())??""})),this._overviewRulerPart=derivedDisposable(this,L=>this._options.renderOverviewRuler.read(L)?this._instantiationService.createInstance(readHotReloadableExport(OverviewRulerFeature,L),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(I=>I.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((L,I)=>{var N;return L-(((N=this._overviewRulerPart.read(I))==null?void 0:N.width)??0)})};this._sashLayout=new SashLayout(this._options,c),this._sash=derivedDisposable(this,L=>{const I=this._options.renderSideBySide.read(L);return this.elements.root.classList.toggle("side-by-side",I),I?new DiffEditorSash(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=derivedDisposable(this,L=>this._instantiationService.createInstance(readHotReloadableExport(HideUnchangedRegionsFeature,L),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);derivedDisposable(this,L=>this._instantiationService.createInstance(readHotReloadableExport(DiffEditorDecorations,L),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const u=new Set,f=new Set;let g=!1;const m=derivedDisposable(this,L=>this._instantiationService.createInstance(readHotReloadableExport(DiffEditorViewZones,L),getWindow(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.get().isUpdatingHiddenAreas,u,f)).recomputeInitiallyAndOnChange(this._store),_=derived(this,L=>{const I=m.read(L).viewZones.read(L).orig,N=d.read(L).viewZones.read(L).origViewZones;return I.concat(N)}),v=derived(this,L=>{const I=m.read(L).viewZones.read(L).mod,N=d.read(L).viewZones.read(L).modViewZones;return I.concat(N)});this._register(applyViewZones(this._editors.original,_,L=>{g=L},u));let C;this._register(applyViewZones(this._editors.modified,v,L=>{g=L,g?C=StableEditorScrollState.capture(this._editors.modified):(C==null||C.restore(this._editors.modified),C=void 0)},f)),this._accessibleDiffViewer=derivedDisposable(this,L=>this._instantiationService.createInstance(readHotReloadableExport(AccessibleDiffViewer,L),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(I,N)=>this._accessibleDiffViewerShouldBeVisible.set(I,N),this._options.onlyShowAccessibleDiffViewer.map(I=>!I),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((I,N)=>{var R;return(R=I==null?void 0:I.diff.read(N))==null?void 0:R.mappings.map(T=>T.lineRangeMapping)}),new AccessibleDiffViewerModelFromEditors(this._editors))).recomputeInitiallyAndOnChange(this._store);const S=this._accessibleDiffViewerVisible.map(L=>L?"hidden":"visible");this._register(applyStyle(this.elements.modified,{visibility:S})),this._register(applyStyle(this.elements.original,{visibility:S})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._gutter=derivedDisposable(this,L=>this._options.shouldRenderGutterMenu.read(L)?this._instantiationService.createInstance(readHotReloadableExport(DiffEditorGutter,L),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(recomputeInitiallyAndOnChange(this._layoutInfo)),derivedDisposable(this,L=>new(readHotReloadableExport(MovedBlocksLinesFeature,L))(this.elements.root,this._diffModel,this._layoutInfo.map(I=>I.originalEditor),this._layoutInfo.map(I=>I.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,L=>{this._movedBlocksLinesPart.set(L,void 0)}),this._register(Event$1.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,L=>this._handleCursorPositionChange(L,!0))),this._register(Event$1.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,L=>this._handleCursorPositionChange(L,!1)));const w=this._diffModel.map(this,(L,I)=>{if(L)return L.diff.read(I)===void 0&&!L.isDiffUpToDate.read(I)});this._register(autorunWithStore((L,I)=>{if(w.read(L)===!0){const N=this._editorProgressService.show(!0,1e3);I.add(toDisposable(()=>N.done()))}})),this._register(autorunWithStore((L,I)=>{I.add(new(readHotReloadableExport(RevertButtonsFeature,L))(this._editors,this._diffModel,this._options,this))})),this._register(autorunWithStore((L,I)=>{const N=this._diffModel.read(L);if(N)for(const R of[N.model.original,N.model.modified])I.add(R.onWillDispose(T=>{onUnexpectedError(new BugIndicatingError("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(autorun(L=>{this._options.setModel(this._diffModel.read(L))}))}_createInnerEditor(e,t,i,s){return e.createInstance(CodeEditorWidget,t,i,s)}_createDiffEditorContributions(){const e=EditorExtensionsRegistry.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){onUnexpectedError(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return EditorType.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var i;const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:(i=this._diffModel.get())==null?void 0:i.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())==null||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(DiffEditorViewModel,e,this._options)}getModel(){var e;return((e=this._diffModel.get())==null?void 0:e.model)??null}setModel(e){const t=e?"model"in e?RefCounted.create(e).createNewRef(this):RefCounted.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(e==null?void 0:e.object)&&subtransaction(t,s=>{var a;const r=e==null?void 0:e.object;observableFromEvent.batchEventsGlobally(s,()=>{this._editors.original.setModel(r?r.model.original:null),this._editors.modified.setModel(r?r.model.modified:null)});const o=(a=this._diffModelSrc.get())==null?void 0:a.createNewRef(this);this._diffModelSrc.set(e==null?void 0:e.createNewRef(this),s),setTimeout(()=>{o==null||o.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?toLineChanges(e):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.executeEdits("diffEditor",i)}_goTo(e){this._editors.modified.setPosition(new Position$1(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var r,o;const t=(o=(r=this._diffModel.get())==null?void 0:r.diff.get())==null?void 0:o.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?s=t.find(a=>a.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=findLast(t,a=>a.lineRangeMapping.modified.startLineNumber{var i;const t=(i=e.diff.get())==null?void 0:i.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var o,a;const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const r=t.getSelection();if(r){const l=(a=(o=this._diffModel.get())==null?void 0:o.diff.get())==null?void 0:a.mappings.map(c=>e?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=translatePosition(r.getStartPosition(),l),d=translatePosition(r.getEndPosition(),l);s=Range$2.plusRange(c,d)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&transaction(i=>{for(const s of e)s.collapseAll(i)})}showAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&transaction(i=>{for(const s of e)s.showAll(i)})}_handleCursorPositionChange(e,t){var i,s;if((e==null?void 0:e.reason)===3){const r=(s=(i=this._diffModel.get())==null?void 0:i.diff.get())==null?void 0:s.mappings.find(o=>t?o.lineRangeMapping.modified.contains(e.position.lineNumber):o.lineRangeMapping.original.contains(e.position.lineNumber));r!=null&&r.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):r!=null&&r.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):r&&this._accessibilitySignalService.playSignal(AccessibilitySignal.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};DiffEditorWidget=__decorate$1H([__param$1H(3,IContextKeyService),__param$1H(4,IInstantiationService),__param$1H(5,ICodeEditorService),__param$1H(6,IAccessibilitySignalService),__param$1H(7,IEditorProgressService)],DiffEditorWidget);function toLineChanges(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,r,o,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,o=0,a=void 0):(r=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:r,modifiedEndLineNumber:o,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var __decorate$1G=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1G=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let LAST_GENERATED_COMMAND_ID=0,ariaDomNodeCreated=!1;function createAriaDomNode(n){if(!n){if(ariaDomNodeCreated)return;ariaDomNodeCreated=!0}setARIAContainer(n||mainWindow.document.body)}let StandaloneCodeEditor=class extends CodeEditorWidget{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g){const m={...t};m.ariaLabel=m.ariaLabel||StandaloneCodeEditorNLS.editorViewAccessibleLabel,super(e,m,{},i,s,r,o,c,d,u,f,g),l instanceof StandaloneKeybindingService?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,createAriaDomNode(m.ariaContainerElement),setHoverDelegateFactory((_,v)=>i.createInstance(WorkbenchHoverDelegate,_,v,{})),setBaseLayerHoverDelegate(a)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++LAST_GENERATED_COMMAND_ID,r=ContextKeyExpr.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,r),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Disposable.None;const t=e.id,i=e.label,s=ContextKeyExpr.and(ContextKeyExpr.equals("editorId",this.getId()),ContextKeyExpr.deserialize(e.precondition)),r=e.keybindings,o=ContextKeyExpr.and(s,ContextKeyExpr.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...m)=>Promise.resolve(e.run(this,...m)),d=new DisposableStore,u=this.getId()+":"+t;if(d.add(CommandsRegistry.registerCommand(u,c)),a){const g={command:{id:u,title:i},when:s,group:a,order:l};d.add(MenuRegistry.appendMenuItem(MenuId.EditorContext,g))}if(Array.isArray(r))for(const g of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,g,c,o));const f=new InternalEditorAction(u,i,i,void 0,s,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,f),d.add(toDisposable(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof StandaloneCodeEditorService)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};StandaloneCodeEditor=__decorate$1G([__param$1G(2,IInstantiationService),__param$1G(3,ICodeEditorService),__param$1G(4,ICommandService),__param$1G(5,IContextKeyService),__param$1G(6,IHoverService),__param$1G(7,IKeybindingService),__param$1G(8,IThemeService),__param$1G(9,INotificationService),__param$1G(10,IAccessibilityService),__param$1G(11,ILanguageConfigurationService),__param$1G(12,ILanguageFeaturesService)],StandaloneCodeEditor);let StandaloneEditor=class extends StandaloneCodeEditor{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g,m,_,v){const C={...t};updateConfigurationService(u,C,!1);const S=c.registerEditorContainer(e);typeof C.theme=="string"&&c.setTheme(C.theme),typeof C.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!C.autoDetectHighContrast);const w=C.model;delete C.model,super(e,C,i,s,r,o,a,l,c,d,f,_,v),this._configurationService=u,this._standaloneThemeService=c,this._register(S);let L;if(typeof w>"u"){const I=m.getLanguageIdByMimeType(C.language)||C.language||PLAINTEXT_LANGUAGE_ID;L=createTextModel(g,m,C.value||"",I,void 0),this._ownsModel=!0}else L=w,this._ownsModel=!1;if(this._attachModel(L),L){const I={oldModelUrl:null,newModelUrl:L.uri};this._onDidChangeModel.fire(I)}}dispose(){super.dispose()}updateOptions(e){updateConfigurationService(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};StandaloneEditor=__decorate$1G([__param$1G(2,IInstantiationService),__param$1G(3,ICodeEditorService),__param$1G(4,ICommandService),__param$1G(5,IContextKeyService),__param$1G(6,IHoverService),__param$1G(7,IKeybindingService),__param$1G(8,IStandaloneThemeService),__param$1G(9,INotificationService),__param$1G(10,IConfigurationService),__param$1G(11,IAccessibilityService),__param$1G(12,IModelService),__param$1G(13,ILanguageService),__param$1G(14,ILanguageConfigurationService),__param$1G(15,ILanguageFeaturesService)],StandaloneEditor);let StandaloneDiffEditor2=class extends DiffEditorWidget{constructor(e,t,i,s,r,o,a,l,c,d,u,f){const g={...t};updateConfigurationService(l,g,!0);const m=o.registerEditorContainer(e);typeof g.theme=="string"&&o.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&o.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},s,i,r,f,d),this._configurationService=l,this._standaloneThemeService=o,this._register(m)}dispose(){super.dispose()}updateOptions(e){updateConfigurationService(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(StandaloneCodeEditor,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};StandaloneDiffEditor2=__decorate$1G([__param$1G(2,IInstantiationService),__param$1G(3,IContextKeyService),__param$1G(4,ICodeEditorService),__param$1G(5,IStandaloneThemeService),__param$1G(6,INotificationService),__param$1G(7,IConfigurationService),__param$1G(8,IContextMenuService),__param$1G(9,IEditorProgressService),__param$1G(10,IClipboardService),__param$1G(11,IAccessibilitySignalService)],StandaloneDiffEditor2);function createTextModel(n,e,t,i,s){if(t=t||"",!i){const r=t.indexOf(` +`);let o=t;return r!==-1&&(o=t.substring(0,r)),doCreateModel(n,t,e.createByFilepathOrFirstLine(s||null,o),s)}return doCreateModel(n,t,e.createById(i),s)}function doCreateModel(n,e,t,i){return n.createModel(e,t,i)}const style="";var __decorate$1F=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1F=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class TemplateData{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let DiffEditorItemTemplate=class extends Disposable{constructor(e,t,i,s,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=observableValue(this,void 0),this._collapsed=derived(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=observableValue(this,500),this.contentHeight=derived(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=observableValue(this,0),this._modifiedWidth=observableValue(this,0),this._originalContentWidth=observableValue(this,0),this._originalWidth=observableValue(this,0),this.maxScroll=derived(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=h("div.multiDiffEntry",[h("div.header@header",[h("div.header-content",[h("div.collapse-button@collapseButton"),h("div.file-path",[h("div.title.modified.show-file-icons@primaryPath",[]),h("div.status.deleted@status",["R"]),h("div.title.original.show-file-icons@secondaryPath",[])]),h("div.actions@actions")])]),h("div.editorParent",[h("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(DiffEditorWidget,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=observableCodeEditor(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=observableCodeEditor(this.editor.getOriginalEditor()).isFocused,this.isFocused=derived(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new DisposableStore),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new Button(this._elements.collapseButton,{});this._register(autorun(l=>{o.element.className="",o.icon=this._collapsed.read(l)?Codicon.chevronRight:Codicon.chevronDown})),this._register(o.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(autorun(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{globalTransaction(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(autorun(l=>{var d;const c=(d=this._viewModel.read(l))==null?void 0:d.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(r.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService])));this._register(a.createInstance(MenuWorkbenchToolBar,this._elements.actions,MenuId.MultiDiffEditorFileToolbar,{actionRunner:this._register(new ActionRunnerWithContext(()=>{var l;return(l=this._viewModel.get())==null?void 0:l.modifiedUri})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>createActionViewItem(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){globalTransaction(s=>{this._viewModel.set(void 0,s),this.editor.setDiffModel(null,s),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(globalTransaction(s=>{var c,d;(c=this._resourceLabel)==null||c.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let r=!1,o=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",r=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",o=!0),this._elements.status.classList.toggle("renamed",r),this._elements.status.classList.toggle("deleted",o),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(d=this._resourceLabel2)==null||d.setUri(r?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,s),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,s=>{s||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[s,r]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(s,r)}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const r=e.length-this._headerHeight,o=Math.max(0,Math.min(s.start-e.start,r));this._elements.header.style.transform=`translateY(${o}px)`,globalTransaction(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",o>0||i>0),this._elements.header.classList.toggle("collapsed",o===r)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};DiffEditorItemTemplate=__decorate$1F([__param$1F(3,IInstantiationService),__param$1F(4,IContextKeyService)],DiffEditorItemTemplate);class ObjectPool{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var __decorate$1E=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1E=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let MultiDiffEditorWidgetImpl=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=r,this._parentInstantiationService=o,this._scrollableElements=h("div.scrollContent",[h("div@content",{style:{overflow:"hidden"}}),h("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new Scrollable({forceIntegerValues:!1,scheduleAtNextAnimationFrame:l=>scheduleAtNextAnimationFrame(getWindow(this._element),l),smoothScrollDuration:100})),this._scrollableElement=this._register(new SmoothScrollableElement(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=h("div.monaco-component.multiDiffEditor",{},[h("div",{},[this._scrollableElement.getDomNode()]),h("div.placeholder@placeholder",{},[h("div",[localize("noChangedFiles","No Changed Files")])])]),this._sizeObserver=this._register(new ObservableElementSizeObserver(this._element,void 0)),this._objectPool=this._register(new ObjectPool(l=>{const c=this._instantiationService.createInstance(DiffEditorItemTemplate,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return c.setData(l),c})),this.scrollTop=observableFromEvent(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=observableFromEvent(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=derivedWithStore(this,(l,c)=>{const d=this._viewModel.read(l);if(!d)return{items:[],getItem:m=>{throw new BugIndicatingError}};const u=d.items.read(l),f=new Map;return{items:u.map(m=>{var C;const _=c.add(new VirtualizedViewItem(m,this._objectPool,this.scrollLeft,S=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+S})})),v=(C=this._lastDocStates)==null?void 0:C[_.getKey()];return v&&transaction(S=>{_.setViewState(v,S)}),f.set(m,_),_}),getItem:m=>f.get(m)}}),this._viewItems=this._viewItemsInfo.map(this,l=>l.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(l,c)=>l.reduce((d,u)=>d+u.contentHeight.read(c)+this._spaceBetweenPx,0)),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new ServiceCollection([IContextKeyService,this._contextKeyService]))),this._lastDocStates={},this._contextKeyService.createKey(EditorContextKeys.inMultiDiffEditor.key,!0),this._register(autorunWithStore((l,c)=>{const d=this._viewModel.read(l);if(d&&d.contextKeys)for(const[u,f]of Object.entries(d.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(f),c.add(toDisposable(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(EditorContextKeys.multiDiffEditorAllCollapsed.key,!1);this._register(autorun(l=>{const c=this._viewModel.read(l);if(c){const d=c.items.read(l).every(u=>u.collapsed.read(l));a.set(d)}})),this._register(autorun(l=>{const c=this._dimension.read(l);this._sizeObserver.observe(c)})),this._register(autorun(l=>{const c=this._viewItems.read(l);this._elements.placeholder.classList.toggle("visible",c.length===0)})),this._scrollableElements.content.style.position="relative",this._register(autorun(l=>{const c=this._sizeObserver.height.read(l);this._scrollableElements.root.style.height=`${c}px`;const d=this._totalHeight.read(l);this._scrollableElements.content.style.height=`${d}px`;const u=this._sizeObserver.width.read(l);let f=u;const g=this._viewItems.read(l),m=findFirstMax(g,compareBy(_=>_.maxScroll.read(l).maxScroll,numberComparator));if(m){const _=m.maxScroll.read(l);f=u+_.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:c,scrollHeight:d,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(toDisposable(()=>{e.replaceChildren()})),this._register(this._register(autorun(l=>{globalTransaction(c=>{this.render(l)})})))}render(e){const t=this.scrollTop.read(e);let i=0,s=0,r=0;const o=this._sizeObserver.height.read(e),a=OffsetRange.ofStartAndLength(t,o),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),u=Math.min(d,o),f=OffsetRange.ofStartAndLength(s,u),g=OffsetRange.ofStartAndLength(r,d);if(g.isBefore(a))i-=d-u,c.hide();else if(g.isAfter(a))c.hide();else{const m=Math.max(0,Math.min(a.start-g.start,d-u));i-=m;const _=OffsetRange.ofStartAndLength(t+i,o);c.render(f,m,l,_)}s+=u+this._spaceBetweenPx,r+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};MultiDiffEditorWidgetImpl=__decorate$1E([__param$1E(4,IContextKeyService),__param$1E(5,IInstantiationService)],MultiDiffEditorWidgetImpl);class VirtualizedViewItem extends Disposable{constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(disposableObservableValue(this,void 0)),this.contentHeight=derived(this,r=>{var o,a;return((a=(o=this._templateRef.read(r))==null?void 0:o.object.contentHeight)==null?void 0:a.read(r))??this.viewModel.lastTemplateData.read(r).contentHeight}),this.maxScroll=derived(this,r=>{var o;return((o=this._templateRef.read(r))==null?void 0:o.object.maxScroll.read(r))??{maxScroll:0,scrollWidth:0}}),this.template=derived(this,r=>{var o;return(o=this._templateRef.read(r))==null?void 0:o.object}),this._isHidden=observableValue(this,!1),this._isFocused=derived(this,r=>{var o;return((o=this.template.read(r))==null?void 0:o.isFocused.read(r))??!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(autorun(r=>{var a;const o=this._scrollLeft.read(r);(a=this._templateRef.read(r))==null||a.object.setScrollLeft(o)})),this._register(autorun(r=>{const o=this._templateRef.read(r);!o||!this._isHidden.read(r)||o.object.isFocused.read(r)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.documentDiffItem.modified)==null?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var o;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=(o=e.selections)==null?void 0:o.map(Selection$1.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const r=this._templateRef.get();r&&s&&r.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&transaction(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let r=this._templateRef.get();if(!r){r=this._objectPool.getUnusedObj(new TemplateData(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(r,void 0);const o=this.viewModel.lastTemplateData.get().selections;o&&r.object.editor.setSelections(o)}r.object.render(e,i,t,s)}}registerColor("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},localize("multiDiffEditor.headerBackground","The background color of the diff editor's header"));registerColor("multiDiffEditor.background",editorBackground,localize("multiDiffEditor.background","The background color of the multi file diff editor"));registerColor("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},localize("multiDiffEditor.border","The border color of the multi file diff editor"));var __decorate$1D=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1D=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let MultiDiffEditorWidget=class extends Disposable{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=observableValue(this,void 0),this._viewModel=observableValue(this,void 0),this._widgetImpl=derivedWithStore(this,(s,r)=>(readHotReloadableExport(DiffEditorItemTemplate,s),r.add(this._instantiationService.createInstance(readHotReloadableExport(MultiDiffEditorWidgetImpl,s),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory)))),this._register(recomputeInitiallyAndOnChange(this._widgetImpl))}};MultiDiffEditorWidget=__decorate$1D([__param$1D(2,IInstantiationService)],MultiDiffEditorWidget);function create(n,e,t){return StandaloneServices.initialize(t||{}).createInstance(StandaloneEditor,n,e)}function onDidCreateEditor(n){return StandaloneServices.get(ICodeEditorService).onCodeEditorAdd(t=>{n(t)})}function onDidCreateDiffEditor(n){return StandaloneServices.get(ICodeEditorService).onDiffEditorAdd(t=>{n(t)})}function getEditors(){return StandaloneServices.get(ICodeEditorService).listCodeEditors()}function getDiffEditors(){return StandaloneServices.get(ICodeEditorService).listDiffEditors()}function createDiffEditor(n,e,t){return StandaloneServices.initialize(t||{}).createInstance(StandaloneDiffEditor2,n,e)}function createMultiFileDiffEditor(n,e){const t=StandaloneServices.initialize(e||{});return new MultiDiffEditorWidget(n,{},t)}function addCommand(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return CommandsRegistry.registerCommand(n.id,n.run)}function addEditorAction(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=ContextKeyExpr.deserialize(n.precondition),t=(s,...r)=>EditorCommand.runEditorCommand(s,r,e,(o,a,l)=>Promise.resolve(n.run(a,...l))),i=new DisposableStore;if(i.add(CommandsRegistry.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(MenuRegistry.appendMenuItem(MenuId.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=StandaloneServices.get(IKeybindingService);if(!(s instanceof StandaloneKeybindingService))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=ContextKeyExpr.and(e,ContextKeyExpr.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(o=>({keybinding:o,command:n.id,when:r}))))}}return i}function addKeybindingRule(n){return addKeybindingRules([n])}function addKeybindingRules(n){const e=StandaloneServices.get(IKeybindingService);return e instanceof StandaloneKeybindingService?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:ContextKeyExpr.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Disposable.None)}function createModel(n,e,t){const i=StandaloneServices.get(ILanguageService),s=i.getLanguageIdByMimeType(e)||e;return createTextModel(StandaloneServices.get(IModelService),i,n,s,t)}function setModelLanguage(n,e){const t=StandaloneServices.get(ILanguageService),i=t.getLanguageIdByMimeType(e)||e||PLAINTEXT_LANGUAGE_ID;n.setLanguage(t.createById(i))}function setModelMarkers(n,e,t){n&&StandaloneServices.get(IMarkerService).changeOne(e,n.uri,t)}function removeAllMarkers(n){StandaloneServices.get(IMarkerService).changeAll(n,[])}function getModelMarkers(n){return StandaloneServices.get(IMarkerService).read(n)}function onDidChangeMarkers(n){return StandaloneServices.get(IMarkerService).onMarkerChanged(n)}function getModel(n){return StandaloneServices.get(IModelService).getModel(n)}function getModels(){return StandaloneServices.get(IModelService).getModels()}function onDidCreateModel(n){return StandaloneServices.get(IModelService).onModelAdded(n)}function onWillDisposeModel(n){return StandaloneServices.get(IModelService).onModelRemoved(n)}function onDidChangeModelLanguage(n){return StandaloneServices.get(IModelService).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function createWebWorker(n){return createWebWorker$1(StandaloneServices.get(IModelService),n)}function colorizeElement(n,e){const t=StandaloneServices.get(ILanguageService),i=StandaloneServices.get(IStandaloneThemeService);return Colorizer.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function colorize(n,e,t){const i=StandaloneServices.get(ILanguageService);return StandaloneServices.get(IStandaloneThemeService).registerEditorContainer(mainWindow.document.body),Colorizer.colorize(i,n,e,t)}function colorizeModelLine(n,e,t=4){return StandaloneServices.get(IStandaloneThemeService).registerEditorContainer(mainWindow.document.body),Colorizer.colorizeModelLine(n,e,t)}function getSafeTokenizationSupport$1(n){const e=TokenizationRegistry.get(n);return e||{getInitialState:()=>NullState,tokenize:(t,i,s)=>nullTokenize(n,s)}}function tokenize(n,e){TokenizationRegistry.getOrCreate(e);const t=getSafeTokenizationSupport$1(e),i=splitLines(n),s=[];let r=t.getInitialState();for(let o=0,a=i.length;o{var a;if(!i)return null;const r=(a=t.options)==null?void 0:a.selection;let o;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?o=r:r&&(o={lineNumber:r.startLineNumber,column:r.startColumn}),await n.openCodeEditor(i,t.resource,o)?i:null})}function createMonacoEditorAPI(){return{create,getEditors,getDiffEditors,onDidCreateEditor,onDidCreateDiffEditor,createDiffEditor,addCommand,addEditorAction,addKeybindingRule,addKeybindingRules,createModel,setModelLanguage,setModelMarkers,getModelMarkers,removeAllMarkers,onDidChangeMarkers,getModels,getModel,onDidCreateModel,onWillDisposeModel,onDidChangeModelLanguage,createWebWorker,colorizeElement,colorize,colorizeModelLine,tokenize,defineTheme,setTheme,remeasureFonts,registerCommand:registerCommand$1,registerLinkOpener,registerEditorOpener,AccessibilitySupport,ContentWidgetPositionPreference,CursorChangeReason,DefaultEndOfLine,EditorAutoIndentStrategy,EditorOption,EndOfLinePreference,EndOfLineSequence,MinimapPosition,MinimapSectionHeaderStyle,MouseTargetType,OverlayWidgetPositionPreference,OverviewRulerLane:OverviewRulerLane$1,GlyphMarginLane:GlyphMarginLane$1,RenderLineNumbersType,RenderMinimap,ScrollbarVisibility,ScrollType,TextEditorCursorBlinkingStyle,TextEditorCursorStyle,TrackedRangeStickiness,WrappingIndent,InjectedTextCursorStops:InjectedTextCursorStops$1,PositionAffinity,ShowLightbulbIconMode,ConfigurationChangedEvent,BareFontInfo,FontInfo,TextModelResolvedOptions,FindMatch,ApplyUpdateResult,EditorZoom,createMultiFileDiffEditor,EditorType,EditorOptions}}function isArrayOf(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function bool(n,e){return typeof n=="boolean"?n:e}function string(n,e){return typeof n=="string"?n:e}function arrayToHash$1(n){const e={};for(const t of n)e[t]=!0;return e}function createKeywordMatcher(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=arrayToHash$1(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function compileRegExp(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(o,a){s=!0;let l="";if(typeof n[a]=="string")l=n[a];else if(n[a]&&n[a]instanceof RegExp)l=n[a].source;else throw n[a]===void 0?createError(n,"language definition does not contain attribute '"+a+"', used at: "+e):createError(n,"attribute reference '"+a+"' must be a string, used at: "+e);return empty(l)?"":"(?:"+l+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const r=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(substituteMatchesRe(n,e,c),r)),l)}return new RegExp(e,r)}function selectScrutinee(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw createError(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw createError(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!stateExists(n,substituteMatches(n,s,"",[],""))))throw createError(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,r=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=compileRegExp(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=compileAction(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function compile(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:n,includeLF:bool(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:bool(e.ignoreCase,!1),unicode:bool(e.unicode,!1),tokenPostfix:string(e.tokenPostfix,"."+n),defaultToken:string(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(o,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw createError(t,"an 'include' attribute must be a string at: "+o);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw createError(t,"include target '"+d+"' is not defined at: "+o);s(o+"."+d,a,e.tokenizer[d])}else{const u=new Rule(o);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const f=c[1];f.next=c[2],u.setAction(i,f)}else throw createError(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+o);else u.setAction(i,c[1]);else{if(!c.regex)throw createError(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+o);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=bool(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw createError(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const o in e.tokenizer)if(e.tokenizer.hasOwnProperty(o)){t.start||(t.start=o);const a=e.tokenizer[o];t.tokenizer[o]=new Array,s("tokenizer."+o,t.tokenizer[o],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw createError(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const r=[];for(const o of e.brackets){let a=o;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw createError(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")r.push({token:a.token+t.tokenPostfix,open:fixCase(t,a.open),close:fixCase(t,a.close)});else throw createError(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=r,t.noThrow=!0,t}function register(n){ModesRegistry.registerLanguage(n)}function getLanguages(){let n=[];return n=n.concat(ModesRegistry.getLanguages()),n}function getEncodedLanguageId(n){return StandaloneServices.get(ILanguageService).languageIdCodec.encodeLanguageId(n)}function onLanguage(n,e){return StandaloneServices.withServices(()=>{const i=StandaloneServices.get(ILanguageService).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function onLanguageEncountered(n,e){return StandaloneServices.withServices(()=>{const i=StandaloneServices.get(ILanguageService).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function setLanguageConfiguration(n,e){if(!StandaloneServices.get(ILanguageService).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return StandaloneServices.get(ILanguageConfigurationService).register(n,e,100)}class EncodedTokenizationSupportAdapter{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return TokenizationSupportAdapter.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new EncodedTokenizationResult(s.tokens,s.endState)}}class TokenizationSupportAdapter{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let r=0,o=e.length;r0&&r[o-1]===f)continue;let g=u.startIndex;c===0?g=0:g{const i=await Promise.resolve(e.create());return i?isATokensProvider(i)?createTokenizationSupportAdapter(n,i):new MonarchTokenizer(StandaloneServices.get(ILanguageService),StandaloneServices.get(IStandaloneThemeService),n,compile(n,i),StandaloneServices.get(IConfigurationService)):null});return TokenizationRegistry.registerFactory(n,t)}function setTokensProvider(n,e){if(!StandaloneServices.get(ILanguageService).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return isThenable(e)?registerTokensProviderFactory(n,{create:()=>e}):TokenizationRegistry.register(n,createTokenizationSupportAdapter(n,e))}function setMonarchTokensProvider(n,e){const t=i=>new MonarchTokenizer(StandaloneServices.get(ILanguageService),StandaloneServices.get(IStandaloneThemeService),n,compile(n,i),StandaloneServices.get(IConfigurationService));return isThenable(e)?registerTokensProviderFactory(n,{create:()=>e}):TokenizationRegistry.register(n,t(e))}function registerReferenceProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).referenceProvider.register(n,e)}function registerRenameProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).renameProvider.register(n,e)}function registerNewSymbolNameProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).newSymbolNamesProvider.register(n,e)}function registerSignatureHelpProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).signatureHelpProvider.register(n,e)}function registerHoverProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).hoverProvider.register(n,{provideHover:async(i,s,r,o)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,r,o)).then(l=>{if(l)return!l.range&&a&&(l.range=new Range$2(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),l.range||(l.range=new Range$2(s.lineNumber,s.column,s.lineNumber,s.column)),l})}})}function registerDocumentSymbolProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentSymbolProvider.register(n,e)}function registerDocumentHighlightProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentHighlightProvider.register(n,e)}function registerLinkedEditingRangeProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).linkedEditingRangeProvider.register(n,e)}function registerDefinitionProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).definitionProvider.register(n,e)}function registerImplementationProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).implementationProvider.register(n,e)}function registerTypeDefinitionProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).typeDefinitionProvider.register(n,e)}function registerCodeLensProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).codeLensProvider.register(n,e)}function registerCodeActionProvider(n,e,t){return StandaloneServices.get(ILanguageFeaturesService).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,r,o,a)=>{const c=StandaloneServices.get(IMarkerService).read({resource:s.uri}).filter(d=>Range$2.areIntersectingOrTouching(d,r));return e.provideCodeActions(s,r,{markers:c,only:o.only,trigger:o.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function registerDocumentFormattingEditProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentFormattingEditProvider.register(n,e)}function registerDocumentRangeFormattingEditProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentRangeFormattingEditProvider.register(n,e)}function registerOnTypeFormattingEditProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).onTypeFormattingEditProvider.register(n,e)}function registerLinkProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).linkProvider.register(n,e)}function registerCompletionItemProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).completionProvider.register(n,e)}function registerColorProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).colorProvider.register(n,e)}function registerFoldingRangeProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).foldingRangeProvider.register(n,e)}function registerDeclarationProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).declarationProvider.register(n,e)}function registerSelectionRangeProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).selectionRangeProvider.register(n,e)}function registerDocumentSemanticTokensProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentSemanticTokensProvider.register(n,e)}function registerDocumentRangeSemanticTokensProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).documentRangeSemanticTokensProvider.register(n,e)}function registerInlineCompletionsProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).inlineCompletionsProvider.register(n,e)}function registerInlineEditProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).inlineEditProvider.register(n,e)}function registerInlayHintsProvider(n,e){return StandaloneServices.get(ILanguageFeaturesService).inlayHintsProvider.register(n,e)}function createMonacoLanguagesAPI(){return{register,getLanguages,onLanguage,onLanguageEncountered,getEncodedLanguageId,setLanguageConfiguration,setColorMap,registerTokensProviderFactory,setTokensProvider,setMonarchTokensProvider,registerReferenceProvider,registerRenameProvider,registerNewSymbolNameProvider,registerCompletionItemProvider,registerSignatureHelpProvider,registerHoverProvider,registerDocumentSymbolProvider,registerDocumentHighlightProvider,registerLinkedEditingRangeProvider,registerDefinitionProvider,registerImplementationProvider,registerTypeDefinitionProvider,registerCodeLensProvider,registerCodeActionProvider,registerDocumentFormattingEditProvider,registerDocumentRangeFormattingEditProvider,registerOnTypeFormattingEditProvider,registerLinkProvider,registerColorProvider,registerFoldingRangeProvider,registerDeclarationProvider,registerSelectionRangeProvider,registerDocumentSemanticTokensProvider,registerDocumentRangeSemanticTokensProvider,registerInlineCompletionsProvider,registerInlineEditProvider,registerInlayHintsProvider,DocumentHighlightKind,CompletionItemKind,CompletionItemTag,CompletionItemInsertTextRule,SymbolKind,SymbolTag,IndentAction:IndentAction$1,CompletionTriggerKind,SignatureHelpTriggerKind,InlayHintKind,InlineCompletionTriggerKind,InlineEditTriggerKind,CodeActionTriggerType,NewSymbolNameTag,NewSymbolNameTriggerKind,PartialAcceptTriggerKind,HoverVerbosityAction,FoldingRangeKind,SelectedSuggestionInfo}}const IEditorCancellationTokens=createDecorator("IEditorCancelService"),ctxCancellableOperation=new RawContextKey("cancellableOperation",!1,localize("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));registerSingleton(IEditorCancellationTokens,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const r=ctxCancellableOperation.bindTo(s.get(IContextKeyService)),o=new LinkedList;return{key:r,tokens:o}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class EditorKeybindingCancellationTokenSource extends CancellationTokenSource$1{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(IEditorCancellationTokens).add(e,this))}dispose(){this._unregister(),super.dispose()}}registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:ctxCancellableOperation})}runEditorCommand(n,e){n.get(IEditorCancellationTokens).cancel(e)}});let EditorState$1=class _m{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?format$1("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof _m))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new _m(e,this.flags))}};class EditorStateCancellationTokenSource extends EditorKeybindingCancellationTokenSource{constructor(e,t,i,s){super(e,s),this._listener=new DisposableStore,t&4&&this._listener.add(e.onDidChangeCursorPosition(r=>{(!i||!Range$2.containsPosition(i,r.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(r=>{(!i||!Range$2.containsRange(i,r.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(r=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(r=>this.cancel())),this._listener.add(e.onDidChangeModelContent(r=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class TextModelCancellationTokenSource extends CancellationTokenSource$1{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function isCodeEditor(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===EditorType.ICodeEditor:!1}function isDiffEditor(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===EditorType.IDiffEditor:!1}function isCompositeEditor(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function getCodeEditor(n){return isCodeEditor(n)?n:isDiffEditor(n)?n.getModifiedEditor():isCompositeEditor(n)&&isCodeEditor(n.activeCodeEditor)?n.activeCodeEditor:null}class FormattingEdit{static _handleEolEdits(e,t){let i;const s=[];for(const r of t)typeof r.eol=="number"&&(i=r.eol),r.range&&typeof r.text=="string"&&s.push(r);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=StableEditorScrollState.capture(e),r=FormattingEdit._handleEolEdits(e,t);r.length===1&&FormattingEdit._isFullModelReplaceEdit(e,r[0])?e.executeEdits("formatEditsCommand",r.map(o=>EditOperation.replace(Range$2.lift(o.range),o.text))):e.executeEdits("formatEditsCommand",r.map(o=>EditOperation.replaceMove(Range$2.lift(o.range),o.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class ExtensionIdentifier{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class ExtensionIdentifierSet{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(ExtensionIdentifier.toKey(e))}has(e){return this._set.has(ExtensionIdentifier.toKey(e))}}function getRealAndSyntheticDocumentFormattersOrdered(n,e,t){const i=[],s=new ExtensionIdentifierSet,r=n.ordered(t);for(const a of r)i.push(a),a.extensionId&&s.add(a.extensionId);const o=e.ordered(t);for(const a of o){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const su=class su{static setFormatterSelector(e){return{dispose:su._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const r=Iterable.first(su._selectors);if(r)return await r(e,t,i,s)}};su._selectors=new LinkedList;let FormattingConflicts=su;async function formatDocumentRangesWithSelectedProvider(n,e,t,i,s,r,o){const a=n.get(IInstantiationService),{documentRangeFormattingEditProvider:l}=n.get(ILanguageFeaturesService),c=isCodeEditor(e)?e.getModel():e,d=l.ordered(c),u=await FormattingConflicts.select(d,c,i,2);u&&(s.report(u),await a.invokeFunction(formatDocumentRangesWithProvider,u,e,t,r,o))}async function formatDocumentRangesWithProvider(n,e,t,i,s,r){var C,S;const o=n.get(IEditorWorkerService),a=n.get(ILogService),l=n.get(IAccessibilitySignalService);let c,d;isCodeEditor(t)?(c=t.getModel(),d=new EditorStateCancellationTokenSource(t,5,void 0,s)):(c=t,d=new TextModelCancellationTokenSource(t,s));const u=[];let f=0;for(const w of asArray(i).sort(Range$2.compareRangesUsingStarts))f>0&&Range$2.areIntersectingOrTouching(u[f-1],w)?u[f-1]=Range$2.fromPositions(u[f-1].getStartPosition(),w.getEndPosition()):f=u.push(w);const g=async w=>{var I,N;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(I=e.extensionId)==null?void 0:I.value,w);const L=await e.provideDocumentRangeFormattingEdits(c,w,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(N=e.extensionId)==null?void 0:N.value,L),L},m=(w,L)=>{if(!w.length||!L.length)return!1;const I=w.reduce((N,R)=>Range$2.plusRange(N,R.range),w[0].range);if(!L.some(N=>Range$2.intersectRanges(I,N.range)))return!1;for(const N of w)for(const R of L)if(Range$2.intersectRanges(N.range,R.range))return!0;return!1},_=[],v=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(C=e.extensionId)==null?void 0:C.value,u);const w=await e.provideDocumentRangesFormattingEdits(c,u,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(S=e.extensionId)==null?void 0:S.value,w),v.push(w)}else{for(const w of u){if(d.token.isCancellationRequested)return!0;v.push(await g(w))}for(let w=0;w({text:I.text,range:Range$2.lift(I.range),forceMoveMarkers:!0})),I=>{for(const{range:N}of I)if(Range$2.areIntersectingOrTouching(N,L))return[new Selection$1(N.startLineNumber,N.startColumn,N.endLineNumber,N.endColumn)];return null})}return l.playSignal(AccessibilitySignal.format,{userGesture:r}),!0}async function formatDocumentWithSelectedProvider(n,e,t,i,s,r){const o=n.get(IInstantiationService),a=n.get(ILanguageFeaturesService),l=isCodeEditor(e)?e.getModel():e,c=getRealAndSyntheticDocumentFormattersOrdered(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await FormattingConflicts.select(c,l,t,1);d&&(i.report(d),await o.invokeFunction(formatDocumentWithProvider,d,e,t,s,r))}async function formatDocumentWithProvider(n,e,t,i,s,r){const o=n.get(IEditorWorkerService),a=n.get(IAccessibilitySignalService);let l,c;isCodeEditor(t)?(l=t.getModel(),c=new EditorStateCancellationTokenSource(t,5,void 0,s)):(l=t,c=new TextModelCancellationTokenSource(t,s));let d;try{const u=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await o.computeMoreMinimalEdits(l.uri,u),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(isCodeEditor(t))FormattingEdit.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:u}]=d,f=new Selection$1(u.startLineNumber,u.startColumn,u.endLineNumber,u.endColumn);l.pushEditOperations([f],d.map(g=>({text:g.text,range:Range$2.lift(g.range),forceMoveMarkers:!0})),g=>{for(const{range:m}of g)if(Range$2.areIntersectingOrTouching(m,f))return[new Selection$1(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)];return null})}return a.playSignal(AccessibilitySignal.format,{userGesture:r}),!0}async function getDocumentRangeFormattingEditsUntilResult(n,e,t,i,s,r){const o=e.documentRangeFormattingEditProvider.ordered(t);for(const a of o){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,r)).catch(onUnexpectedExternalError);if(isNonEmptyArray(l))return await n.computeMoreMinimalEdits(t.uri,l)}}async function getDocumentFormattingEditsUntilResult(n,e,t,i,s){const r=getRealAndSyntheticDocumentFormattersOrdered(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const o of r){const a=await Promise.resolve(o.provideDocumentFormattingEdits(t,i,s)).catch(onUnexpectedExternalError);if(isNonEmptyArray(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function getOnTypeFormattingEdits(n,e,t,i,s,r,o){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,r,o)).catch(onUnexpectedExternalError).then(l=>n.computeMoreMinimalEdits(t.uri,l))}CommandsRegistry.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;assertType(URI.isUri(t)),assertType(Range$2.isIRange(i));const r=n.get(ITextModelService),o=n.get(IEditorWorkerService),a=n.get(ILanguageFeaturesService),l=await r.createModelReference(t);try{return getDocumentRangeFormattingEditsUntilResult(o,a,l.object.textEditorModel,Range$2.lift(i),s,CancellationToken.None)}finally{l.dispose()}});CommandsRegistry.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;assertType(URI.isUri(t));const s=n.get(ITextModelService),r=n.get(IEditorWorkerService),o=n.get(ILanguageFeaturesService),a=await s.createModelReference(t);try{return getDocumentFormattingEditsUntilResult(r,o,a.object.textEditorModel,i,CancellationToken.None)}finally{a.dispose()}});CommandsRegistry.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,r]=e;assertType(URI.isUri(t)),assertType(Position$1.isIPosition(i)),assertType(typeof s=="string");const o=n.get(ITextModelService),a=n.get(IEditorWorkerService),l=n.get(ILanguageFeaturesService),c=await o.createModelReference(t);try{return getOnTypeFormattingEdits(a,l,c.object.textEditorModel,Position$1.lift(i),s,r,CancellationToken.None)}finally{c.dispose()}});EditorOptions.wrappingIndent.defaultValue=0;EditorOptions.glyphMargin.defaultValue=!1;EditorOptions.autoIndent.defaultValue=3;EditorOptions.overviewRulerLanes.defaultValue=2;FormattingConflicts.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const api=createMonacoBaseAPI();api.editor=createMonacoEditorAPI();api.languages=createMonacoLanguagesAPI();const CancellationTokenSource=api.CancellationTokenSource,Emitter=api.Emitter,KeyCode=api.KeyCode,KeyMod=api.KeyMod,Position=api.Position,Range=api.Range,Selection=api.Selection,SelectionDirection=api.SelectionDirection,MarkerSeverity=api.MarkerSeverity,MarkerTag=api.MarkerTag,Uri=api.Uri,Token=api.Token,editor=api.editor,languages=api.languages,monacoEnvironment=globalThis.MonacoEnvironment;(monacoEnvironment!=null&&monacoEnvironment.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=api);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const monaco_editor_core_star=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource,Emitter,KeyCode,KeyMod,MarkerSeverity,MarkerTag,Position,Range,Selection,SelectionDirection,Token,Uri,editor,languages},Symbol.toStringTag,{value:"Module"}));/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var __defProp$5=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__copyProps$4=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames$4(e))!__hasOwnProp$5.call(n,s)&&s!==t&&__defProp$5(n,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc$4(e,s))||i.enumerable});return n},__reExport$4=(n,e,t)=>(__copyProps$4(n,e,"default"),t&&__copyProps$4(t,e,"default")),monaco_editor_core_exports$4={};__reExport$4(monaco_editor_core_exports$4,monaco_editor_core_star);var languageDefinitions={},lazyLanguageLoaders={},LazyLanguageLoader=class Yv{static getOrCreate(e){return lazyLanguageLoaders[e]||(lazyLanguageLoaders[e]=new Yv(e)),lazyLanguageLoaders[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,languageDefinitions[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function registerLanguage(n){const e=n.id;languageDefinitions[e]=n,monaco_editor_core_exports$4.languages.register(n);const t=LazyLanguageLoader.getOrCreate(e);monaco_editor_core_exports$4.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),monaco_editor_core_exports$4.languages.onLanguageEncountered(e,async()=>{const i=await t.load();monaco_editor_core_exports$4.languages.setLanguageConfiguration(e,i.conf)})}registerLanguage({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>__vitePreload(()=>import("./abap-cc08d55d.js"),[])});registerLanguage({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>__vitePreload(()=>import("./apex-1f57875b.js"),[])});registerLanguage({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>__vitePreload(()=>import("./azcli-01f8ceb4.js"),[])});registerLanguage({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>__vitePreload(()=>import("./bat-927b90fa.js"),[])});registerLanguage({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>__vitePreload(()=>import("./bicep-b6714a33.js"),[])});registerLanguage({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>__vitePreload(()=>import("./cameligo-c6736a8d.js"),[])});registerLanguage({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>__vitePreload(()=>import("./clojure-e525a5e8.js"),[])});registerLanguage({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>__vitePreload(()=>import("./coffee-42de5eb2.js"),[])});registerLanguage({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>__vitePreload(()=>import("./cpp-18c0fc4b.js"),[])});registerLanguage({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>__vitePreload(()=>import("./cpp-18c0fc4b.js"),[])});registerLanguage({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>__vitePreload(()=>import("./csharp-a63eb606.js"),[])});registerLanguage({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>__vitePreload(()=>import("./csp-165e95c8.js"),[])});registerLanguage({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>__vitePreload(()=>import("./css-982ec3d9.js"),[])});registerLanguage({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>__vitePreload(()=>import("./cypher-2044d661.js"),[])});registerLanguage({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>__vitePreload(()=>import("./dart-95d35cad.js"),[])});registerLanguage({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>__vitePreload(()=>import("./dockerfile-4446a57c.js"),[])});registerLanguage({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>__vitePreload(()=>import("./ecl-12a2dbee.js"),[])});registerLanguage({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>__vitePreload(()=>import("./elixir-02aec513.js"),[])});registerLanguage({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>__vitePreload(()=>import("./flow9-a8f524dc.js"),[])});registerLanguage({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>__vitePreload(()=>import("./fsharp-7e8e6a66.js"),[])});registerLanguage({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagAutoInterpolationDollar)});registerLanguage({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagAngleInterpolationDollar)});registerLanguage({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagBracketInterpolationDollar)});registerLanguage({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagAngleInterpolationBracket)});registerLanguage({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagBracketInterpolationBracket)});registerLanguage({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagAutoInterpolationDollar)});registerLanguage({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>__vitePreload(()=>import("./freemarker2-15df4423.js"),[]).then(n=>n.TagAutoInterpolationBracket)});registerLanguage({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>__vitePreload(()=>import("./go-9d89e322.js"),[])});registerLanguage({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>__vitePreload(()=>import("./graphql-ed4730b7.js"),[])});registerLanguage({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>__vitePreload(()=>import("./handlebars-f8531685.js"),[])});registerLanguage({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>__vitePreload(()=>import("./hcl-fb184eb8.js"),[])});registerLanguage({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:()=>__vitePreload(()=>import("./html-e81aba02.js"),[])});registerLanguage({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>__vitePreload(()=>import("./ini-d685139c.js"),[])});registerLanguage({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>__vitePreload(()=>import("./java-e24ca7a1.js"),[])});registerLanguage({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>__vitePreload(()=>import("./javascript-55e941ca.js"),["assets/javascript-55e941ca.js","assets/typescript-fa167985.js"])});registerLanguage({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>__vitePreload(()=>import("./julia-2ac6394f.js"),[])});registerLanguage({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>__vitePreload(()=>import("./kotlin-8fc662c8.js"),[])});registerLanguage({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>__vitePreload(()=>import("./less-bfd58748.js"),[])});registerLanguage({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>__vitePreload(()=>import("./lexon-bac7d755.js"),[])});registerLanguage({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>__vitePreload(()=>import("./lua-2826648b.js"),[])});registerLanguage({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>__vitePreload(()=>import("./liquid-be167f18.js"),[])});registerLanguage({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>__vitePreload(()=>import("./m3-3d2e9f6f.js"),[])});registerLanguage({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>__vitePreload(()=>import("./markdown-661fcb5a.js"),[])});registerLanguage({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>__vitePreload(()=>import("./mdx-50b11892.js"),[])});registerLanguage({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>__vitePreload(()=>import("./mips-2dce1757.js"),[])});registerLanguage({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>__vitePreload(()=>import("./msdax-00a309df.js"),[])});registerLanguage({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>__vitePreload(()=>import("./mysql-98cf3b47.js"),[])});registerLanguage({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>__vitePreload(()=>import("./objective-c-cc56e969.js"),[])});registerLanguage({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>__vitePreload(()=>import("./pascal-81aa0fca.js"),[])});registerLanguage({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>__vitePreload(()=>import("./pascaligo-48ad6fd9.js"),[])});registerLanguage({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>__vitePreload(()=>import("./perl-88f67ba4.js"),[])});registerLanguage({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>__vitePreload(()=>import("./pgsql-5ed4bbd0.js"),[])});registerLanguage({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>__vitePreload(()=>import("./php-b4f95778.js"),[])});registerLanguage({id:"pla",extensions:[".pla"],loader:()=>__vitePreload(()=>import("./pla-5b1cff9f.js"),[])});registerLanguage({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>__vitePreload(()=>import("./postiats-85929be7.js"),[])});registerLanguage({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>__vitePreload(()=>import("./powerquery-b7a070c4.js"),[])});registerLanguage({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>__vitePreload(()=>import("./powershell-b8a6d6cc.js"),[])});registerLanguage({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>__vitePreload(()=>import("./protobuf-05455955.js"),[])});registerLanguage({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>__vitePreload(()=>import("./pug-90925ab8.js"),[])});registerLanguage({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>__vitePreload(()=>import("./python-6a1add52.js"),[])});registerLanguage({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>__vitePreload(()=>import("./qsharp-a069f29b.js"),[])});registerLanguage({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>__vitePreload(()=>import("./r-12e54150.js"),[])});registerLanguage({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>__vitePreload(()=>import("./razor-4da4db25.js"),[])});registerLanguage({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>__vitePreload(()=>import("./redis-bb3a1b76.js"),[])});registerLanguage({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>__vitePreload(()=>import("./redshift-df35d8cf.js"),[])});registerLanguage({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>__vitePreload(()=>import("./restructuredtext-d6d2caf0.js"),[])});registerLanguage({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>__vitePreload(()=>import("./ruby-9316b7ff.js"),[])});registerLanguage({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>__vitePreload(()=>import("./rust-21ab97eb.js"),[])});registerLanguage({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>__vitePreload(()=>import("./sb-b997d7c8.js"),[])});registerLanguage({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:()=>__vitePreload(()=>import("./scala-400099bb.js"),[])});registerLanguage({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>__vitePreload(()=>import("./scheme-b34f1909.js"),[])});registerLanguage({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>__vitePreload(()=>import("./scss-04141591.js"),[])});registerLanguage({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>__vitePreload(()=>import("./shell-1832544c.js"),[])});registerLanguage({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>__vitePreload(()=>import("./solidity-895ee769.js"),[])});registerLanguage({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>__vitePreload(()=>import("./sophia-3e132745.js"),[])});registerLanguage({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>__vitePreload(()=>import("./sparql-e38155f4.js"),[])});registerLanguage({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>__vitePreload(()=>import("./sql-528ba10f.js"),[])});registerLanguage({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>__vitePreload(()=>import("./st-56011ceb.js"),[])});registerLanguage({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>__vitePreload(()=>import("./swift-c11249a1.js"),[])});registerLanguage({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>__vitePreload(()=>import("./systemverilog-6707b904.js"),[])});registerLanguage({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>__vitePreload(()=>import("./systemverilog-6707b904.js"),[])});registerLanguage({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>__vitePreload(()=>import("./tcl-5b54d5c8.js"),[])});registerLanguage({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>__vitePreload(()=>import("./twig-6e0ba59b.js"),[])});registerLanguage({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>__vitePreload(()=>import("./typescript-fa167985.js"),[])});registerLanguage({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>__vitePreload(()=>import("./typespec-cd8d2038.js"),[])});registerLanguage({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>__vitePreload(()=>import("./vb-f5dd6a56.js"),[])});registerLanguage({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>__vitePreload(()=>import("./wgsl-093fb352.js"),[])});registerLanguage({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\__vitePreload(()=>import("./xml-88932010.js"),[])});registerLanguage({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>__vitePreload(()=>import("./yaml-aa5efee0.js"),[])});/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var __defProp$4=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__getOwnPropNames$3=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__copyProps$3=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames$3(e))!__hasOwnProp$4.call(n,s)&&s!==t&&__defProp$4(n,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc$3(e,s))||i.enumerable});return n},__reExport$3=(n,e,t)=>(__copyProps$3(n,e,"default"),t&&__copyProps$3(t,e,"default")),monaco_editor_core_exports$3={};__reExport$3(monaco_editor_core_exports$3,monaco_editor_core_star);var LanguageServiceDefaultsImpl$3=class{constructor(e,t,i){this._onDidChange=new monaco_editor_core_exports$3.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},optionsDefault$1={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}},modeConfigurationDefault$2={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},cssDefaults=new LanguageServiceDefaultsImpl$3("css",optionsDefault$1,modeConfigurationDefault$2),scssDefaults=new LanguageServiceDefaultsImpl$3("scss",optionsDefault$1,modeConfigurationDefault$2),lessDefaults=new LanguageServiceDefaultsImpl$3("less",optionsDefault$1,modeConfigurationDefault$2);monaco_editor_core_exports$3.languages.css={cssDefaults,lessDefaults,scssDefaults};function getMode$3(){return __vitePreload(()=>import("./cssMode-7d2e7cbc.js"),[])}monaco_editor_core_exports$3.languages.onLanguage("less",()=>{getMode$3().then(n=>n.setupMode(lessDefaults))});monaco_editor_core_exports$3.languages.onLanguage("scss",()=>{getMode$3().then(n=>n.setupMode(scssDefaults))});monaco_editor_core_exports$3.languages.onLanguage("css",()=>{getMode$3().then(n=>n.setupMode(cssDefaults))});/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var __defProp$3=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__hasOwnProp$3=Object.prototype.hasOwnProperty,__copyProps$2=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames$2(e))!__hasOwnProp$3.call(n,s)&&s!==t&&__defProp$3(n,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc$2(e,s))||i.enumerable});return n},__reExport$2=(n,e,t)=>(__copyProps$2(n,e,"default"),t&&__copyProps$2(t,e,"default")),monaco_editor_core_exports$2={};__reExport$2(monaco_editor_core_exports$2,monaco_editor_core_star);var LanguageServiceDefaultsImpl$2=class{constructor(e,t,i){this._onDidChange=new monaco_editor_core_exports$2.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},formatDefaults={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"},optionsDefault={format:formatDefaults,suggest:{},data:{useDefaultDataProvider:!0}};function getConfigurationDefault(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===htmlLanguageId,documentFormattingEdits:n===htmlLanguageId,documentRangeFormattingEdits:n===htmlLanguageId}}var htmlLanguageId="html",handlebarsLanguageId="handlebars",razorLanguageId="razor",htmlLanguageService=registerHTMLLanguageService(htmlLanguageId,optionsDefault,getConfigurationDefault(htmlLanguageId)),htmlDefaults=htmlLanguageService.defaults,handlebarLanguageService=registerHTMLLanguageService(handlebarsLanguageId,optionsDefault,getConfigurationDefault(handlebarsLanguageId)),handlebarDefaults=handlebarLanguageService.defaults,razorLanguageService=registerHTMLLanguageService(razorLanguageId,optionsDefault,getConfigurationDefault(razorLanguageId)),razorDefaults=razorLanguageService.defaults;monaco_editor_core_exports$2.languages.html={htmlDefaults,razorDefaults,handlebarDefaults,htmlLanguageService,handlebarLanguageService,razorLanguageService,registerHTMLLanguageService};function getMode$2(){return __vitePreload(()=>import("./htmlMode-beaa838d.js"),[])}function registerHTMLLanguageService(n,e=optionsDefault,t=getConfigurationDefault(n)){const i=new LanguageServiceDefaultsImpl$2(n,e,t);let s;const r=monaco_editor_core_exports$2.languages.onLanguage(n,async()=>{s=(await getMode$2()).setupMode(i)});return{defaults:i,dispose(){r.dispose(),s==null||s.dispose(),s=void 0}}}/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var __defProp$2=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__hasOwnProp$2=Object.prototype.hasOwnProperty,__copyProps$1=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames$1(e))!__hasOwnProp$2.call(n,s)&&s!==t&&__defProp$2(n,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc$1(e,s))||i.enumerable});return n},__reExport$1=(n,e,t)=>(__copyProps$1(n,e,"default"),t&&__copyProps$1(t,e,"default")),monaco_editor_core_exports$1={};__reExport$1(monaco_editor_core_exports$1,monaco_editor_core_star);var LanguageServiceDefaultsImpl$1=class{constructor(e,t,i){this._onDidChange=new monaco_editor_core_exports$1.Emitter,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},diagnosticDefault={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},modeConfigurationDefault$1={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},jsonDefaults=new LanguageServiceDefaultsImpl$1("json",diagnosticDefault,modeConfigurationDefault$1),getWorker=()=>getMode$1().then(n=>n.getWorker());monaco_editor_core_exports$1.languages.json={jsonDefaults,getWorker};function getMode$1(){return __vitePreload(()=>import("./jsonMode-321e5ed1.js"),[])}monaco_editor_core_exports$1.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});monaco_editor_core_exports$1.languages.onLanguage("json",()=>{getMode$1().then(n=>n.setupMode(jsonDefaults))});/*!----------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1) + * Released under the MIT license + * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt + *-----------------------------------------------------------------------------*/var __defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp$1=Object.prototype.hasOwnProperty,__copyProps=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames(e))!__hasOwnProp$1.call(n,s)&&s!==t&&__defProp$1(n,s,{get:()=>e[s],enumerable:!(i=__getOwnPropDesc(e,s))||i.enumerable});return n},__reExport=(n,e,t)=>(__copyProps(n,e,"default"),t&&__copyProps(t,e,"default")),typescriptVersion="5.4.5",monaco_editor_core_exports={};__reExport(monaco_editor_core_exports,monaco_editor_core_star);var ModuleKind=(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))(ModuleKind||{}),JsxEmit=(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))(JsxEmit||{}),NewLineKind=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(NewLineKind||{}),ScriptTarget=(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))(ScriptTarget||{}),ModuleResolutionKind=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(ModuleResolutionKind||{}),LanguageServiceDefaultsImpl=class{constructor(n,e,t,i,s){this._onDidChange=new monaco_editor_core_exports.Emitter,this._onDidExtraLibsChange=new monaco_editor_core_exports.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(s),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let s=this._extraLibs[t];s&&s.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let s=1;this._removedExtraLibs[t]&&(s=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:s}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},typescriptVersion2=typescriptVersion,modeConfigurationDefault={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},typescriptDefaults=new LanguageServiceDefaultsImpl({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},modeConfigurationDefault),javascriptDefaults=new LanguageServiceDefaultsImpl({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},modeConfigurationDefault),getTypeScriptWorker=()=>getMode().then(n=>n.getTypeScriptWorker()),getJavaScriptWorker=()=>getMode().then(n=>n.getJavaScriptWorker());monaco_editor_core_exports.languages.typescript={ModuleKind,JsxEmit,NewLineKind,ScriptTarget,ModuleResolutionKind,typescriptVersion:typescriptVersion2,typescriptDefaults,javascriptDefaults,getTypeScriptWorker,getJavaScriptWorker};function getMode(){return __vitePreload(()=>import("./tsMode-02961a96.js"),[])}monaco_editor_core_exports.languages.onLanguage("typescript",()=>getMode().then(n=>n.setupTypeScript(typescriptDefaults)));monaco_editor_core_exports.languages.onLanguage("javascript",()=>getMode().then(n=>n.setupJavaScript(javascriptDefaults)));class ToggleCollapseUnchangedRegions extends Action2{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:localize2("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Codicon.map,toggled:ContextKeyExpr.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ContextKeyExpr.has("isInDiffEditor"),menu:{when:ContextKeyExpr.has("isInDiffEditor"),id:MenuId.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(IConfigurationService),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class ToggleShowMovedCodeBlocks extends Action2{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:localize2("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ContextKeyExpr.has("isInDiffEditor")})}run(e,...t){const i=e.get(IConfigurationService),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class ToggleUseInlineViewWhenSpaceIsLimited extends Action2{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:localize2("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ContextKeyExpr.has("isInDiffEditor")})}run(e,...t){const i=e.get(IConfigurationService),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const diffEditorCategory=localize2("diffEditor","Diff Editor");class SwitchSide extends EditorAction2{constructor(){super({id:"diffEditor.switchSide",title:localize2("switchSide","Switch Side"),icon:Codicon.arrowSwap,precondition:ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:diffEditorCategory})}runEditorCommand(e,t,i){const s=findFocusedDiffEditor(e);if(s instanceof DiffEditorWidget){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class ExitCompareMove extends EditorAction2{constructor(){super({id:"diffEditor.exitCompareMove",title:localize2("exitCompareMove","Exit Compare Move"),icon:Codicon.close,precondition:EditorContextKeys.comparingMovedCode,f1:!1,category:diffEditorCategory,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=findFocusedDiffEditor(e);s instanceof DiffEditorWidget&&s.exitCompareMove()}}class CollapseAllUnchangedRegions extends EditorAction2{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:localize2("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Codicon.fold,precondition:ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:diffEditorCategory})}runEditorCommand(e,t,...i){const s=findFocusedDiffEditor(e);s instanceof DiffEditorWidget&&s.collapseAllUnchangedRegions()}}class ShowAllUnchangedRegions extends EditorAction2{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:localize2("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Codicon.unfold,precondition:ContextKeyExpr.has("isInDiffEditor"),f1:!0,category:diffEditorCategory})}runEditorCommand(e,t,...i){const s=findFocusedDiffEditor(e);s instanceof DiffEditorWidget&&s.showAllUnchangedRegions()}}class RevertHunkOrSelection extends Action2{constructor(){super({id:"diffEditor.revert",title:localize2("revert","Revert"),f1:!1,category:diffEditorCategory})}run(e,t){const i=findDiffEditor(e,t.originalUri,t.modifiedUri);i instanceof DiffEditorWidget&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const accessibleDiffViewerCategory=localize2("accessibleDiffViewer","Accessible Diff Viewer"),pg=class pg extends Action2{constructor(){super({id:pg.id,title:localize2("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:accessibleDiffViewerCategory,precondition:ContextKeyExpr.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=findFocusedDiffEditor(e);t==null||t.accessibleDiffViewerNext()}};pg.id="editor.action.accessibleDiffViewer.next";let AccessibleDiffViewerNext=pg;const mg=class mg extends Action2{constructor(){super({id:mg.id,title:localize2("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:accessibleDiffViewerCategory,precondition:ContextKeyExpr.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=findFocusedDiffEditor(e);t==null||t.accessibleDiffViewerPrev()}};mg.id="editor.action.accessibleDiffViewer.prev";let AccessibleDiffViewerPrev=mg;function findDiffEditor(n,e,t){return n.get(ICodeEditorService).listDiffEditors().find(r=>{var l,c;const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function findFocusedDiffEditor(n){const t=n.get(ICodeEditorService).listDiffEditors(),i=getActiveElement();if(i)for(const s of t){const r=s.getContainerDomNode();if(isElementOrParentOf(r,i))return s}return null}function isElementOrParentOf(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}registerAction2(ToggleCollapseUnchangedRegions);registerAction2(ToggleShowMovedCodeBlocks);registerAction2(ToggleUseInlineViewWhenSpaceIsLimited);MenuRegistry.appendMenuItem(MenuId.EditorTitle,{command:{id:new ToggleUseInlineViewWhenSpaceIsLimited().desc.id,title:localize("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ContextKeyExpr.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ContextKeyExpr.has("isInDiffEditor")},order:11,group:"1_diff",when:ContextKeyExpr.and(EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached,ContextKeyExpr.has("isInDiffEditor"))});MenuRegistry.appendMenuItem(MenuId.EditorTitle,{command:{id:new ToggleShowMovedCodeBlocks().desc.id,title:localize("showMoves","Show Moved Code Blocks"),icon:Codicon.move,toggled:ContextKeyEqualsExpr.create("config.diffEditor.experimental.showMoves",!0),precondition:ContextKeyExpr.has("isInDiffEditor")},order:10,group:"1_diff",when:ContextKeyExpr.has("isInDiffEditor")});registerAction2(RevertHunkOrSelection);for(const n of[{icon:Codicon.arrowRight,key:EditorContextKeys.diffEditorInlineMode.toNegated()},{icon:Codicon.discard,key:EditorContextKeys.diffEditorInlineMode}])MenuRegistry.appendMenuItem(MenuId.DiffEditorHunkToolbar,{command:{id:new RevertHunkOrSelection().desc.id,title:localize("revertHunk","Revert Block"),icon:n.icon},when:ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),MenuRegistry.appendMenuItem(MenuId.DiffEditorSelectionToolbar,{command:{id:new RevertHunkOrSelection().desc.id,title:localize("revertSelection","Revert Selection"),icon:n.icon},when:ContextKeyExpr.and(EditorContextKeys.diffEditorModifiedWritable,n.key),order:5,group:"primary"});registerAction2(SwitchSide);registerAction2(ExitCompareMove);registerAction2(CollapseAllUnchangedRegions);registerAction2(ShowAllUnchangedRegions);MenuRegistry.appendMenuItem(MenuId.EditorTitle,{command:{id:AccessibleDiffViewerNext.id,title:localize("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ContextKeyExpr.has("isInDiffEditor")},order:10,group:"2_diff",when:ContextKeyExpr.and(EditorContextKeys.accessibleDiffViewerVisible.negate(),ContextKeyExpr.has("isInDiffEditor"))});CommandsRegistry.registerCommandAlias("editor.action.diffReview.next",AccessibleDiffViewerNext.id);registerAction2(AccessibleDiffViewerNext);CommandsRegistry.registerCommandAlias("editor.action.diffReview.prev",AccessibleDiffViewerPrev.id);registerAction2(AccessibleDiffViewerPrev);const anchorSelect="";var __decorate$1C=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1C=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SelectionAnchorController_1;const SelectionAnchorSet=new RawContextKey("selectionAnchorSet",!1);var Il;let SelectionAnchorController=(Il=class{static get(e){return e.getContribution(SelectionAnchorController_1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=SelectionAnchorSet.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(Selection$1.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new MarkdownString().appendText(localize("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),alert$1(localize("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(Selection$1.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()}},SelectionAnchorController_1=Il,Il.ID="editor.contrib.selectionAnchorController",Il);SelectionAnchorController=SelectionAnchorController_1=__decorate$1C([__param$1C(1,IContextKeyService)],SelectionAnchorController);class SetSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.setSelectionAnchor",label:localize("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2080),weight:100}})}async run(e,t){var i;(i=SelectionAnchorController.get(t))==null||i.setSelectionAnchor()}}class GoToSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.goToSelectionAnchor",label:localize("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:SelectionAnchorSet})}async run(e,t){var i;(i=SelectionAnchorController.get(t))==null||i.goToSelectionAnchor()}}class SelectFromAnchorToCursor extends EditorAction{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:localize("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:SelectionAnchorSet,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2089),weight:100}})}async run(e,t){var i;(i=SelectionAnchorController.get(t))==null||i.selectFromAnchorToCursor()}}class CancelSelectionAnchor extends EditorAction{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:localize("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:SelectionAnchorSet,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=SelectionAnchorController.get(t))==null||i.cancelSelectionAnchor()}}registerEditorContribution(SelectionAnchorController.ID,SelectionAnchorController,4);registerEditorAction(SetSelectionAnchor);registerEditorAction(GoToSelectionAnchor);registerEditorAction(SelectFromAnchorToCursor);registerEditorAction(CancelSelectionAnchor);const bracketMatching="",overviewRulerBracketMatchForeground=registerColor("editorOverviewRuler.bracketMatchForeground","#A0A0A0",localize("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class JumpToBracketAction extends EditorAction{constructor(){super({id:"editor.action.jumpToBracket",label:localize("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=BracketMatchingController.get(t))==null||i.jumpToBracket()}}class SelectToBracketAction extends EditorAction{constructor(){super({id:"editor.action.selectToBracket",label:localize("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:localize2("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var r;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(r=BracketMatchingController.get(t))==null||r.selectToBracket(s)}}class RemoveBracketsAction extends EditorAction{constructor(){super({id:"editor.action.removeBrackets",label:localize("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=BracketMatchingController.get(t))==null||i.removeBrackets(this.id)}}class BracketsData{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const ao=class ao extends Disposable{static get(e){return e.getContribution(ao.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new RunOnceScheduler(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),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(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),r=e.bracketPairs.matchBracket(s);let o=null;if(r)r[0].containsPosition(s)&&!r[1].containsPosition(s)?o=r[1].getStartPosition():r[1].containsPosition(s)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(o=l.range.getStartPosition())}}return o?new Selection$1(o.lineNumber,o.column,o.lineNumber,o.column):new Selection$1(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const r=s.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const c=t.bracketPairs.findNextBracket(r);c&&c.range&&(o=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(Range$2.compareRangesUsingStarts);const[c,d]=o;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(r)){const u=a;a=l,l=u}}a&&l&&i.push(new Selection$1(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let r=t.bracketPairs.matchBracket(s);r||(r=t.bracketPairs.findEnclosingBrackets(s)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const r=[];let o=0;for(let u=0,f=e.length;u1&&r.sort(Position$1.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,f=r.length;u0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}registerEditorAction(TransposeLettersAction);const generateUuid=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let s=0;sn,asFile:()=>{},value:typeof n=="string"?n:void 0}}function createFileDataTransferItem(n,e,t){const i={id:generateUuid(),name:n,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class VSDataTransfer{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 Iterable.some(this,([i,s])=>s.asFile())&&t.push("files"),matchesMimeType_normalized(normalizeMimeType(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?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 normalizeMimeType(e)}}function normalizeMimeType(n){return n.toLowerCase()}function matchesMimeType(n,e){return matchesMimeType_normalized(normalizeMimeType(n),e.map(normalizeMimeType))}function matchesMimeType_normalized(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,r]=t;return r==="*"?e.some(o=>o.startsWith(s+"/")):!1}const UriList=Object.freeze({create:n=>distinct(n.map(e=>e.toString())).join(`\r +`),split:n=>n.split(`\r +`),parse:n=>UriList.split(n).filter(e=>!e.startsWith("#"))}),as=class as{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+as.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new as((this.value?[this.value,...e]:e).join(as.sep))}};as.sep=".",as.None=new as("@@none@@"),as.Empty=new as("");let HierarchicalKind=as;const CodeDataTransfers={EDITORS:"CodeEditors",FILES:"CodeFiles"};class DragAndDropContributionRegistry{}const Extensions={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Registry.add(Extensions.DragAndDropContribution,new DragAndDropContributionRegistry);const ru=class ru{constructor(){}static getInstance(){return ru.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};ru.INSTANCE=new ru;let LocalSelectionTransfer=ru;function toVSDataTransfer(n){const e=new VSDataTransfer;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(r=>t.getAsString(r));e.append(i,createStringDataTransferItem(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,createFileDataTransferItemFromFile(s))}}return e}function createFileDataTransferItemFromFile(n){const e=n.path?URI.parse(n.path):void 0;return createFileDataTransferItem(n.name,e,async()=>new Uint8Array(await n.arrayBuffer()))}const INTERNAL_DND_MIME_TYPES=Object.freeze([CodeDataTransfers.EDITORS,CodeDataTransfers.FILES,DataTransfers.RESOURCES,DataTransfers.INTERNAL_URI_LIST]);function toExternalVSDataTransfer(n,e=!1){const t=toVSDataTransfer(n),i=t.get(DataTransfers.INTERNAL_URI_LIST);if(i)t.replace(Mimes.uriList,i);else if(e||!t.has(Mimes.uriList)){const s=[];for(const r of n.items){const o=r.getAsFile();if(o){const a=o.path;try{a?s.push(URI.file(a).toString()):s.push(URI.parse(o.name,!0).toString())}catch{}}}s.length&&t.replace(Mimes.uriList,createStringDataTransferItem(UriList.create(s)))}for(const s of INTERNAL_DND_MIME_TYPES)t.delete(s);return t}var __decorate$1B=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1B=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class SimplePasteAndDropProvider{async provideDocumentPasteEdits(e,t,i,s,r){const o=await this.getEdit(i,r);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}}const ou=class ou extends SimplePasteAndDropProvider{constructor(){super(...arguments),this.kind=ou.kind,this.dropMimeTypes=[Mimes.text],this.pasteMimeTypes=[Mimes.text]}async getEdit(e,t){const i=e.get(Mimes.text);if(!i||e.has(Mimes.uriList))return;const s=await i.asString();return{handledMimeType:Mimes.text,title:localize("text.label","Insert Plain Text"),insertText:s,kind:this.kind}}};ou.id="text",ou.kind=new HierarchicalKind("text.plain");let DefaultTextPasteOrDropEditProvider=ou;class PathProvider extends SimplePasteAndDropProvider{constructor(){super(...arguments),this.kind=new HierarchicalKind("uri.absolute"),this.dropMimeTypes=[Mimes.uriList],this.pasteMimeTypes=[Mimes.uriList]}async getEdit(e,t){const i=await extractUriList(e);if(!i.length||t.isCancellationRequested)return;let s=0;const r=i.map(({uri:a,originalText:l})=>a.scheme===Schemas.file?a.fsPath:(s++,l)).join(" ");let o;return s>0?o=i.length>1?localize("defaultDropProvider.uriList.uris","Insert Uris"):localize("defaultDropProvider.uriList.uri","Insert Uri"):o=i.length>1?localize("defaultDropProvider.uriList.paths","Insert Paths"):localize("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Mimes.uriList,insertText:r,title:o,kind:this.kind}}}let RelativePathProvider=class extends SimplePasteAndDropProvider{constructor(e){super(),this._workspaceContextService=e,this.kind=new HierarchicalKind("uri.relative"),this.dropMimeTypes=[Mimes.uriList],this.pasteMimeTypes=[Mimes.uriList]}async getEdit(e,t){const i=await extractUriList(e);if(!i.length||t.isCancellationRequested)return;const s=coalesce(i.map(({uri:r})=>{const o=this._workspaceContextService.getWorkspaceFolder(r);return o?relativePath(o.uri,r):void 0}));if(s.length)return{handledMimeType:Mimes.uriList,insertText:s.join(" "),title:i.length>1?localize("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):localize("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};RelativePathProvider=__decorate$1B([__param$1B(0,IWorkspaceContextService)],RelativePathProvider);class PasteHtmlProvider{constructor(){this.kind=new HierarchicalKind("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Mimes.text}]}async provideDocumentPasteEdits(e,t,i,s,r){var l;if(s.triggerKind!==DocumentPasteTriggerKind.PasteAs&&!((l=s.only)!=null&&l.contains(this.kind)))return;const o=i.get("text/html"),a=await(o==null?void 0:o.asString());if(!(!a||r.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:localize("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function extractUriList(n){const e=n.get(Mimes.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of UriList.parse(t))try{i.push({uri:URI.parse(s),originalText:s})}catch{}return i}let DefaultDropProvidersFeature=class extends Disposable{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new DefaultTextPasteOrDropEditProvider)),this._register(e.documentDropEditProvider.register("*",new PathProvider)),this._register(e.documentDropEditProvider.register("*",new RelativePathProvider(t)))}};DefaultDropProvidersFeature=__decorate$1B([__param$1B(0,ILanguageFeaturesService),__param$1B(1,IWorkspaceContextService)],DefaultDropProvidersFeature);let DefaultPasteProvidersFeature=class extends Disposable{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new DefaultTextPasteOrDropEditProvider)),this._register(e.documentPasteEditProvider.register("*",new PathProvider)),this._register(e.documentPasteEditProvider.register("*",new RelativePathProvider(t))),this._register(e.documentPasteEditProvider.register("*",new PasteHtmlProvider))}};DefaultPasteProvidersFeature=__decorate$1B([__param$1B(0,ILanguageFeaturesService),__param$1B(1,IWorkspaceContextService)],DefaultPasteProvidersFeature);const Fn=class Fn{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=Fn._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(Fn.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(Fn.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(Fn.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(Fn.isVariableCharacter(i)||Fn.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Fn._table[i]>"u"&&!Fn.isDigitCharacter(i)&&!Fn.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};Fn._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Scanner=Fn;class Marker{constructor(){this._children=[]}appendChild(e){return e instanceof Text&&this._children[this._children.length-1]instanceof Text?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),r=i.children.slice(0);r.splice(s,1,...t),i._children=r,function o(a,l){for(const c of a)c.parent=l,o(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof TextmateSnippet)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Text extends Marker{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Text(this.value)}}class TransformableMarker extends Marker{}class Placeholder extends TransformableMarker{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 Choice?this._children[0]:void 0}clone(){const e=new Placeholder(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Choice extends Marker{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Text&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Choice;return this.options.forEach(e.appendChild,e),e}}class Transform extends Marker{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(r=>r instanceof FormatString&&!!r.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof FormatString){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new Transform;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 FormatString extends Marker{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new FormatString(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Variable extends TransformableMarker{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 Text(t)],!0):!1}clone(){const e=new Variable(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function walk(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class TextmateSnippet extends Marker{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Placeholder&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return walk([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Placeholder&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Variable&&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 TextmateSnippet;return this._children=this.children.map(t=>t.clone()),e}walk(e){walk(this.children,e)}}class SnippetParser{constructor(){this._scanner=new Scanner,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new TextmateSnippet;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,r=[];t.walk(l=>(l instanceof Placeholder&&(l.isFinalTabstop?s.set(0,void 0):!s.has(l.index)&&l.children.length>0?s.set(l.index,l.children):r.push(l)),!0));const o=(l,c)=>{const d=s.get(l.index);if(!d)return;const u=new Placeholder(l.index);u.transform=l.transform;for(const f of d){const g=f.clone();u.appendChild(g),g instanceof Placeholder&&s.has(g.index)&&!c.has(g.index)&&(c.add(g.index),o(g,c),c.delete(g.index))}t.replace(l,[u])},a=new Set;for(const l of r)o(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new Placeholder(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Text(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 Placeholder(Number(t)):new Variable(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 r=new Placeholder(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Text("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const o=new Choice;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(o),this._accept(4)))return e.appendChild(r),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Text(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 r=new Variable(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Text("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseTransform(e){const t=new Transform;let i="",s="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,i+=r;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new Text(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new FormatString(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new FormatString(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new FormatString(Number(s),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new FormatString(Number(s),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new FormatString(Number(s),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const o=this._until(4);if(o)return e.appendChild(new FormatString(Number(s),void 0,r,o)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new FormatString(Number(s),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Text(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function createCombinedWorkspaceEdit(n,e,t){var i,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(r=>new ResourceTextEdit(n,{range:r,text:typeof t.insertText=="string"?SnippetParser.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((s=t.additionalEdit)==null?void 0:s.edits)??[]]}}function sortEditsByYieldTo(n){function e(o,a){return"mimeType"in o?o.mimeType===a.handledMimeType:!!a.kind&&o.kind.contains(a.kind)}const t=new Map;for(const o of n)for(const a of o.yieldTo??[])for(const l of n)if(l!==o&&e(a,l)){let c=t.get(o);c||(c=[],t.set(o,c)),c.push(l)}if(!t.size)return Array.from(n);const i=new Set,s=[];function r(o){if(!o.length)return[];const a=o[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),o;if(i.has(a))return r(o.slice(1));let l=[];const c=t.get(a);return c&&(s.push(a),l=r(c),s.pop()),i.add(a),[...l,a,...r(o.slice(1))]}return r(Array.from(n))}const inlineProgressWidget="";var __decorate$1A=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1A=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const inlineProgressDecoration=ModelDecorationOptions.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:noBreakWhitespace,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),_g=class _g extends Disposable{constructor(e,t,i,s,r){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=$$e(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=$$e("span.icon");this.domNode.append(t),t.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(67);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(52)||s.hasChanged(67))&&i()})),this._register(addDisposableListener(this.domNode,EventType$1.CLICK,s=>{this.delegate.cancel()}))}getId(){return _g.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)}};_g.baseId="editor.widget.inlineProgressWidget";let InlineProgressWidget=_g,InlineProgressManager=class extends Disposable{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new MutableDisposable),this._currentWidget=this._register(new MutableDisposable),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,s,r){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=disposableTimeout(()=>{const a=Range$2.fromPositions(e);this._currentDecorations.set([{range:a,options:inlineProgressDecoration}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(InlineProgressWidget,this.id,this._editor,a,t,s))},r??this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};InlineProgressManager=__decorate$1A([__param$1A(2,IInstantiationService)],InlineProgressManager);const messageController="";var __decorate$1z=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1z=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MessageController_1,la;let MessageController=(la=class{static get(e){return e.getContribution(MessageController_1.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new MutableDisposable,this._messageListeners=new DisposableStore,this._mouseOverMessage=!1,this._editor=e,this._visible=MessageController_1.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){alert$1(isMarkdownString(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=isMarkdownString(e)?renderMarkdown(e,{actionHandler:{callback:s=>{this.closeMessage(),openLinkFromMarkdown(this._openerService,s,isMarkdownString(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new MessageWidget$1(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Event$1.debounce(this._editor.onDidBlurEditorText,(s,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&isAncestor$1(getActiveElement(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(addDisposableListener(this._messageWidget.value.getDomNode(),EventType$1.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(addDisposableListener(this._messageWidget.value.getDomNode(),EventType$1.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new Range$2(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(MessageWidget$1.fadeOut(this._messageWidget.value))}},MessageController_1=la,la.ID="editor.contrib.messageController",la.MESSAGE_VISIBLE=new RawContextKey("messageVisible",!1,localize("messageVisible","Whether the editor is currently showing an inline message")),la);MessageController=MessageController_1=__decorate$1z([__param$1z(1,IContextKeyService),__param$1z(2,IOpenerService)],MessageController);const MessageCommand=EditorCommand.bindToContribution(MessageController.get);registerEditorCommand(new MessageCommand({id:"leaveEditorMessage",precondition:MessageController.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let MessageWidget$1=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const o=document.createElement("div");typeof s=="string"?(o.classList.add("message"),o.textContent=s):(s.classList.add("message"),o.appendChild(s)),this._domNode.appendChild(o);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)}};registerEditorContribution(MessageController.ID,MessageController,4);function exceptionToErrorMessage(n,e){return e&&(n.stack||n.stacktrace)?localize("stackTrace.format","{0}: {1}",detectSystemErrorMessage(n),stackToString(n.stack)||stackToString(n.stacktrace)):detectSystemErrorMessage(n)}function stackToString(n){return Array.isArray(n)?n.join(` +`):n}function detectSystemErrorMessage(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?localize("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||localize("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function toErrorMessage(n=null,e=!1){if(!n)return localize("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=coalesce(n),i=toErrorMessage(t[0],e);return t.length>1?localize("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(isString$3(n))return n;if(n.detail){const t=n.detail;if(t.error)return exceptionToErrorMessage(t.error,e);if(t.exception)return exceptionToErrorMessage(t.exception,e)}return n.stack?exceptionToErrorMessage(n,e):n.message?n.message:localize("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}const postEditWidget="";var __decorate$1y=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1y=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PostEditWidget_1,Tl;let PostEditWidget=(Tl=class extends Disposable{constructor(e,t,i,s,r,o,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=r,this.edits=o,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(toDisposable(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(toDisposable(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{r.containsPosition(u.position)||this.dispose()})),this._register(Event$1.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=$$e(".post-edit-widget"),this.button=this._register(new Button(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(addDisposableListener(this.domNode,EventType$1.CLICK,()=>this.showSelector()))}getId(){return PostEditWidget_1.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=getDomNodePagePosition(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>toAction({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},PostEditWidget_1=Tl,Tl.baseId="editor.widget.postEditWidget",Tl);PostEditWidget=PostEditWidget_1=__decorate$1y([__param$1y(7,IContextMenuService),__param$1y(8,IContextKeyService),__param$1y(9,IKeybindingService)],PostEditWidget);let PostEditWidgetManager=class extends Disposable{constructor(e,t,i,s,r,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._instantiationService=r,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new MutableDisposable),this._register(Event$1.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,r){const o=this._editor.getModel();if(!o||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async v=>{const C=this._editor.getModel();C&&(await C.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,s,r))},c=(v,C)=>{isCancellationError(v)||(this._notificationService.error(C),i&&this.show(e[0],t,l))};let d;try{d=await s(a,r)}catch(v){return c(v,localize("resolveError",`Error resolving edit '{0}': +{1}`,a.title,toErrorMessage(v)))}if(r.isCancellationRequested)return;const u=createCombinedWorkspaceEdit(o.uri,e,d),f=e[0],g=o.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let m,_;try{m=await this._bulkEditService.apply(u,{editor:this._editor,token:r}),_=o.getDecorationRange(g[0])}catch(v){return c(v,localize("applyError",`Error applying edit '{0}': +{1}`,a.title,toErrorMessage(v)))}finally{o.deltaDecorations(g,[])}r.isCancellationRequested||i&&m.isApplied&&t.allEdits.length>1&&this.show(_??f,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(PostEditWidget,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)==null||e.showSelector()}};PostEditWidgetManager=__decorate$1y([__param$1y(4,IInstantiationService),__param$1y(5,IBulkEditService),__param$1y(6,INotificationService)],PostEditWidgetManager);var __decorate$1x=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1x=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CopyPasteController_1;const changePasteTypeCommandId="editor.changePasteType",pasteWidgetVisibleCtx=new RawContextKey("pasteWidgetVisible",!1,localize("pasteWidgetVisible","Whether the paste widget is showing")),vscodeClipboardMime="application/vnd.code.copyMetadata";var Dl;let CopyPasteController=(Dl=class extends Disposable{static get(e){return e.getContribution(CopyPasteController_1.ID)}constructor(e,t,i,s,r,o,a){super(),this._bulkEditService=i,this._clipboardService=s,this._languageFeaturesService=r,this._quickInputService=o,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(addDisposableListener(l,"copy",c=>this.handleCopy(c))),this._register(addDisposableListener(l,"cut",c=>this.handleCopy(c))),this._register(addDisposableListener(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new InlineProgressManager("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(PostEditWidgetManager,"pasteIntoEditor",e,pasteWidgetVisibleCtx,{id:changePasteTypeCommandId,label:localize("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},getActiveDocument().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var _,v,C,S;if(!this._editor.hasTextFocus()||((v=(_=this._clipboardService).clearInternalState)==null||v.call(_),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!(i!=null&&i.length))return;const s=this._editor.getOption(37);let r=i;const o=i.length===1&&i[0].isEmpty();if(o){if(!s)return;r=[new Range$2(r[0].startLineNumber,1,r[0].startLineNumber,1+t.getLineLength(r[0].startLineNumber))]}const a=(C=this._editor._getViewModel())==null?void 0:C.getPlainTextToCopy(i,s,isWindows),c={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:o,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(w=>!!w.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:c});return}const u=toVSDataTransfer(e.clipboardData),f=d.flatMap(w=>w.copyMimeTypes??[]),g=generateUuid();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:f,defaultPastePayload:c});const m=createCancelablePromise(async w=>{const L=coalesce(await Promise.all(d.map(async I=>{try{return await I.prepareDocumentPaste(t,r,u,w)}catch(N){console.error(N);return}})));L.reverse();for(const I of L)for(const[N,R]of I)u.replace(N,R);return u});(S=CopyPasteController_1._currentCopyOperation)==null||S.dataTransferPromise.cancel(),CopyPasteController_1._currentCopyOperation={handle:g,dataTransferPromise:m}}async handlePaste(e){var l,c,d;if(!e.clipboardData||!this._editor.hasTextFocus())return;(l=MessageController.get(this._editor))==null||l.closeMessage(),(c=this._currentPasteOperation)==null||c.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!(i!=null&&i.length)||!t||this._editor.getOption(92)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e),r=toExternalVSDataTransfer(e.clipboardData);r.delete(vscodeClipboardMime);const o=[...e.clipboardData.types,...(s==null?void 0:s.providerCopyMimeTypes)??[],Mimes.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(u=>{var g,m;const f=(g=this._pasteAsActionContext)==null?void 0:g.preferred;return f&&u.providedPasteEditKinds&&!this.providerMatchesPreference(u,f)?!1:(m=u.pasteMimeTypes)==null?void 0:m.some(_=>matchesMimeType(_,o))});if(!a.length){(d=this._pasteAsActionContext)!=null&&d.preferred&&this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,r,s):this.doPasteInline(a,i,r,s,e)}showPasteAsNoEditMessage(e,t){var i;(i=MessageController.get(this._editor))==null||i.showMessage(localize("pasteAsError","No paste edits for '{0}' found",t instanceof HierarchicalKind?t.value:t.providerId),e[0].getStartPosition())}doPasteInline(e,t,i,s,r){const o=this._editor;if(!o.hasModel())return;const a=new EditorStateCancellationTokenSource(o,3,void 0),l=createCancelablePromise(async c=>{const d=this._editor;if(!d.hasModel())return;const u=d.getModel(),f=new DisposableStore,g=f.add(new CancellationTokenSource$1(c));f.add(a.token.onCancellationRequested(()=>g.cancel()));const m=g.token;try{if(await this.mergeInDataFromCopy(i,s,m),m.isCancellationRequested)return;const _=e.filter(S=>this.isSupportedPasteProvider(S,i));if(!_.length||_.length===1&&_[0]instanceof DefaultTextPasteOrDropEditProvider)return this.applyDefaultPasteHandler(i,s,m,r);const v={triggerKind:DocumentPasteTriggerKind.Automatic},C=await this.getPasteEdits(_,i,u,t,v,m);if(f.add(C),m.isCancellationRequested)return;if(C.edits.length===1&&C.edits[0].provider instanceof DefaultTextPasteOrDropEditProvider)return this.applyDefaultPasteHandler(i,s,m,r);if(C.edits.length){const S=d.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:C.edits},S,(w,L)=>new Promise((I,N)=>{(async()=>{var R,T;try{const A=(T=(R=w.provider).resolveDocumentPasteEdit)==null?void 0:T.call(R,w,L),F=new DeferredPromise,B=A&&await this._pasteProgressManager.showWhile(t[0].getEndPosition(),localize("resolveProcess","Resolving paste edit. Click to cancel"),Promise.race([F.p,A]),{cancel:()=>(F.cancel(),N(new CancellationError))},0);return B&&(w.additionalEdit=B.additionalEdit),I(w)}catch(A){return N(A)}})()}),m)}await this.applyDefaultPasteHandler(i,s,m,r)}finally{f.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),localize("pasteIntoEditorProgress","Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{try{if(l.cancel(),a.token.isCancellationRequested)return;await this.applyDefaultPasteHandler(i,s,a.token,r)}finally{a.dispose()}}}).then(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,s,r){const o=createCancelablePromise(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new DisposableStore,u=d.add(new EditorStateCancellationTokenSource(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(s,r,u.token),u.token.isCancellationRequested)return;let f=t.filter(C=>this.isSupportedPasteProvider(C,s,e));e&&(f=f.filter(C=>this.providerMatchesPreference(C,e)));const g={triggerKind:DocumentPasteTriggerKind.PasteAs,only:e&&e instanceof HierarchicalKind?e:void 0};let m=d.add(await this.getPasteEdits(f,s,c,i,g,u.token));if(u.token.isCancellationRequested)return;if(e&&(m={edits:m.edits.filter(C=>e instanceof HierarchicalKind?e.contains(C.kind):e.providerId===C.provider.id),dispose:m.dispose}),!m.edits.length){g.only&&this.showPasteAsNoEditMessage(i,g.only);return}let _;if(e)_=m.edits.at(0);else{const C=await this._quickInputService.pick(m.edits.map(S=>{var w;return{label:S.title,description:(w=S.kind)==null?void 0:w.value,edit:S}}),{placeHolder:localize("pasteAsPickerPlaceholder","Select Paste Action")});_=C==null?void 0:C.edit}if(!_)return;const v=createCombinedWorkspaceEdit(c.uri,i,_);await this._bulkEditService.apply(v,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:localize("pasteAsProgress","Running paste handlers")},()=>o)}setCopyMetadata(e,t){e.setData(vscodeClipboardMime,JSON.stringify(t))}fetchCopyMetadata(e){if(!e.clipboardData)return;const t=e.clipboardData.getData(vscodeClipboardMime);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=ClipboardEventUtils.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var s;if(t!=null&&t.id&&((s=CopyPasteController_1._currentCopyOperation)==null?void 0:s.handle)===t.id){const r=await CopyPasteController_1._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[o,a]of r)e.replace(o,a)}if(!e.has(Mimes.uriList)){const r=await this._clipboardService.readResources();if(i.isCancellationRequested)return;r.length&&e.append(Mimes.uriList,createStringDataTransferItem(UriList.create(r)))}}async getPasteEdits(e,t,i,s,r,o){const a=new DisposableStore,l=await raceCancellation(Promise.all(e.map(async d=>{var u,f;try{const g=await((u=d.provideDocumentPasteEdits)==null?void 0:u.call(d,i,s,t,r,o));return g&&a.add(g),(f=g==null?void 0:g.edits)==null?void 0:f.map(m=>({...m,provider:d}))}catch(g){isCancellationError(g)||console.error(g);return}})),o),c=coalesce(l??[]).flat().filter(d=>!r.only||r.only.contains(d.kind));return{edits:sortEditsByYieldTo(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,s){const r=e.get(Mimes.text)??e.get("text"),o=await(r==null?void 0:r.asString())??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:o,pasteOnNewLine:(t==null?void 0:t.defaultPastePayload.pasteOnNewLine)??!1,multicursorText:(t==null?void 0:t.defaultPastePayload.multicursorText)??null,mode:null};this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){var s;return(s=e.pasteMimeTypes)!=null&&s.some(r=>t.matches(r))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return t instanceof HierarchicalKind?e.providedPasteEditKinds?e.providedPasteEditKinds.some(i=>t.contains(i)):!0:e.id===t.providerId}},CopyPasteController_1=Dl,Dl.ID="editor.contrib.copyPasteActionController",Dl);CopyPasteController=CopyPasteController_1=__decorate$1x([__param$1x(1,IInstantiationService),__param$1x(2,IBulkEditService),__param$1x(3,IClipboardService),__param$1x(4,ILanguageFeaturesService),__param$1x(5,IQuickInputService),__param$1x(6,IProgressService)],CopyPasteController);const CLIPBOARD_CONTEXT_MENU_GROUP="9_cutcopypaste",supportsCut=isNative||document.queryCommandSupported("cut"),supportsCopy=isNative||document.queryCommandSupported("copy"),supportsPaste=typeof navigator.clipboard>"u"||isFirefox?document.queryCommandSupported("paste"):!0;function registerCommand(n){return n.register(),n}const CutAction=supportsCut?registerCommand(new MultiCommand({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:isNative?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.cutLabel","Cut"),when:EditorContextKeys.writable,order:1},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.cutLabel","Cut"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.cutLabel","Cut"),when:EditorContextKeys.writable,order:1}]})):void 0,CopyAction=supportsCopy?registerCommand(new MultiCommand({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:isNative?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.copyLabel","Copy"),order:2},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.copyLabel","Copy"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;MenuRegistry.appendMenuItem(MenuId.MenubarEditMenu,{submenu:MenuId.MenubarCopy,title:localize2("copy as","Copy As"),group:"2_ccp",order:3});MenuRegistry.appendMenuItem(MenuId.EditorContext,{submenu:MenuId.EditorContextCopy,title:localize2("copy as","Copy As"),group:CLIPBOARD_CONTEXT_MENU_GROUP,order:3});MenuRegistry.appendMenuItem(MenuId.EditorContext,{submenu:MenuId.EditorContextShare,title:localize2("share","Share"),group:"11_share",order:-1,when:ContextKeyExpr.and(ContextKeyExpr.notEquals("resourceScheme","output"),EditorContextKeys.editorTextFocus)});MenuRegistry.appendMenuItem(MenuId.ExplorerContext,{submenu:MenuId.ExplorerContextShare,title:localize2("share","Share"),group:"11_share",order:-1});const PasteAction=supportsPaste?registerCommand(new MultiCommand({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:isNative?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:MenuId.MenubarEditMenu,group:"2_ccp",title:localize({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:MenuId.EditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.pasteLabel","Paste"),when:EditorContextKeys.writable,order:4},{menuId:MenuId.CommandPalette,group:"",title:localize("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:MenuId.SimpleEditorContext,group:CLIPBOARD_CONTEXT_MENU_GROUP,title:localize("actions.clipboard.pasteLabel","Paste"),when:EditorContextKeys.writable,order:4}]})):void 0;class ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:localize("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(CopyOptions.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),CopyOptions.forceCopyWithSyntaxHighlighting=!1)}}function registerExecCommandImpl(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(ICodeEditorService).getFocusedCodeEditor();if(s&&s.hasTextFocus()){const r=s.getOption(37),o=s.getSelection();return o&&o.isEmpty()&&!r||s.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(getActiveDocument().execCommand(e),!0)))}registerExecCommandImpl(CutAction,"cut");registerExecCommandImpl(CopyAction,"copy");PasteAction&&(PasteAction.addImplementation(1e4,"code-editor",(n,e)=>{var r;const t=n.get(ICodeEditorService),i=n.get(IClipboardService),s=t.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?((r=CopyPasteController.get(s))==null?void 0:r.finishedPaste())??Promise.resolve():isWeb?(async()=>{const a=await i.readText();if(a!==""){const l=InMemoryClipboardMetadataManager.INSTANCE.get(a);let c=!1,d=null,u=null;l&&(c=s.getOption(37)&&!!l.isFromEmptySelection,d=typeof l.multicursorText<"u"?l.multicursorText:null,u=l.mode),s.trigger("keyboard","paste",{text:a,pasteOnNewLine:c,multicursorText:d,mode:u})}})():!0:!1}),PasteAction.addImplementation(0,"generic-dom",(n,e)=>(getActiveDocument().execCommand("paste"),!0)));supportsCopy&®isterEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);const CodeActionKind=new class{constructor(){this.QuickFix=new HierarchicalKind("quickfix"),this.Refactor=new HierarchicalKind("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new HierarchicalKind("notebook"),this.Source=new HierarchicalKind("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var CodeActionTriggerSource;(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"})(CodeActionTriggerSource||(CodeActionTriggerSource={}));function mayIncludeActionsOfKind(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>excludesAction(e,t,n.include))||!n.includeSourceActions&&CodeActionKind.Source.contains(e))}function filtersAction(n,e){const t=e.kind?new HierarchicalKind(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>excludesAction(t,i,n.include))||!n.includeSourceActions&&t&&CodeActionKind.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function excludesAction(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class CodeActionCommandArgs{static fromUser(e,t){return!e||typeof e!="object"?new CodeActionCommandArgs(t.kind,t.apply,!1):new CodeActionCommandArgs(CodeActionCommandArgs.getKindFromUser(e,t.kind),CodeActionCommandArgs.getApplyFromUser(e,t.apply),CodeActionCommandArgs.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 HierarchicalKind(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 CodeActionItem{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if((t=this.provider)!=null&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(s){onUnexpectedExternalError(s)}i&&(this.action.edit=i.edit)}return this}}const codeActionCommandId="editor.action.codeAction",quickFixCommandId="editor.action.quickFix",autoFixCommandId="editor.action.autoFix",refactorCommandId="editor.action.refactor",sourceActionCommandId="editor.action.sourceAction",organizeImportsCommandId="editor.action.organizeImports",fixAllCommandId="editor.action.fixAll";class ManagedCodeActionSet extends Disposable{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:isNonEmptyArray(e.diagnostics)?isNonEmptyArray(t.diagnostics)?ManagedCodeActionSet.codeActionsPreferredComparator(e,t):-1:isNonEmptyArray(t.diagnostics)?1:ManagedCodeActionSet.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(ManagedCodeActionSet.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&CodeActionKind.QuickFix.contains(new HierarchicalKind(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const emptyCodeActionsResponse={actions:[],documentation:void 0};async function getCodeActions(n,e,t,i,s,r){var _;const o=i.filter||{},a={...o,excludes:[...o.excludes||[],CodeActionKind.Notebook]},l={only:(_=o.include)==null?void 0:_.value,trigger:i.type},c=new TextModelCancellationTokenSource(e,r),d=i.type===2,u=getCodeActionProviders(n,e,d?a:o),f=new DisposableStore,g=u.map(async v=>{try{s.report(v);const C=await v.provideCodeActions(e,t,l,c.token);if(C&&f.add(C),c.token.isCancellationRequested)return emptyCodeActionsResponse;const S=((C==null?void 0:C.actions)||[]).filter(L=>L&&filtersAction(o,L)),w=getDocumentationFromProvider(v,S,o.include);return{actions:S.map(L=>new CodeActionItem(L,v)),documentation:w}}catch(C){if(isCancellationError(C))throw C;return onUnexpectedExternalError(C),emptyCodeActionsResponse}}),m=n.onDidChange(()=>{const v=n.all(e);equals$1(v,u)||c.cancel()});try{const v=await Promise.all(g),C=v.map(w=>w.actions).flat(),S=[...coalesce(v.map(w=>w.documentation)),...getAdditionalDocumentationForShowingActions(n,e,i,C)];return new ManagedCodeActionSet(C,S,f)}finally{m.dispose(),c.dispose()}}function getCodeActionProviders(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>mayIncludeActionsOfKind(t,new HierarchicalKind(s))):!0)}function*getAdditionalDocumentationForShowingActions(n,e,t,i){var s,r,o;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)==null?void 0:o.call(a,{trigger:t.type,only:(r=(s=t.filter)==null?void 0:s.include)==null?void 0:r.value},i.map(l=>l.action)))}function getDocumentationFromProvider(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new HierarchicalKind(s.kind),command:s.command}));if(t){let s;for(const r of i)r.kind.contains(t)&&(s?s.kind.contains(r.kind)&&(s=r):s=r);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const r of i)if(r.kind.contains(new HierarchicalKind(s.kind)))return r.command}}var ApplyCodeActionReason;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb"})(ApplyCodeActionReason||(ApplyCodeActionReason={}));async function applyCodeAction(n,e,t,i,s=CancellationToken.None){var c;const r=n.get(IBulkEditService),o=n.get(ICommandService),a=n.get(ITelemetryService),l=n.get(INotificationService);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(s),!s.isCancellationRequested&&!((c=e.action.edit)!=null&&c.edits.length&&!(await r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==ApplyCodeActionReason.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{await o.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=asMessage(d);l.error(typeof u=="string"?u:localize("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function asMessage(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}CommandsRegistry.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof URI))throw illegalArgument();const{codeActionProvider:r}=n.get(ILanguageFeaturesService),o=n.get(IModelService).getModel(e);if(!o)throw illegalArgument();const a=Selection$1.isISelection(t)?Selection$1.liftSelection(t):Range$2.isIRange(t)?o.validateRange(t):void 0;if(!a)throw illegalArgument();const l=typeof i=="string"?new HierarchicalKind(i):void 0,c=await getCodeActions(r,o,a,{type:1,triggerAction:CodeActionTriggerSource.Default,filter:{includeSourceActions:!0,include:l}},Progress.None,CancellationToken.None),d=[],u=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let f=0;ff.action)}finally{setTimeout(()=>c.dispose(),100)}});var __decorate$1w=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1w=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CodeActionKeybindingResolver_1,Nl;let CodeActionKeybindingResolver=(Nl=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Lazy(()=>this.keybindingService.getKeybindings().filter(t=>CodeActionKeybindingResolver_1.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===organizeImportsCommandId?i={kind:CodeActionKind.SourceOrganizeImports.value}:t.command===fixAllCommandId&&(i={kind:CodeActionKind.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...CodeActionCommandArgs.fromUser(i,{kind:HierarchicalKind.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 HierarchicalKind(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,r)=>s?s.kind.contains(r.kind)?r:s:r,void 0)}},CodeActionKeybindingResolver_1=Nl,Nl.codeActionCommands=[refactorCommandId,codeActionCommandId,sourceActionCommandId,organizeImportsCommandId,fixAllCommandId],Nl);CodeActionKeybindingResolver=CodeActionKeybindingResolver_1=__decorate$1w([__param$1w(0,IKeybindingService)],CodeActionKeybindingResolver);const codicon="",codiconModifiers="",symbolIcons="";registerColor("symbolIcon.arrayForeground",foreground,localize("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.booleanForeground",foreground,localize("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},localize("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.colorForeground",foreground,localize("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.constantForeground",foreground,localize("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},localize("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},localize("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},localize("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},localize("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},localize("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.fileForeground",foreground,localize("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.folderForeground",foreground,localize("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},localize("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},localize("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.keyForeground",foreground,localize("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.keywordForeground",foreground,localize("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},localize("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.moduleForeground",foreground,localize("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.namespaceForeground",foreground,localize("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.nullForeground",foreground,localize("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.numberForeground",foreground,localize("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.objectForeground",foreground,localize("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.operatorForeground",foreground,localize("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.packageForeground",foreground,localize("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.propertyForeground",foreground,localize("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.referenceForeground",foreground,localize("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.snippetForeground",foreground,localize("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.stringForeground",foreground,localize("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.structForeground",foreground,localize("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.textForeground",foreground,localize("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.typeParameterForeground",foreground,localize("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.unitForeground",foreground,localize("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));registerColor("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},localize("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const uncategorizedCodeActionGroup=Object.freeze({kind:HierarchicalKind.Empty,title:localize("codeAction.widget.id.more","More Actions...")}),codeActionGroups=Object.freeze([{kind:CodeActionKind.QuickFix,title:localize("codeAction.widget.id.quickfix","Quick Fix")},{kind:CodeActionKind.RefactorExtract,title:localize("codeAction.widget.id.extract","Extract"),icon:Codicon.wrench},{kind:CodeActionKind.RefactorInline,title:localize("codeAction.widget.id.inline","Inline"),icon:Codicon.wrench},{kind:CodeActionKind.RefactorRewrite,title:localize("codeAction.widget.id.convert","Rewrite"),icon:Codicon.wrench},{kind:CodeActionKind.RefactorMove,title:localize("codeAction.widget.id.move","Move"),icon:Codicon.wrench},{kind:CodeActionKind.SurroundWith,title:localize("codeAction.widget.id.surround","Surround With"),icon:Codicon.surroundWith},{kind:CodeActionKind.Source,title:localize("codeAction.widget.id.source","Source Action"),icon:Codicon.symbolFile},uncategorizedCodeActionGroup]);function toMenuItems(n,e,t){if(!e)return n.map(r=>{var o;return{kind:"action",item:r,group:uncategorizedCodeActionGroup,disabled:!!r.action.disabled,label:r.action.disabled||r.action.title,canPreview:!!((o=r.action.edit)!=null&&o.edits.length)}});const i=codeActionGroups.map(r=>({group:r,actions:[]}));for(const r of n){const o=r.action.kind?new HierarchicalKind(r.action.kind):HierarchicalKind.None;for(const a of i)if(a.group.kind.contains(o)){a.actions.push(r);break}}const s=[];for(const r of i)if(r.actions.length){s.push({kind:"header",group:r.group});for(const o of r.actions){const a=r.group;s.push({kind:"action",item:o,group:o.action.isAI?{title:a.title,kind:a.kind,icon:Codicon.sparkle}:a,label:o.action.title,disabled:!!o.action.disabled,keybinding:t(o.action)})}}return s}const lightBulbWidget="";var __decorate$1v=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1v=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},LightBulbWidget_1;const GUTTER_LIGHTBULB_ICON=registerIcon("gutter-lightbulb",Codicon.lightBulb,localize("gutterLightbulbWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor.")),GUTTER_LIGHTBULB_AUTO_FIX_ICON=registerIcon("gutter-lightbulb-auto-fix",Codicon.lightbulbAutofix,localize("gutterLightbulbAutoFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),GUTTER_LIGHTBULB_AIFIX_ICON=registerIcon("gutter-lightbulb-sparkle",Codicon.lightbulbSparkle,localize("gutterLightbulbAIFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON=registerIcon("gutter-lightbulb-aifix-auto-fix",Codicon.lightbulbSparkleAutofix,localize("gutterLightbulbAIFixAutoFixWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),GUTTER_SPARKLE_FILLED_ICON=registerIcon("gutter-lightbulb-sparkle-filled",Codicon.sparkleFilled,localize("gutterLightbulbSparkleFilledWidget","Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var LightBulbState;(function(n){n.Hidden={type:0};class e{constructor(i,s,r,o){this.actions=i,this.trigger=s,this.editorPosition=r,this.widgetPosition=o,this.type=1}}n.Showing=e})(LightBulbState||(LightBulbState={}));var So;let LightBulbWidget=(So=class extends Disposable{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new Emitter$1),this.onClick=this._onClick.event,this._state=LightBulbState.Hidden,this._gutterState=LightBulbState.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+GUTTER_LIGHTBULB_ICON.id,"codicon-"+GUTTER_LIGHTBULB_AIFIX_AUTO_FIX_ICON.id,"codicon-"+GUTTER_LIGHTBULB_AUTO_FIX_ICON.id,"codicon-"+GUTTER_LIGHTBULB_AIFIX_ICON.id,"codicon-"+GUTTER_SPARKLE_FILLED_ICON.id],this.gutterDecoration=LightBulbWidget_1.GUTTER_DECORATION,this._domNode=$$e("div.lightBulbWidget"),this._domNode.role="listbox",this._register(Gesture.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide(),(this.gutterState.type!==1||!s||this.gutterState.editorPosition.lineNumber>=s.getLineCount())&&this.gutterHide()})),this._register(addStandardDisposableGenericMouseDownListener(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:r}=getDomNodePagePosition(this._domNode),o=this._editor.getOption(67);let a=Math.floor(o/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(Event$1.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var i,s;this._preferredKbLabel=((i=this._keybindingService.lookupKeybinding(autoFixCommandId))==null?void 0:i.getLabel())??void 0,this._quickFixKbLabel=((s=this._keybindingService.lookupKeybinding(quickFixCommandId))==null?void 0:s.getLabel())??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:s,height:r}=getDomNodePagePosition(i.target.element),o=this._editor.getOption(67);let a=Math.floor(o/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,m=I=>I>2&&this._editor.getTopForLineNumber(I)===this._editor.getTopForLineNumber(I-1),_=this._editor.getLineDecorations(a);let v=!1;if(_)for(const I of _){const N=I.options.glyphMarginClassName;if(N&&!this.lightbulbClasses.some(R=>N.includes(R))){v=!0;break}}let C=a,S=1;if(!g){const I=N=>{const R=o.getLineContent(N);return/^\s*$|^\s+/.test(R)||R.length<=S};if(a>1&&!m(a-1)){const N=o.getLineCount(),R=a===N,T=a>1&&I(a-1),A=!R&&I(a+1),F=I(a),B=!A&&!T;if(!A&&!T&&!v)return this.gutterState=new LightBulbState.Showing(e,t,i,{position:{lineNumber:C,column:S},preference:LightBulbWidget_1._posPref}),this.renderGutterLightbub(),this.hide();T||R||T&&!F?C-=1:(A||B&&F)&&(C+=1)}else if(a===1&&(a===o.getLineCount()||!I(a+1)&&!I(a)))if(this.gutterState=new LightBulbState.Showing(e,t,i,{position:{lineNumber:C,column:S},preference:LightBulbWidget_1._posPref}),v)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a{this._gutterDecorationID=t.addDecoration(new Range$2(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new Range$2(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=localize("codeActionAutoRun","Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=localize("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=localize("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=localize("codeAction","Show Code Actions")))}set title(e){this._domNode.title=e}},LightBulbWidget_1=So,So.GUTTER_DECORATION=ModelDecorationOptions.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:ThemeIcon.asClassName(Codicon.lightBulb),glyphMargin:{position:GlyphMarginLane.Left},stickiness:1}),So.ID="editor.contrib.lightbulbWidget",So._posPref=[0],So);LightBulbWidget=LightBulbWidget_1=__decorate$1v([__param$1v(1,IKeybindingService)],LightBulbWidget);const actionWidget="";var __decorate$1u=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1u=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const acceptSelectedActionCommand="acceptSelectedCodeAction",previewSelectedActionCommand="previewSelectedCodeAction";class HeaderRenderer{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s;i.text.textContent=((s=e.group)==null?void 0:s.title)??""}disposeTemplate(e){}}let ActionItemRenderer=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new KeybindingLabel(e,OS$1);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){var o,a,l;if((o=e.group)!=null&&o.icon?(i.icon.className=ThemeIcon.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=asCssVariable(e.group.icon.color.id))):(i.icon.className=ThemeIcon.asClassName(Codicon.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=stripNewlines(e.label),i.keybinding.set(e.keybinding),setVisibility(!!e.keybinding,i.keybinding.element);const s=(a=this._keybindingService.lookupKeybinding(acceptSelectedActionCommand))==null?void 0:a.getLabel(),r=(l=this._keybindingService.lookupKeybinding(previewSelectedActionCommand))==null?void 0:l.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:s&&r?this._supportsPreview&&e.canPreview?i.container.title=localize({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to Apply, Shift+F2 to Preview"']},"{0} to Apply, {1} to Preview",s,r):i.container.title=localize({key:"label",comment:['placeholder is a keybinding, e.g "F2 to Apply"']},"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};ActionItemRenderer=__decorate$1u([__param$1u(1,IKeybindingService)],ActionItemRenderer);class AcceptSelectedEvent extends UIEvent{constructor(){super("acceptSelectedAction")}}class PreviewSelectedEvent extends UIEvent{constructor(){super("previewSelectedAction")}}function getKeyboardNavigationLabel(n){if(n.kind==="action")return n.label}let ActionList=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._delegate=s,this._contextViewService=r,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new CancellationTokenSource$1),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 List(e,this.domNode,a,[new ActionItemRenderer(t,this._keybindingService),new HeaderRenderer],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?stripNewlines(l==null?void 0:l.label):"";return l.disabled&&(c=localize({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>localize({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(defaultListStyles),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);let r=e;if(this._allMenuItems.length>=50)r=380;else{const l=this._allMenuItems.map((c,d)=>{const u=this.domNode.ownerDocument.getElementById(this._list.getElementID(d));if(u){u.style.width="auto";const f=u.getBoundingClientRect().width;return u.style.width="",f}return 0});r=Math.max(...l,e)}const o=.7,a=Math.min(s,this.domNode.ownerDocument.body.clientHeight*o);return this._list.layout(a,r),this.domNode.style.height=`${a}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const r=e?new PreviewSelectedEvent:new AcceptSelectedEvent;this._list.setSelection([i],r)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof PreviewSelectedEvent):this._list.setSelection([])}onFocus(){var s,r;const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);(r=(s=this._delegate).onFocus)==null||r.call(s,i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};ActionList=__decorate$1u([__param$1u(4,IContextViewService),__param$1u(5,IKeybindingService)],ActionList);function stripNewlines(n){return n.replace(/\r\n|\r|\n/g," ")}var __decorate$1t=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};registerColor("actionBar.toggledBackground",inputActiveOptionBackground,localize("actionBar.toggledBackground","Background color for toggled action items in action bar."));const ActionWidgetContextKeys={Visible:new RawContextKey("codeActionMenuVisible",!1,localize("codeActionMenuVisible","Whether the action widget list is visible"))},IActionWidgetService=createDecorator("actionWidgetService");let ActionWidgetService=class extends Disposable{get isVisible(){return ActionWidgetContextKeys.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new MutableDisposable)}show(e,t,i,s,r,o,a){const l=ActionWidgetContextKeys.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(ActionList,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>r,render:d=>(l.set(!0),this._renderWidget(d,c,a??[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},o,!1)}acceptSelected(e){var t;(t=this._list.value)==null||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusNext()}hide(e){var t;(t=this._list.value)==null||t.hide(e),this._list.clear()}_renderWidget(e,t,i){var g;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new DisposableStore,o=document.createElement("div"),a=e.appendChild(o);a.classList.add("context-view-block"),r.add(addDisposableListener(a,EventType$1.MOUSE_DOWN,m=>m.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),r.add(addDisposableListener(c,EventType$1.POINTER_MOVE,()=>c.remove())),r.add(addDisposableListener(c,EventType$1.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const m=this._createActionBar(".action-widget-action-bar",i);m&&(s.appendChild(m.getContainer().parentElement),r.add(m),d=m.getContainer().offsetWidth)}const u=(g=this._list.value)==null?void 0:g.layout(d);s.style.width=`${u}px`;const f=r.add(trackFocus(e));return r.add(f.onDidBlur(()=>this.hide(!0))),r}_createActionBar(e,t){if(!t.length)return;const i=$$e(e),s=new ActionBar(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)==null||t.hide(e)}};ActionWidgetService=__decorate$1t([__param$1t(0,IContextViewService),__param$1t(1,IContextKeyService),__param$1t(2,IInstantiationService)],ActionWidgetService);registerSingleton(IActionWidgetService,ActionWidgetService,1);const weight$3=100+1e3;registerAction2(class extends Action2{constructor(){super({id:"hideCodeActionWidget",title:localize2("hideCodeActionWidget.title","Hide action widget"),precondition:ActionWidgetContextKeys.Visible,keybinding:{weight:weight$3,primary:9,secondary:[1033]}})}run(n){n.get(IActionWidgetService).hide(!0)}});registerAction2(class extends Action2{constructor(){super({id:"selectPrevCodeAction",title:localize2("selectPrevCodeAction.title","Select previous action"),precondition:ActionWidgetContextKeys.Visible,keybinding:{weight:weight$3,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(IActionWidgetService);e instanceof ActionWidgetService&&e.focusPrevious()}});registerAction2(class extends Action2{constructor(){super({id:"selectNextCodeAction",title:localize2("selectNextCodeAction.title","Select next action"),precondition:ActionWidgetContextKeys.Visible,keybinding:{weight:weight$3,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(IActionWidgetService);e instanceof ActionWidgetService&&e.focusNext()}});registerAction2(class extends Action2{constructor(){super({id:acceptSelectedActionCommand,title:localize2("acceptSelected.title","Accept selected action"),precondition:ActionWidgetContextKeys.Visible,keybinding:{weight:weight$3,primary:3,secondary:[2137]}})}run(n){const e=n.get(IActionWidgetService);e instanceof ActionWidgetService&&e.acceptSelected()}});registerAction2(class extends Action2{constructor(){super({id:previewSelectedActionCommand,title:localize2("previewSelected.title","Preview selected action"),precondition:ActionWidgetContextKeys.Visible,keybinding:{weight:weight$3,primary:2051}})}run(n){const e=n.get(IActionWidgetService);e instanceof ActionWidgetService&&e.acceptSelected(!0)}});const SUPPORTED_CODE_ACTIONS=new RawContextKey("supportedCodeAction",""),APPLY_FIX_ALL_COMMAND_ID="_typescript.applyFixAllCodeAction";class CodeActionOracle extends Disposable{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new TimeoutTimer),this._register(this._markerService.onMarkerChanged(r=>this._onMarkerChanges(r))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>isEqual(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:CodeActionTriggerSource.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(65).enabled;if(i!==ShowLightbulbIconMode$1.Off){{if(i===ShowLightbulbIconMode$1.On)return t;if(i===ShowLightbulbIconMode$1.OnCode){if(!t.isEmpty())return t;const r=this._editor.getModel(),{lineNumber:o,column:a}=t.getPosition(),l=r.getLineContent(o);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===r.getLineMaxColumn(o)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var CodeActionsState;(function(n){n.Empty={type:0};class e{constructor(i,s,r){this.trigger=i,this.position=s,this._cancellablePromise=r,this.type=1,this.actions=r.catch(o=>{if(isCancellationError(o))return emptyCodeActionSet;throw o})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(CodeActionsState||(CodeActionsState={}));const emptyCodeActionSet=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class CodeActionModel extends Disposable{constructor(e,t,i,s,r,o,a){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=r,this._configurationService=o,this._telemetryService=a,this._codeActionOracle=this._register(new MutableDisposable),this._state=CodeActionsState.Empty,this._onDidChangeState=this._register(new Emitter$1),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=SUPPORTED_CODE_ACTIONS.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(l=>{l.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(CodeActionsState.Empty,!0))}_settingEnabledNearbyQuickfixes(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e==null?void 0:e.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(CodeActionsState.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(92)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new CodeActionOracle(this._editor,this._markerService,i=>{var l;if(!i){this.setState(CodeActionsState.Empty);return}const s=i.selection.getStartPosition(),r=createCancelablePromise(async c=>{var d,u,f,g,m,_,v,C,S,w;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===CodeActionTriggerSource.QuickFix||(u=(d=i.trigger.filter)==null?void 0:d.include)!=null&&u.contains(CodeActionKind.QuickFix))){const L=await getCodeActions(this._registry,e,i.selection,i.trigger,Progress.None,c),I=[...L.allActions];if(c.isCancellationRequested)return emptyCodeActionSet;const N=(f=L.validActions)==null?void 0:f.some(T=>T.action.kind?CodeActionKind.QuickFix.contains(new HierarchicalKind(T.action.kind)):!1),R=this._markerService.read({resource:e.uri});if(N){for(const T of L.validActions)(m=(g=T.action.command)==null?void 0:g.arguments)!=null&&m.some(A=>typeof A=="string"&&A.includes(APPLY_FIX_ALL_COMMAND_ID))&&(T.action.diagnostics=[...R.filter(A=>A.relatedInformation)]);return{validActions:L.validActions,allActions:I,documentation:L.documentation,hasAutoFix:L.hasAutoFix,hasAIFix:L.hasAIFix,allAIFixes:L.allAIFixes,dispose:()=>{L.dispose()}}}else if(!N&&R.length>0){const T=i.selection.getPosition();let A=T,F=Number.MAX_VALUE;const B=[...L.validActions];for(const G of R){const j=G.endColumn,K=G.endLineNumber,ee=G.startLineNumber;if(K===T.lineNumber||ee===T.lineNumber){A=new Position$1(K,j);const U={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:(_=i.trigger.filter)!=null&&_.include?(v=i.trigger.filter)==null?void 0:v.include:CodeActionKind.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((C=i.trigger.context)==null?void 0:C.notAvailableMessage)||"",position:A}},q=new Selection$1(A.lineNumber,A.column,A.lineNumber,A.column),Q=await getCodeActions(this._registry,e,q,U,Progress.None,c);if(Q.validActions.length!==0){for(const ce of Q.validActions)(w=(S=ce.action.command)==null?void 0:S.arguments)!=null&&w.some(ie=>typeof ie=="string"&&ie.includes(APPLY_FIX_ALL_COMMAND_ID))&&(ce.action.diagnostics=[...R.filter(ie=>ie.relatedInformation)]);L.allActions.length===0&&I.push(...Q.allActions),Math.abs(T.column-j)K.findIndex(ee=>ee.action.title===G.action.title)===j);return W.sort((G,j)=>G.action.isPreferred&&!j.action.isPreferred?-1:!G.action.isPreferred&&j.action.isPreferred||G.action.isAI&&!j.action.isAI?1:!G.action.isAI&&j.action.isAI?-1:0),{validActions:W,allActions:I,documentation:L.documentation,hasAutoFix:L.hasAutoFix,hasAIFix:L.hasAIFix,allAIFixes:L.allAIFixes,dispose:()=>{L.dispose()}}}}if(i.trigger.type===1){const L=new StopWatch,I=await getCodeActions(this._registry,e,i.selection,i.trigger,Progress.None,c);return this._telemetryService&&this._telemetryService.publicLog2("codeAction.invokedDurations",{codeActions:I.validActions.length,duration:L.elapsed()}),I}return getCodeActions(this._registry,e,i.selection,i.trigger,Progress.None,c)});i.trigger.type===1&&((l=this._progressService)==null||l.showWhile(r,250));const o=new CodeActionsState.Triggered(i.trigger,s,r);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&o.type===1&&o.trigger.type===2&&this._state.position!==o.position),a?setTimeout(()=>{this.setState(o)},500):this.setState(o)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:CodeActionTriggerSource.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)==null||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var __decorate$1s=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1s=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CodeActionController_1;const DECORATION_CLASS_NAME$1="quickfix-edit-highlight";var da;let CodeActionController=(da=class extends Disposable{static get(e){return e.getContribution(CodeActionController_1.ID)}constructor(e,t,i,s,r,o,a,l,c,d,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._telemetryService=u,this._activeCodeActions=this._register(new MutableDisposable),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new CodeActionModel(this._editor,r.codeActionProvider,t,i,o,l,this._telemetryService)),this._register(this._model.onDidChangeState(f=>this.update(f))),this._lightBulbWidget=new Lazy(()=>{const f=this._editor.getContribution(LightBulbWidget.ID);return f&&this._register(f.onClick(g=>this.showCodeActionsFromLightbulb(g.actions,g))),f}),this._resolver=s.createInstance(CodeActionKeybindingResolver),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this._applyCodeAction(i,!1,!1,ApplyCodeActionReason.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var o;if(!this._editor.hasModel())return;(o=MessageController.get(this._editor))==null||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i,s){try{await this._instantiationService.invokeFunction(applyCodeAction,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:CodeActionTriggerSource.QuickFix,filter:{}})}}hideLightBulbWidget(){var e,t;(e=this._lightBulbWidget.rawValue)==null||e.hide(),(t=this._lightBulbWidget.rawValue)==null||t.gutterHide()}async update(e){var s,r,o,a,l;if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(c){onUnexpectedError(c);return}if(this._disposed)return;const i=this._editor.getSelection();if((i==null?void 0:i.startLineNumber)===e.position.lineNumber)if((s=this._lightBulbWidget.value)==null||s.update(t,e.trigger,e.position),e.trigger.type===1){if((r=e.trigger.filter)!=null&&r.include){const d=this.tryGetValidActionToApply(e.trigger,t);if(d){try{this.hideLightBulbWidget(),await this._applyCodeAction(d,!1,!1,ApplyCodeActionReason.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const u=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(u&&u.action.disabled){(o=MessageController.get(this._editor))==null||o.showMessage(u.action.disabled,e.trigger.context.position),t.dispose();return}}}const c=!!((a=e.trigger.filter)!=null&&a.include);if(e.trigger.context&&(!t.allActions.length||!c&&!t.validActions.length)){(l=MessageController.get(this._editor))==null||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}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]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),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 a=Position$1.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,d)=>{this._applyCodeAction(c,!0,!!d,i.fromLightbulb?ApplyCodeActionReason.FromAILightbulb:ApplyCodeActionReason.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:c=>{var d;(d=this._editor)==null||d.focus(),s.clear()},onHover:async(c,d)=>{var g;if(d.isCancellationRequested)return;let u=!1;const f=c.action.kind;if(f){const m=new HierarchicalKind(f);u=[CodeActionKind.RefactorExtract,CodeActionKind.RefactorInline,CodeActionKind.RefactorRewrite,CodeActionKind.RefactorMove,CodeActionKind.Source].some(v=>v.contains(m))}return{canPreview:u||!!((g=c.action.edit)!=null&&g.edits.length)}},onFocus:c=>{var d,u;if(c&&c.action){const f=c.action.ranges,g=c.action.diagnostics;if(s.clear(),f&&f.length>0){const m=g&&(g==null?void 0:g.length)>1?g.map(_=>({range:_,options:CodeActionController_1.DECORATION})):f.map(_=>({range:_,options:CodeActionController_1.DECORATION}));s.set(m)}else if(g&&g.length>0){const m=g.map(v=>({range:v,options:CodeActionController_1.DECORATION}));s.set(m);const _=g[0];if(_.startLineNumber&&_.startColumn){const v=(u=(d=this._editor.getModel())==null?void 0:d.getWordAtPosition({lineNumber:_.startLineNumber,column:_.startColumn}))==null?void 0:u.word;status(localize("editingNewSelection","Context: {0} at line {1} and column {2}.",v,_.startLineNumber,_.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,toMenuItems(o,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,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=getDomNodePagePosition(this._editor.getDomNode()),s=i.left+t.left,r=i.top+t.top+t.height;return{x:s,y:r}}_shouldShowHeaders(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(r=>({id:r.id,label:r.title,tooltip:r.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(r.id,...r.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:localize("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:localize("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},CodeActionController_1=da,da.ID="editor.contrib.codeActionController",da.DECORATION=ModelDecorationOptions.register({description:"quickfix-highlight",className:DECORATION_CLASS_NAME$1}),da);CodeActionController=CodeActionController_1=__decorate$1s([__param$1s(1,IMarkerService),__param$1s(2,IContextKeyService),__param$1s(3,IInstantiationService),__param$1s(4,ILanguageFeaturesService),__param$1s(5,IEditorProgressService),__param$1s(6,ICommandService),__param$1s(7,IConfigurationService),__param$1s(8,IActionWidgetService),__param$1s(9,IInstantiationService),__param$1s(10,ITelemetryService)],CodeActionController);registerThemingParticipant((n,e)=>{((s,r)=>{r&&e.addRule(`.monaco-editor ${s} { background-color: ${r}; }`)})(".quickfix-edit-highlight",n.getColor(editorFindMatchHighlight));const i=n.getColor(editorFindMatchHighlightBorder);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${isHighContrast(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function contextKeyForSupportedActions(n){return ContextKeyExpr.regex(SUPPORTED_CODE_ACTIONS.keys()[0],new RegExp("(\\s|^)"+escapeRegExpCharacters(n.value)+"\\b"))}const argsSchema={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:localize("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:localize("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[localize("args.schema.apply.first","Always apply the first returned code action."),localize("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),localize("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:localize("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function triggerCodeActionsForEditorSelection(n,e,t,i,s=CodeActionTriggerSource.Default){if(n.hasModel()){const r=CodeActionController.get(n);r==null||r.manualTriggerAtCurrentPosition(e,s,t,i)}}class QuickFixAction extends EditorAction{constructor(){super({id:quickFixCommandId,label:localize("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2137,weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,CodeActionTriggerSource.QuickFix)}}class CodeActionCommand extends EditorCommand{constructor(){super({id:codeActionCommandId,precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:argsSchema}]}})}runEditorCommand(e,t,i){const s=CodeActionCommandArgs.fromUser(i,{kind:HierarchicalKind.Empty,apply:"ifSingle"});return triggerCodeActionsForEditorSelection(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?localize("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):localize("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):s.preferred?localize("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):localize("editor.action.codeAction.noneMessage","No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class RefactorAction extends EditorAction{constructor(){super({id:refactorCommandId,label:localize("refactor.label","Refactor..."),alias:"Refactor...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,i){const s=CodeActionCommandArgs.fromUser(i,{kind:CodeActionKind.Refactor,apply:"never"});return triggerCodeActionsForEditorSelection(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?localize("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):localize("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):s.preferred?localize("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):localize("editor.action.refactor.noneMessage","No refactorings available"),{include:CodeActionKind.Refactor.contains(s.kind)?s.kind:HierarchicalKind.None,onlyIncludePreferredActions:s.preferred},s.apply,CodeActionTriggerSource.Refactor)}}class SourceAction extends EditorAction{constructor(){super({id:sourceActionCommandId,label:localize("source.label","Source Action..."),alias:"Source Action...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,i){const s=CodeActionCommandArgs.fromUser(i,{kind:CodeActionKind.Source,apply:"never"});return triggerCodeActionsForEditorSelection(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?localize("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):localize("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):s.preferred?localize("editor.action.source.noneMessage.preferred","No preferred source actions available"):localize("editor.action.source.noneMessage","No source actions available"),{include:CodeActionKind.Source.contains(s.kind)?s.kind:HierarchicalKind.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,CodeActionTriggerSource.SourceAction)}}class OrganizeImportsAction extends EditorAction{constructor(){super({id:organizeImportsCommandId,label:localize("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:1581,weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.organize.noneMessage","No organize imports action available"),{include:CodeActionKind.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",CodeActionTriggerSource.OrganizeImports)}}class FixAllAction extends EditorAction{constructor(){super({id:fixAllCommandId,label:localize("fixAll.label","Fix All"),alias:"Fix All",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.SourceFixAll))})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("fixAll.noneMessage","No fix all action available"),{include:CodeActionKind.SourceFixAll,includeSourceActions:!0},"ifSingle",CodeActionTriggerSource.FixAll)}}class AutoFixAction extends EditorAction{constructor(){super({id:autoFixCommandId,label:localize("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:ContextKeyExpr.and(EditorContextKeys.writable,contextKeyForSupportedActions(CodeActionKind.QuickFix)),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return triggerCodeActionsForEditorSelection(t,localize("editor.action.autoFix.noneMessage","No auto fixes available"),{include:CodeActionKind.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",CodeActionTriggerSource.AutoFix)}}registerEditorContribution(CodeActionController.ID,CodeActionController,3);registerEditorContribution(LightBulbWidget.ID,LightBulbWidget,4);registerEditorAction(QuickFixAction);registerEditorAction(RefactorAction);registerEditorAction(SourceAction);registerEditorAction(OrganizeImportsAction);registerEditorAction(AutoFixAction);registerEditorAction(FixAllAction);registerEditorCommand(new CodeActionCommand);Registry.as(Extensions$6.Configuration).registerConfiguration({...editorConfigurationBaseNode,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:localize("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});Registry.as(Extensions$6.Configuration).registerConfiguration({...editorConfigurationBaseNode,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:localize("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Registry.as(Extensions$6.Configuration).registerConfiguration({...editorConfigurationBaseNode,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:5,markdownDescription:localize("triggerOnFocusChange","Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});class CodeLensModel{constructor(){this.lenses=[],this._disposables=new DisposableStore}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})}}async function getCodeLensModel(n,e,t){const i=n.ordered(e),s=new Map,r=new CodeLensModel,o=i.map(async(a,l)=>{s.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&r.add(c,a)}catch(c){onUnexpectedExternalError(c)}});return await Promise.all(o),r.lenses=r.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:s.get(a.provider)s.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),r}CommandsRegistry.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;assertType(URI.isUri(t)),assertType(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(ILanguageFeaturesService),r=n.get(IModelService).getModel(t);if(!r)throw illegalArgument();const o=[],a=new DisposableStore;return getCodeLensModel(s,r,CancellationToken.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?o.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(r,d.symbol,CancellationToken.None)).then(u=>o.push(u||d.symbol)));return Promise.all(c)}).then(()=>o).finally(()=>{setTimeout(()=>a.dispose(),100)})});var __decorate$1r=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1r=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ICodeLensCache=createDecorator("ICodeLensCache");class CacheItem{constructor(e,t){this.lineCount=e,this.data=t}}let CodeLensCache=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new LRUCache(20,.75);const t="codelens/cache";runWhenWindowIdle(mainWindow,()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s);const r=Event$1.filter(e.onWillSaveState,o=>o.reason===WillSaveStateReason.SHUTDOWN);Event$1.once(r)(o=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(o=>{var a;return{range:o.symbol.range,command:o.symbol.command&&{id:"",title:(a=o.symbol.command)==null?void 0:a.title}}}),s=new CodeLensModel;s.add({lenses:i,dispose:()=>{}},this._fakeProvider);const r=new CacheItem(e.getLineCount(),s);this._cache.set(e.uri.toString(),r)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const r of i.data.lenses)s.add(r.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],r=[];for(const a of s.lines)r.push({range:new Range$2(a,1,a,11)});const o=new CodeLensModel;o.add({lenses:r,dispose(){}},this._fakeProvider),this._cache.set(i,new CacheItem(s.lineCount,o))}}catch{}}};CodeLensCache=__decorate$1r([__param$1r(0,IStorageService)],CodeLensCache);registerSingleton(ICodeLensCache,CodeLensCache,1);const codelensWidget="";class CodeLensViewZone{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")}}const au=class au{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${au._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let r=0;r{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:codeLensDecorationOptions},u=>this._decorationIds[d]=u),a?a=Range$2.plusRange(a,c.symbol.range):a=Range$2.lift(c.symbol.range)}),this._viewZone=new CodeLensViewZone(a.startLineNumber-1,r,o),this._viewZoneId=s.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new CodeLensContentWidget(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&Range$2.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:codeLensDecorationOptions},r=>this._decorationIds[s]=r)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1q=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},uu;let CodeLensContribution=(uu=class{constructor(e,t,i,s,r,o){this._editor=e,this._languageFeaturesService=t,this._commandService=s,this._notificationService=r,this._codeLensCache=o,this._disposables=new DisposableStore,this._localToDispose=new DisposableStore,this._lenses=[],this._oldCodeLensModels=new DisposableStore,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new RunOnceScheduler(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)==null||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),s=this._editor.getOption(50),{style:r}=this._editor.getContainerDomNode();r.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),r.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),r.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(r.setProperty("--vscode-editorCodeLens-fontFamily",i),r.setProperty("--vscode-editorCodeLens-fontFamilyDefault",EDITOR_FONT_DEFAULTS.fontFamily)),this._editor.changeViewZones(o=>{for(const a of this._lenses)a.updateHeight(e,o)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)==null||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)==null||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)==null||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&disposableTimeout(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const r=s.onDidChange(()=>i.schedule());this._localToDispose.add(r)}const i=new RunOnceScheduler(()=>{var r;const s=Date.now();(r=this._getCodeLensModelPromise)==null||r.cancel(),this._getCodeLensModelPromise=createCancelablePromise(o=>getCodeLensModel(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},onUnexpectedError)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(toDisposable(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(r=>{this._editor.changeViewZones(o=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(o),l=d.getLineNumber())});const c=new CodeLensHelper;a.forEach(d=>{d.dispose(c,o),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(r)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)==null||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(toDisposable(()=>{if(this._editor.getModel()){const s=StableEditorScrollState.capture(this._editor);this._editor.changeDecorations(r=>{this._editor.changeViewZones(o=>{this._disposeAllLenses(r,o)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let r=s.target.element;if((r==null?void 0:r.tagName)==="SPAN"&&(r=r.parentElement),(r==null?void 0:r.tagName)==="A")for(const o of this._lenses){const a=o.getCommand(r);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new CodeLensHelper;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(s&&s[s.length-1].symbol.range.startLineNumber===l?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const r=StableEditorScrollState.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new CodeLensHelper;let d=0,u=0;for(;uthis._resolveCodeLensesInViewportSoon())),d++,u++)}for(;dthis._resolveCodeLensesInViewportSoon())),u++;c.commit(a)})}),r.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var o;(o=this._resolveCodeLensesPromise)==null||o.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(e);l&&(t.push(l),i.push(a))}),t.length===0)return;const s=Date.now(),r=createCancelablePromise(a=>{const l=t.map((c,d)=>{const u=new Array(c.length),f=c.map((g,m)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(e,g.symbol,a)).then(_=>{u[m]=_},onUnexpectedExternalError):(u[m]=g.symbol,Promise.resolve(void 0)));return Promise.all(f).then(()=>{!a.isCancellationRequested&&!i[d].isDisposed()&&i[d].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{onUnexpectedError(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(e=this._currentCodeLensModel)!=null&&e.isDisposed?void 0:this._currentCodeLensModel}},uu.ID="css.editor.codeLens",uu);CodeLensContribution=__decorate$1q([__param$1q(1,ILanguageFeaturesService),__param$1q(2,ILanguageFeatureDebounceService),__param$1q(3,ICommandService),__param$1q(4,INotificationService),__param$1q(5,ICodeLensCache)],CodeLensContribution);registerEditorContribution(CodeLensContribution.ID,CodeLensContribution,1);registerEditorAction(class extends EditorAction{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:EditorContextKeys.hasCodeLensProvider,label:localize("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const i=e.get(IQuickInputService),s=e.get(ICommandService),r=e.get(INotificationService),o=t.getSelection().positionLineNumber,a=t.getContribution(CodeLensContribution.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const f of l.lenses)f.symbol.command&&f.symbol.range.startLineNumber===o&&c.push({label:f.symbol.command.title,command:f.symbol.command});if(c.length===0)return;const d=await i.pick(c,{canPickMany:!1,placeHolder:localize("placeHolder","Select a command")});if(!d)return;let u=d.command;if(l.isDisposed){const f=await a.getModel(),g=f==null?void 0:f.lenses.find(m=>{var _;return m.symbol.range.startLineNumber===o&&((_=m.symbol.command)==null?void 0:_.title)===u.title});if(!g||!g.symbol.command)return;u=g.symbol.command}try{await s.executeCommand(u.id,...u.arguments||[])}catch(f){r.error(f)}}});var __decorate$1p=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1p=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DefaultDocumentColorProvider=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,r=t.color,o=r.alpha,a=new Color(new RGBA(Math.round(255*r.red),Math.round(255*r.green),Math.round(255*r.blue),o)),l=o?Color.Format.CSS.formatRGB(a):Color.Format.CSS.formatRGBA(a),c=o?Color.Format.CSS.formatHSL(a):Color.Format.CSS.formatHSLA(a),d=o?Color.Format.CSS.formatHex(a):Color.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:s,text:l}}),u.push({label:c,textEdit:{range:s,text:c}}),u.push({label:d,textEdit:{range:s,text:d}}),u}};DefaultDocumentColorProvider=__decorate$1p([__param$1p(0,IEditorWorkerService)],DefaultDocumentColorProvider);let DefaultDocumentColorProviderFeature=class extends Disposable{constructor(e,t){super(),this._register(e.colorProvider.register("*",new DefaultDocumentColorProvider(t)))}};DefaultDocumentColorProviderFeature=__decorate$1p([__param$1p(0,ILanguageFeaturesService),__param$1p(1,IEditorWorkerService)],DefaultDocumentColorProviderFeature);registerEditorFeature(DefaultDocumentColorProviderFeature);async function getColors(n,e,t,i=!0){return _findColorData(new ColorDataCollector,n,e,t,i)}function getColorPresentations(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class ColorDataCollector{constructor(){}async compute(e,t,i,s){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)s.push({colorInfo:o,provider:e});return Array.isArray(r)}}class ExtColorDataCollector{constructor(){}async compute(e,t,i,s){const r=await e.provideDocumentColors(t,i);if(Array.isArray(r))for(const o of r)s.push({range:o.range,color:[o.color.red,o.color.green,o.color.blue,o.color.alpha]});return Array.isArray(r)}}class ColorPresentationsCollector{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const r=await e.provideColorPresentations(t,this.colorInfo,CancellationToken.None);return Array.isArray(r)&&s.push(...r),Array.isArray(r)}}async function _findColorData(n,e,t,i,s){let r=!1,o;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(d instanceof DefaultDocumentColorProvider)o=d;else try{await n.compute(d,t,i,a)&&(r=!0)}catch(u){onUnexpectedExternalError(u)}}return r?a:o&&s?(await n.compute(o,t,i,a),a):[]}function _setupColorCommand(n,e){const{colorProvider:t}=n.get(ILanguageFeaturesService),i=n.get(IModelService).getModel(e);if(!i)throw illegalArgument();const s=n.get(IConfigurationService).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:s}}CommandsRegistry.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof URI))throw illegalArgument();const{model:i,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:r}=_setupColorCommand(n,t);return _findColorData(new ExtColorDataCollector,s,i,CancellationToken.None,r)});CommandsRegistry.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:s,range:r}=i;if(!(s instanceof URI)||!Array.isArray(t)||t.length!==4||!Range$2.isIRange(r))throw illegalArgument();const{model:o,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=_setupColorCommand(n,s),[c,d,u,f]=t;return _findColorData(new ColorPresentationsCollector({range:r,color:{red:c,green:d,blue:u,alpha:f}}),a,o,CancellationToken.None,l)});var __decorate$1o=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1o=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ColorDetector_1;const ColorDecorationInjectedTextMarker=Object.create({});var ua;let ColorDetector=(ua=class extends Disposable{constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new DisposableStore),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new DynamicCssRules(this._editor),this._decoratorLimitReporter=new DecoratorLimitReporter,this._colorDecorationClassRefs=this._register(new DisposableStore),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:ColorDetector_1.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(r=>{const o=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(148);const a=o!==this._isColorDecoratorsEnabled||r.hasChanged(21),l=r.hasChanged(148);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(148),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new TimeoutTimer,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=createCancelablePromise(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new StopWatch(!1),s=await getColors(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){onUnexpectedError(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:ModelDecorationOptions.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,r)=>this._colorDatas.set(s,e[r]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let r=0;rthis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},ColorDetector_1=ua,ua.ID="editor.contrib.colorDetector",ua.RECOMPUTE_TIME=1e3,ua);ColorDetector=ColorDetector_1=__decorate$1o([__param$1o(1,IConfigurationService),__param$1o(2,ILanguageFeaturesService),__param$1o(3,ILanguageFeatureDebounceService)],ColorDetector);class DecoratorLimitReporter{constructor(){this._onDidChange=new Emitter$1,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}registerEditorContribution(ColorDetector.ID,ColorDetector,1);class ColorPickerModel{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 Emitter$1,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new Emitter$1,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new Emitter$1,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s{this.backgroundColor=o.getColor(editorHoverBackground)||Color.white})),this._register(addDisposableListener(this._pickedColorNode,EventType$1.CLICK,()=>this.model.selectNextColorPresentation())),this._register(addDisposableListener(this._originalColorNode,EventType$1.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=Color.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 CloseButton(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=Color.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class CloseButton extends Disposable{constructor(e){super(),this._onClicked=this._register(new Emitter$1),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),append$1(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),append$1(this._button,t),append$1(t,$$5(".button"+ThemeIcon.asCSSSelector(registerIcon("color-picker-close",Codicon.close,localize("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(addDisposableListener(this._button,EventType$1.CLICK,()=>{this._onClicked.fire()}))}}class ColorPickerBody extends Disposable{constructor(e,t,i,s=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=$$5(".colorpicker-body"),append$1(e,this._domNode),this._saturationBox=new SaturationBox(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 OpacityStrip(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new HueStrip(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s&&(this._insertButton=this._register(new InsertButton(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 Color(new HSVA(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Color(new HSVA(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new Color(new HSVA(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 SaturationBox extends Disposable{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Emitter$1,this.onColorFlushed=this._onColorFlushed.event,this._domNode=$$5(".saturation-wrap"),append$1(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",append$1(this._domNode,this._canvas),this.selection=$$5(".saturation-selection"),append$1(this._domNode,this.selection),this.layout(),this._register(addDisposableListener(this._domNode,EventType$1.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new GlobalPointerMoveMonitor);const t=getDomNodePagePosition(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=addDisposableListener(e.target.ownerDocument,EventType$1.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Color(new HSVA(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const r=i.createLinearGradient(0,0,0,this._canvas.height);r.addColorStop(0,"rgba(0, 0, 0, 0)"),r.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=Color.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=r,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Strip extends Disposable{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new Emitter$1,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=append$1(e,$$5(".standalone-strip")),this.overlay=append$1(this.domNode,$$5(".standalone-overlay"))):(this.domNode=append$1(e,$$5(".strip")),this.overlay=append$1(this.domNode,$$5(".overlay"))),this.slider=append$1(this.domNode,$$5(".slider")),this.slider.style.top="0px",this._register(addDisposableListener(this.domNode,EventType$1.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new GlobalPointerMoveMonitor),i=getDomNodePagePosition(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangeTop(r.pageY-i.top),()=>null);const s=addDisposableListener(e.target.ownerDocument,EventType$1.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class OpacityStrip extends Strip{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,r=new Color(new RGBA(t,i,s,1)),o=new Color(new RGBA(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${r} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class HueStrip extends Strip{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class InsertButton extends Disposable{constructor(e){super(),this._onClicked=this._register(new Emitter$1),this.onClicked=this._onClicked.event,this._button=append$1(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(addDisposableListener(this._button,EventType$1.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class ColorPickerWidget extends Widget$1{constructor(e,t,i,s,r=!1){super(),this.model=t,this.pixelRatio=i,this._register(PixelRatio.getInstance(getWindow(e)).onDidChange(()=>this.layout())),this._domNode=$$5(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new ColorPickerHeader(this._domNode,this.model,s,r)),this.body=this._register(new ColorPickerBody(this._domNode,this.model,this.pixelRatio,r))}layout(){this.body.layout()}get domNode(){return this._domNode}}class HoverRangeAnchor{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class HoverForeignElementAnchor{constructor(e,t,i,s,r,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=r,this.supportsMarkerHover=o,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class RenderedHoverParts{constructor(e){this.renderedHoverParts=e}dispose(){for(const e of this.renderedHoverParts)e.dispose()}}const HoverParticipantRegistry=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var __decorate$1n=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1n=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class ColorHover{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let ColorHoverParticipant=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return AsyncIterableObject.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const s=ColorDetector.get(this._editor);if(!s)return[];for(const r of t){if(!s.isColorDecoration(r))continue;const o=s.getColorData(r.range.getStartPosition());if(o)return[await _createColorHover(this,this._editor.getModel(),o.colorInfo,o.provider)]}return[]}renderHoverParts(e,t){const i=renderHoverParts(this,this._editor,this._themeService,t,e);if(!i)return new RenderedHoverParts([]);this._colorPicker=i.colorPicker;const s={hoverPart:i.hoverPart,hoverElement:this._colorPicker.domNode,dispose(){i.disposables.dispose()}};return new RenderedHoverParts([s])}handleResize(){var e;(e=this._colorPicker)==null||e.layout()}isColorPickerVisible(){return!!this._colorPicker}};ColorHoverParticipant=__decorate$1n([__param$1n(1,IThemeService)],ColorHoverParticipant);class StandaloneColorPickerHover{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}}let StandaloneColorPickerParticipant=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!ColorDetector.get(this._editor))return null;const r=await getColors(i,this._editor.getModel(),CancellationToken.None);let o=null,a=null;for(const u of r){const f=u.colorInfo;Range$2.containsRange(f.range,e.range)&&(o=f,a=u.provider)}const l=o??e,c=a??t,d=!!o;return{colorHover:await _createColorHover(this,this._editor.getModel(),l,c),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new Range$2(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await _updateColorPresentations(this._editor.getModel(),t,this._color,i,e),i=_updateEditorModel(this._editor,i,t))}renderHoverParts(e,t){return renderHoverParts(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};StandaloneColorPickerParticipant=__decorate$1n([__param$1n(1,IThemeService)],StandaloneColorPickerParticipant);async function _createColorHover(n,e,t,i){const s=e.getValueInRange(t.range),{red:r,green:o,blue:a,alpha:l}=t.color,c=new RGBA(Math.round(r*255),Math.round(o*255),Math.round(a*255),l),d=new Color(c),u=await getColorPresentations(e,t,i,CancellationToken.None),f=new ColorPickerModel(d,[],0);return f.colorPresentations=u||[],f.guessColorPresentation(d,s),n instanceof ColorHoverParticipant?new ColorHover(n,Range$2.lift(t.range),f,i):new StandaloneColorPickerHover(n,Range$2.lift(t.range),f,i)}function renderHoverParts(n,e,t,i,s){if(i.length===0||!e.hasModel())return;if(s.setMinimumDimensions){const f=e.getOption(67)+8;s.setMinimumDimensions(new Dimension(302,f))}const r=new DisposableStore,o=i[0],a=e.getModel(),l=o.model,c=r.add(new ColorPickerWidget(s.fragment,l,e.getOption(144),t,n instanceof StandaloneColorPickerParticipant));let d=!1,u=new Range$2(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn);if(n instanceof StandaloneColorPickerParticipant){const f=o.model.color;n.color=f,_updateColorPresentations(a,l,f,u,o),r.add(l.onColorFlushed(g=>{n.color=g}))}else r.add(l.onColorFlushed(async f=>{await _updateColorPresentations(a,l,f,u,o),d=!0,u=_updateEditorModel(e,u,l)}));return r.add(l.onDidChangeColor(f=>{_updateColorPresentations(a,l,f,u,o)})),r.add(e.onDidChangeModelContent(f=>{d?d=!1:(s.hide(),e.focus())})),{hoverPart:o,colorPicker:c,disposables:r}}function _updateEditorModel(n,e,t){const i=[],s=t.presentation.textEdit??{range:e,text:t.presentation.label,forceMoveMarkers:!1};i.push(s),t.presentation.additionalTextEdits&&i.push(...t.presentation.additionalTextEdits);const r=Range$2.lift(s.range),o=n.getModel()._setTrackedRange(null,r,3);return n.executeEdits("colorpicker",i),n.pushUndoStop(),n.getModel()._getTrackedRange(o)??r}async function _updateColorPresentations(n,e,t,i,s){const r=await getColorPresentations(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},s.provider,CancellationToken.None);e.colorPresentations=r||[]}const SHOW_OR_FOCUS_HOVER_ACTION_ID="editor.action.showHover",SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID="editor.action.showDefinitionPreviewHover",SCROLL_UP_HOVER_ACTION_ID="editor.action.scrollUpHover",SCROLL_DOWN_HOVER_ACTION_ID="editor.action.scrollDownHover",SCROLL_LEFT_HOVER_ACTION_ID="editor.action.scrollLeftHover",SCROLL_RIGHT_HOVER_ACTION_ID="editor.action.scrollRightHover",PAGE_UP_HOVER_ACTION_ID="editor.action.pageUpHover",PAGE_DOWN_HOVER_ACTION_ID="editor.action.pageDownHover",GO_TO_TOP_HOVER_ACTION_ID="editor.action.goToTopHover",GO_TO_BOTTOM_HOVER_ACTION_ID="editor.action.goToBottomHover",INCREASE_HOVER_VERBOSITY_ACTION_ID="editor.action.increaseHoverVerbosityLevel",INCREASE_HOVER_VERBOSITY_ACTION_LABEL=localize({key:"increaseHoverVerbosityLevel",comment:["Label for action that will increase the hover verbosity level."]},"Increase Hover Verbosity Level"),DECREASE_HOVER_VERBOSITY_ACTION_ID="editor.action.decreaseHoverVerbosityLevel",DECREASE_HOVER_VERBOSITY_ACTION_LABEL=localize({key:"decreaseHoverVerbosityLevel",comment:["Label for action that will decrease the hover verbosity level."]},"Decrease Hover Verbosity Level"),inlineCompletionsHintsWidget="",inlineSuggestCommitId="editor.action.inlineSuggest.commit",showPreviousInlineSuggestionActionId="editor.action.inlineSuggest.showPrevious",showNextInlineSuggestionActionId="editor.action.inlineSuggest.showNext";var __decorate$1m=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1m=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineSuggestionHintsContentWidget_1;let InlineCompletionsHintsWidget=class extends Disposable{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=derived(this,s=>{var l,c;const r=(l=this.model.read(s))==null?void 0:l.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new Position$1(r.lineNumber,Math.min(o,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(autorunWithStore((s,r)=>{const o=this.model.read(s);if(!o||!this.alwaysShowToolbar.read(s))return;const a=derivedWithStore((c,d)=>{const u=d.add(this.instantiationService.createInstance(InlineSuggestionHintsContentWidget,this.editor,!0,this.position,o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands));return e.addContentWidget(u),d.add(toDisposable(()=>e.removeContentWidget(u))),d.add(autorun(f=>{this.position.read(f)&&o.lastTriggerKind.read(f)!==InlineCompletionTriggerKind$1.Explicit&&o.triggerExplicitly()})),u}),l=derivedObservableWithCache(this,(c,d)=>!!this.position.read(c)||!!d);r.add(autorun(c=>{l.read(c)&&a.read(c)}))}))}};InlineCompletionsHintsWidget=__decorate$1m([__param$1m(2,IInstantiationService)],InlineCompletionsHintsWidget);const inlineSuggestionHintsNextIcon=registerIcon("inline-suggestion-hints-next",Codicon.chevronRight,localize("parameterHintsNextIcon","Icon for show next parameter hint.")),inlineSuggestionHintsPreviousIcon=registerIcon("inline-suggestion-hints-previous",Codicon.chevronLeft,localize("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var ba;let InlineSuggestionHintsContentWidget=(ba=class extends Disposable{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new Action(e,t,i,!0,()=>this._commandService.executeCommand(e)),r=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return r&&(o=localize({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,r.getLabel())),s.tooltip=o,s}constructor(e,t,i,s,r,o,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=r,this._extraCommands=o,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${InlineSuggestionHintsContentWidget_1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=h("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[h("div@toolBar")]),this.previousAction=this.createCommandAction(showPreviousInlineSuggestionActionId,localize("previous","Previous"),ThemeIcon.asClassName(inlineSuggestionHintsPreviousIcon)),this.availableSuggestionCountAction=new Action("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(showNextInlineSuggestionActionId,localize("next","Next"),ThemeIcon.asClassName(inlineSuggestionHintsNextIcon)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(MenuId.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new RunOnceScheduler(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new RunOnceScheduler(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.toolBar=this._register(l.createInstance(CustomizedMenuWorkbenchToolBar$1,this.nodes.toolBar,MenuId.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:f=>f.startsWith("primary")},actionViewItemProvider:(f,g)=>{if(f instanceof MenuItemAction)return l.createInstance(StatusBarViewItem$1,f,void 0);if(f===this.availableSuggestionCountAction){const m=new ActionViewItemWithClassName(void 0,f,{label:!0,icon:!1});return m.setClass("availableSuggestionCount"),m}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(f=>{InlineSuggestionHintsContentWidget_1._dropDownVisible=f})),this._register(autorun(f=>{this._position.read(f),this.editor.layoutContentWidget(this)})),this._register(autorun(f=>{const g=this._suggestionCount.read(f),m=this._currentSuggestionIdx.read(f);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${m+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(autorun(f=>{const m=this._extraCommands.read(f).map(_=>({class:void 0,id:_.id,enabled:!0,tooltip:_.tooltip||"",label:_.title,run:v=>this._commandService.executeCommand(_.id)}));for(const[_,v]of this.inlineCompletionsActionsMenus.getActions())for(const C of v)C instanceof MenuItemAction&&m.push(C);m.length>0&&m.unshift(new Separator),this.toolBar.setAdditionalSecondaryActions(m)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},InlineSuggestionHintsContentWidget_1=ba,ba._dropDownVisible=!1,ba.id=0,ba);InlineSuggestionHintsContentWidget=InlineSuggestionHintsContentWidget_1=__decorate$1m([__param$1m(6,ICommandService),__param$1m(7,IInstantiationService),__param$1m(8,IKeybindingService),__param$1m(9,IContextKeyService),__param$1m(10,IMenuService)],InlineSuggestionHintsContentWidget);class ActionViewItemWithClassName extends ActionViewItem{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let StatusBarViewItem$1=class extends MenuEntryActionViewItem{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=h("div.keybinding").root;this._register(new KeybindingLabel(t,OS$1,{disableTitle:!0,...unthemedKeybindingLabelOptions})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},CustomizedMenuWorkbenchToolBar$1=class extends WorkbenchToolBar{constructor(e,t,i,s,r,o,a,l,c){super(e,{resetMenu:t,...i},s,r,o,a,l,c),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=r,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,s,r,o,a,l,c;const e=[],t=[];createAndFillInActionBarActions(this.menu,(i=this.options2)==null?void 0:i.menuOptions,{primary:e,secondary:t},(r=(s=this.options2)==null?void 0:s.toolbarOptions)==null?void 0:r.primaryGroup,(a=(o=this.options2)==null?void 0:o.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){equals$1(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){equals$1(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};CustomizedMenuWorkbenchToolBar$1=__decorate$1m([__param$1m(3,IMenuService),__param$1m(4,IContextKeyService),__param$1m(5,IContextMenuService),__param$1m(6,IKeybindingService),__param$1m(7,ICommandService),__param$1m(8,ITelemetryService)],CustomizedMenuWorkbenchToolBar$1);function isMousePositionWithinElement(n,e,t){const i=getDomNodePagePosition(n);return!(ei.left+i.width||ti.top+i.height)}let HoverResult$1=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class HoverOperation extends Disposable{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new Emitter$1),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new RunOnceScheduler(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new RunOnceScheduler(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new RunOnceScheduler(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=createCancelableAsyncIterable(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){onUnexpectedError(e)}})()):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 HoverResult$1(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 ResizableHTMLElement{constructor(){this._onDidWillResize=new Emitter$1,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new Emitter$1,this.onDidResize=this._onDidResize.event,this._sashListener=new DisposableStore,this._size=new Dimension(0,0),this._minSize=new Dimension(0,0),this._maxSize=new Dimension(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Sash(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Sash(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Sash(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:OrthogonalEdge.North}),this._southSash=new Sash(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:OrthogonalEdge.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(Event$1.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(Event$1.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Event$1.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Event$1.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:r,width:o}=this._maxSize;e=Math.max(i,Math.min(r,e)),t=Math.max(s,Math.min(o,t));const a=new Dimension(t,e);Dimension.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const TOP_HEIGHT=30,BOTTOM_HEIGHT=24;class ResizableContentWidget extends Disposable{constructor(e,t=new Dimension(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new ResizableHTMLElement),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Dimension.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Dimension(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return(e=this._contentPosition)!=null&&e.position?Position$1.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:getDomNodePagePosition(t).top+i.top-TOP_HEIGHT}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=getDomNodePagePosition(t),r=getClientArea(t.ownerDocument.body),o=s.top+i.top+i.height;return r.height-o-BOTTOM_HEIGHT}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),r=Math.min(Math.max(s,i),e),o=Math.min(e,r);let a;return this._editor.getOption(60).above?a=o<=s?1:2:a=o<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var __decorate$1l=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1l=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ContentHoverWidget_1;const HORIZONTAL_SCROLLING_BY=30,CONTAINER_HEIGHT_PADDING=6;var ya;let ContentHoverWidget=(ya=class extends ResizableContentWidget{get isVisibleFromKeyboard(){var e;return((e=this._renderedHover)==null?void 0:e.source)===1}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,r){const o=e.getOption(67)+8,a=150,l=new Dimension(a,o);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=r,this._hover=this._register(new HoverWidget$1),this._onDidResize=this._register(new Emitter$1),this.onDidResize=this._onDidResize.event,this._minimumSize=l,this._hoverVisibleKey=EditorContextKeys.hoverVisible.bindTo(t),this._hoverFocusedKey=EditorContextKeys.hoverFocused.bindTo(t),append$1(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const c=this._register(trackFocus(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._renderedHover)==null||e.dispose(),this._editor.removeContentWidget(this)}getId(){return ContentHoverWidget_1.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,r=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=r}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return ContentHoverWidget_1._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return ContentHoverWidget_1._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,r=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=r}_setHoverWidgetMaxDimensions(e,t){ContentHoverWidget_1._applyMaxDimensions(this._hover.contentsDomNode,e,t),ContentHoverWidget_1._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Dimension(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){ContentHoverWidget_1._lastDimensions=new Dimension(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){var t;const e=(t=this._renderedHover)==null?void 0:t.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=CONTAINER_HEIGHT_PADDING;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,s),!0)}_setRenderedHover(e){var t;(t=this._renderedHover)==null||t.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(r=>this._editor.applyFontInfo(r))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,ContentHoverWidget_1._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,ContentHoverWidget_1._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){var o;if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=getTotalHeight(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.onContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&getHoverAccessibleViewHint(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),((o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:o.getAriaLabel())??"");r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+r)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Dimension(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}setMinimumDimensions(e){this._minimumSize=new Dimension(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Dimension(e,this._minimumSize.height)}onContentsChanged(){var s;this._removeConstraintsRenderNormally();const e=this._hover.containerDomNode;let t=getTotalHeight(e),i=getTotalWidth(e);if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=getTotalHeight(e),i=getTotalWidth(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),(s=this._renderedHover)!=null&&s.showAtPosition){const r=getTotalHeight(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(r,this._renderedHover.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-HORIZONTAL_SCROLLING_BY})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+HORIZONTAL_SCROLLING_BY})}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})}},ContentHoverWidget_1=ya,ya.ID="editor.contrib.resizableContentHoverWidget",ya._lastDimensions=new Dimension(0,0),ya);ContentHoverWidget=ContentHoverWidget_1=__decorate$1l([__param$1l(1,IContextKeyService),__param$1l(2,IConfigurationService),__param$1l(3,IAccessibilityService),__param$1l(4,IKeybindingService)],ContentHoverWidget);function computeDistanceFromPointToRectangle(n,e,t,i,s,r){const o=t+s/2,a=i+r/2,l=Math.max(Math.abs(n-o)-s/2,0),c=Math.max(Math.abs(e-a)-r/2,0);return Math.sqrt(l*l+c*c)}class ContentHoverComputer{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const r=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(o=>{if(o.options.isWholeLine)return!0;const a=o.range.startLineNumber===s?o.range.startColumn:1,l=o.range.endLineNumber===s?o.range.endColumn:r;if(o.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 AsyncIterableObject.EMPTY;const i=ContentHoverComputer._getLineDecorations(this._editor,t);return AsyncIterableObject.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):AsyncIterableObject.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=ContentHoverComputer._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return coalesce(t)}}class HoverResult{constructor(e,t,i){this.anchor=e,this.hoverParts=t,this.isComplete=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new FilteredHoverResult(this,this.anchor,t,this.isComplete)}}class FilteredHoverResult extends HoverResult{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}var __decorate$1k=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1k=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $$4=$$e;let EditorHoverStatusBar=class extends Disposable{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this.actions=[],this._hasContent=!1,this.hoverElement=$$4("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=append$1(this.hoverElement,$$4("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const s=this._register(HoverAction.render(this.actionsElement,e,i));return this.actions.push(s),s}append(e){const t=append$1(this.actionsElement,e);return this._hasContent=!0,t}};EditorHoverStatusBar=__decorate$1k([__param$1k(0,IKeybindingService)],EditorHoverStatusBar);class HoverProviderResult{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function executeProvider(n,e,t,i,s){const r=await Promise.resolve(n.provideHover(t,i,s)).catch(onUnexpectedExternalError);if(!(!r||!isValid(r)))return new HoverProviderResult(n,r,e)}function getHoverProviderResultsAsAsyncIterable(n,e,t,i,s=!1){const o=n.ordered(e,s).map((a,l)=>executeProvider(a,l,e,t,i));return AsyncIterableObject.fromPromises(o).coalesce()}function getHoversPromise(n,e,t,i,s=!1){return getHoverProviderResultsAsAsyncIterable(n,e,t,i,s).map(r=>r.hover).toPromise()}registerModelAndPositionCommand("_executeHoverProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService);return getHoversPromise(i.hoverProvider,e,t,CancellationToken.None)});registerModelAndPositionCommand("_executeHoverProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService);return getHoversPromise(i.hoverProvider,e,t,CancellationToken.None,!0)});function isValid(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var __decorate$1j=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1j=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $$3=$$e,increaseHoverVerbosityIcon=registerIcon("hover-increase-verbosity",Codicon.add,localize("increaseHoverVerbosity","Icon for increaseing hover verbosity.")),decreaseHoverVerbosityIcon=registerIcon("hover-decrease-verbosity",Codicon.remove,localize("decreaseHoverVerbosity","Icon for decreasing hover verbosity."));class MarkdownHover{constructor(e,t,i,s,r,o=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=r,this.source=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class HoverSource{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case HoverVerbosityAction$1.Increase:return this.hover.canIncreaseVerbosity??!1;case HoverVerbosityAction$1.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let MarkdownHoverParticipant=class{constructor(e,t,i,s,r,o,a,l){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=r,this._keybindingService=o,this._hoverService=a,this._commandService=l,this.hoverOrdinal=3}createLoadingMessage(e){return new MarkdownHover(this,e.range,[new MarkdownString().appendText(localize("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,r=i.getLineMaxColumn(s),o=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(118),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let f=!1;d>=0&&l>d&&e.range.startColumn>=d&&(f=!0,o.push(new MarkdownHover(this,e.range,[{value:localize("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!f&&typeof u=="number"&&l>=u&&o.push(new MarkdownHover(this,e.range,[{value:localize("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const m of t){const _=m.range.startLineNumber===s?m.range.startColumn:1,v=m.range.endLineNumber===s?m.range.endColumn:r,C=m.options.hoverMessage;if(!C||isEmptyMarkdownString(C))continue;m.options.beforeContentClassName&&(g=!0);const S=new Range$2(e.range.startLineNumber,_,e.range.startLineNumber,v);o.push(new MarkdownHover(this,S,asArray(C),g,a++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return AsyncIterableObject.EMPTY;const s=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(s)?this._getMarkdownHovers(r,s,e,i):AsyncIterableObject.EMPTY}_getMarkdownHovers(e,t,i,s){const r=i.range.getStartPosition();return getHoverProviderResultsAsAsyncIterable(e,t,r,s).filter(l=>!isEmptyMarkdownString(l.hover.contents)).map(l=>{const c=l.hover.range?Range$2.lift(l.hover.range):i.range,d=new HoverSource(l.hover,l.provider,r);return new MarkdownHover(this,c,l.hover.contents,!1,l.ordinal,d)})}renderHoverParts(e,t){return this._renderedHoverParts=new MarkdownRenderedHoverParts(t,e.fragment,this,this._editor,this._languageService,this._openerService,this._commandService,this._keybindingService,this._hoverService,this._configurationService,e.onContentsChanged),this._renderedHoverParts}updateMarkdownHoverVerbosityLevel(e,t,i){var s;return Promise.resolve((s=this._renderedHoverParts)==null?void 0:s.updateMarkdownHoverPartVerbosityLevel(e,t,i))}};MarkdownHoverParticipant=__decorate$1j([__param$1j(1,ILanguageService),__param$1j(2,IOpenerService),__param$1j(3,IConfigurationService),__param$1j(4,ILanguageFeaturesService),__param$1j(5,IKeybindingService),__param$1j(6,IHoverService),__param$1j(7,ICommandService)],MarkdownHoverParticipant);class RenderedMarkdownHoverPart{constructor(e,t,i){this.hoverPart=e,this.hoverElement=t,this.disposables=i}dispose(){this.disposables.dispose()}}class MarkdownRenderedHoverParts{constructor(e,t,i,s,r,o,a,l,c,d,u){this._hoverParticipant=i,this._editor=s,this._languageService=r,this._openerService=o,this._commandService=a,this._keybindingService=l,this._hoverService=c,this._configurationService=d,this._onFinishedRendering=u,this._ongoingHoverOperations=new Map,this._disposables=new DisposableStore,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(toDisposable(()=>{this.renderedHoverParts.forEach(f=>{f.dispose()}),this._ongoingHoverOperations.forEach(f=>{f.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(compareBy(s=>s.ordinal,numberComparator)),e.map(s=>{const r=this._renderHoverPart(s,i);return t.appendChild(r.hoverElement),r})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),s=i.hoverElement,r=e.source,o=new DisposableStore;if(o.add(i),!r)return new RenderedMarkdownHoverPart(e,s,o);const a=r.supportsVerbosityAction(HoverVerbosityAction$1.Increase),l=r.supportsVerbosityAction(HoverVerbosityAction$1.Decrease);if(!a&&!l)return new RenderedMarkdownHoverPart(e,s,o);const c=$$3("div.verbosity-actions");return s.prepend(c),o.add(this._renderHoverExpansionAction(c,HoverVerbosityAction$1.Increase,a)),o.add(this._renderHoverExpansionAction(c,HoverVerbosityAction$1.Decrease,l)),new RenderedMarkdownHoverPart(e,s,o)}_renderMarkdownHover(e,t){return renderMarkdownInContainer(this._editor,e,this._languageService,this._openerService,t)}_renderHoverExpansionAction(e,t,i){const s=new DisposableStore,r=t===HoverVerbosityAction$1.Increase,o=append$1(e,$$3(ThemeIcon.asCSSSelector(r?increaseHoverVerbosityIcon:decreaseHoverVerbosityIcon)));o.tabIndex=0;const a=new WorkbenchHoverDelegate("mouse",!1,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupManagedHover(a,o,labelForHoverVerbosityAction(this._keybindingService,t))),!i)return o.classList.add("disabled"),s;o.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===HoverVerbosityAction$1.Increase?INCREASE_HOVER_VERBOSITY_ACTION_ID:DECREASE_HOVER_VERBOSITY_ACTION_ID);return s.add(new ClickAction(o,l)),s.add(new KeyDownAction(o,l,[3,10])),s}async updateMarkdownHoverPartVerbosityLevel(e,t,i=!0){const s=this._editor.getModel();if(!s)return;const r=this._getRenderedHoverPartAtIndex(t),o=r==null?void 0:r.hoverPart.source;if(!r||!(o!=null&&o.supportsVerbosityAction(e)))return;const a=await this._fetchHover(o,s,e);if(!a)return;const l=new HoverSource(a,o.hoverProvider,o.hoverPosition),c=r.hoverPart,d=new MarkdownHover(this._hoverParticipant,c.range,a.contents,c.isBeforeContent,c.ordinal,l),u=this._renderHoverPart(d,this._onFinishedRendering);return this._replaceRenderedHoverPartAtIndex(t,u,d),i&&this._focusOnHoverPartWithIndex(t),{hoverPart:d,hoverElement:u.hoverElement}}async _fetchHover(e,t,i){let s=i===HoverVerbosityAction$1.Increase?1:-1;const r=e.hoverProvider,o=this._ongoingHoverOperations.get(r);o&&(o.tokenSource.cancel(),s+=o.verbosityDelta);const a=new CancellationTokenSource$1;this._ongoingHoverOperations.set(r,{verbosityDelta:s,tokenSource:a});const l={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let c;try{c=await Promise.resolve(r.provideHover(t,e.hoverPosition,a.token,l))}catch(d){onUnexpectedExternalError(d)}return a.dispose(),this._ongoingHoverOperations.delete(r),c}_replaceRenderedHoverPartAtIndex(e,t,i){if(e>=this.renderedHoverParts.length||e<0)return;const s=this.renderedHoverParts[e],r=s.hoverElement,o=t.hoverElement,a=Array.from(o.children);r.replaceChildren(...a);const l=new RenderedMarkdownHoverPart(i,r,t.disposables);r.focus(),s.dispose(),this.renderedHoverParts[e]=l}_focusOnHoverPartWithIndex(e){this.renderedHoverParts[e].hoverElement.focus()}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function renderMarkdownHovers(n,e,t,i,s){e.sort(compareBy(o=>o.ordinal,numberComparator));const r=[];for(const o of e)r.push(renderMarkdownInContainer(t,o,i,s,n.onContentsChanged));return new RenderedHoverParts(r)}function renderMarkdownInContainer(n,e,t,i,s){const r=new DisposableStore,o=$$3("div.hover-row"),a=$$3("div.hover-row-contents");o.appendChild(a);const l=e.contents;for(const d of l){if(isEmptyMarkdownString(d))continue;const u=$$3("div.markdown-hover"),f=append$1(u,$$3("div.hover-contents")),g=r.add(new MarkdownRenderer({editor:n},t,i));r.add(g.onDidRenderAsync(()=>{f.className="hover-contents code-hover-contents",s()}));const m=r.add(g.render(d));f.appendChild(m.element),a.appendChild(u)}return{hoverPart:e,hoverElement:o,dispose(){r.dispose()}}}function labelForHoverVerbosityAction(n,e){switch(e){case HoverVerbosityAction$1.Increase:{const t=n.lookupKeybinding(INCREASE_HOVER_VERBOSITY_ACTION_ID);return t?localize("increaseVerbosityWithKb","Increase Hover Verbosity ({0})",t.getLabel()):localize("increaseVerbosity","Increase Hover Verbosity")}case HoverVerbosityAction$1.Decrease:{const t=n.lookupKeybinding(DECREASE_HOVER_VERBOSITY_ACTION_ID);return t?localize("decreaseVerbosityWithKb","Decrease Hover Verbosity ({0})",t.getLabel()):localize("decreaseVerbosity","Decrease Hover Verbosity")}}}function hasModifier(n,e){return!!n[e]}class ClickLinkMouseEvent{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=hasModifier(e.event,t.triggerModifier),this.hasSideBySideModifier=hasModifier(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class ClickLinkKeyboardEvent{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=hasModifier(e,t.triggerModifier)}}class ClickLinkOptions{constructor(e,t,i,s){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function createOptions(n){return n==="altKey"?isMacintosh?new ClickLinkOptions(57,"metaKey",6,"altKey"):new ClickLinkOptions(5,"ctrlKey",6,"altKey"):isMacintosh?new ClickLinkOptions(6,"altKey",57,"metaKey"):new ClickLinkOptions(6,"altKey",5,"ctrlKey")}class ClickLinkGesture extends Disposable{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new Emitter$1),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new Emitter$1),this.onExecute=this._onExecute.event,this._onCancel=this._register(new Emitter$1),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(t==null?void 0:t.extractLineNumberFromMouseEvent)??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=createOptions(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(78)){const s=createOptions(this._editor.getOption(78));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new ClickLinkMouseEvent(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new ClickLinkMouseEvent(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new ClickLinkMouseEvent(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new ClickLinkKeyboardEvent(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new ClickLinkKeyboardEvent(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=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class InlayHintAnchor{constructor(e,t){this.range=e,this.direction=t}}class InlayHintItem{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new InlayHintItem(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t==null?void 0:t.tooltip)??this.hint.tooltip,this.hint.label=(t==null?void 0:t.label)??this.hint.label,this.hint.textEdits=(t==null?void 0:t.textEdits)??this.hint.textEdits,this._isResolved=!0}catch(t){onUnexpectedExternalError(t),this._isResolved=!1}}}const gl=class gl{static async create(e,t,i,s){const r=[],o=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,s);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&r.push([c??gl._emptyInlayHintList,a])}catch(c){onUnexpectedExternalError(c)}}));if(await Promise.all(o.flat()),s.isCancellationRequested||t.isDisposed())throw new CancellationError;return new gl(i,r,t)}constructor(e,t,i){this._disposables=new DisposableStore,this.ranges=e,this.provider=new Set;const s=[];for(const[r,o]of t){this._disposables.add(r),this.provider.add(o);for(const a of r.hints){const l=i.validatePosition(a.position);let c="before";const d=gl._getRangeAtPosition(i,l);let u;d.getStartPosition().isBefore(l)?(u=Range$2.fromPositions(d.getStartPosition(),l),c="after"):(u=Range$2.fromPositions(l,d.getEndPosition()),c="before"),s.push(new InlayHintItem(a,new InlayHintAnchor(u,c),o))}}this.items=s.sort((r,o)=>Position$1.compare(r.hint.position,o.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new Range$2(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const r=e.tokenization.getLineTokens(i),o=t.column-1,a=r.findTokenIndexAtOffset(o);let l=r.getStartOffset(a),c=r.getEndOffset(a);return c-l===1&&(l===o&&a>1?(l=r.getStartOffset(a-1),c=r.getEndOffset(a-1)):c===o&&a=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let EmbeddedCodeEditorWidget=class extends CodeEditorWidget{constructor(e,t,i,s,r,o,a,l,c,d,u,f,g){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,r,o,a,l,c,d,u,f,g),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(m=>this._onParentConfigurationChanged(m)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){mixin(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};EmbeddedCodeEditorWidget=__decorate$1i([__param$1i(4,IInstantiationService),__param$1i(5,ICodeEditorService),__param$1i(6,ICommandService),__param$1i(7,IContextKeyService),__param$1i(8,IThemeService),__param$1i(9,INotificationService),__param$1i(10,IAccessibilityService),__param$1i(11,ILanguageConfigurationService),__param$1i(12,ILanguageFeaturesService)],EmbeddedCodeEditorWidget);const peekViewWidget="",zoneWidget="",defaultColor=new Color(new RGBA(0,122,204)),defaultOptions$1={showArrow:!0,showFrame:!0,className:"",frameColor:defaultColor,arrowColor:defaultColor,keepEditorSelection:!1},WIDGET_ID="vs.editor.contrib.zoneWidget";class ViewZoneDelegate{constructor(e,t,i,s,r,o,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=r,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class OverlayWidgetDelegate{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const bg=class bg{constructor(e){this._editor=e,this._ruleName=bg._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),removeCSSRulesContainingSelector(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(){removeCSSRulesContainingSelector(this._ruleName),createCSSRule(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:Range$2.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};bg._IdGenerator=new IdGenerator(".arrow-decoration-");let Arrow=bg;class ZoneWidget{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new DisposableStore,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=deepClone(t),mixin(this.options,defaultOptions$1,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new Arrow(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)==null||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=Range$2.isIRange(e)?Range$2.lift(e):Range$2.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:ModelDecorationOptions.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.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),r=this._getWidth(s);this.domNode.style.width=`${r}px`,this.domNode.style.left=this._getLeft(s)+"px";const o=document.createElement("div");o.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const f=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,f)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new ViewZoneDelegate(o,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new OverlayWidgetDelegate(WIDGET_ID+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,r),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const f=u.validateRange(new Range$2(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(f,f.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Sash(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(67),s=i<0?Math.ceil(i):Math.floor(i),r=e.heightInLines+s;r>5&&r<35&&this._relayout(r)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var __decorate$1h=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1h=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const IPeekViewService=createDecorator("IPeekViewService");registerSingleton(IPeekViewService,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var PeekContext;(function(n){n.inPeekEditor=new RawContextKey("inReferenceSearchEditor",!0,localize("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(PeekContext||(PeekContext={}));var hu;let PeekContextController=(hu=class{constructor(e,t){e instanceof EmbeddedCodeEditorWidget&&PeekContext.inPeekEditor.bindTo(t)}dispose(){}},hu.ID="editor.contrib.referenceController",hu);PeekContextController=__decorate$1h([__param$1h(1,IContextKeyService)],PeekContextController);registerEditorContribution(PeekContextController.ID,PeekContextController,0);function getOuterEditor(n){const e=n.get(ICodeEditorService).getFocusedCodeEditor();return e instanceof EmbeddedCodeEditorWidget?e.getParentEditor():e}const defaultOptions={headerBackgroundColor:Color.white,primaryHeadingColor:Color.fromHex("#333333"),secondaryHeadingColor:Color.fromHex("#6c6c6cb3")};let PeekViewWidget=class extends ZoneWidget{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new Emitter$1,this.onDidClose=this._onDidClose.event,mixin(this.options,defaultOptions,!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=$$e(".head"),this._bodyElement=$$e(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=$$e(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),addStandardDisposableListener(this._titleElement,"click",r=>this._onTitleClick(r))),append$1(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=$$e("span.filename"),this._secondaryHeading=$$e("span.dirname"),this._metaHeading=$$e("span.meta"),append$1(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=$$e(".peekview-actions");append$1(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new ActionBar(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Action("peekview.close",localize("label.close","Close"),ThemeIcon.asClassName(Codicon.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:createActionViewItem.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:clearNode(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,show(this._metaHeading)):hide(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(67)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};PeekViewWidget=__decorate$1h([__param$1h(2,IInstantiationService)],PeekViewWidget);const peekViewTitleBackground=registerColor("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:Color.black,hcLight:Color.white},localize("peekViewTitleBackground","Background color of the peek view title area.")),peekViewTitleForeground=registerColor("peekViewTitleLabel.foreground",{dark:Color.white,light:Color.black,hcDark:Color.white,hcLight:editorForeground},localize("peekViewTitleForeground","Color of the peek view title.")),peekViewTitleInfoForeground=registerColor("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},localize("peekViewTitleInfoForeground","Color of the peek view title info.")),peekViewBorder=registerColor("peekView.border",{dark:editorInfoForeground,light:editorInfoForeground,hcDark:contrastBorder,hcLight:contrastBorder},localize("peekViewBorder","Color of the peek view borders and arrow.")),peekViewResultsBackground=registerColor("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:Color.black,hcLight:Color.white},localize("peekViewResultsBackground","Background color of the peek view result list."));registerColor("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:Color.white,hcLight:editorForeground},localize("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));registerColor("peekViewResult.fileForeground",{dark:Color.white,light:"#1E1E1E",hcDark:Color.white,hcLight:editorForeground},localize("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));registerColor("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},localize("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));registerColor("peekViewResult.selectionForeground",{dark:Color.white,light:"#6C6C6C",hcDark:Color.white,hcLight:editorForeground},localize("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const peekViewEditorBackground=registerColor("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:Color.black,hcLight:Color.white},localize("peekViewEditorBackground","Background color of the peek view editor."));registerColor("peekViewEditorGutter.background",peekViewEditorBackground,localize("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));registerColor("peekViewEditorStickyScroll.background",peekViewEditorBackground,localize("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));registerColor("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},localize("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));registerColor("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},localize("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));registerColor("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class OneReference{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=defaultGenerator.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var t;const e=(t=this.parent.getPreview(this))==null?void 0:t.preview(this.range);return e?localize({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}",e.value,basename$1(this.uri),this.range.startLineNumber,this.range.startColumn):localize("aria.oneReference","in {0} on line {1} at column {2}",basename$1(this.uri),this.range.startLineNumber,this.range.startColumn)}}class FilePreview{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:r,endLineNumber:o,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:r-t}),c=new Range$2(s,l.startColumn,s,r),d=new Range$2(o,a,o,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),f=i.getValueInRange(e),g=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+f+g,highlight:{start:u.length,end:u.length+f.length}}}}class FileReferences{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ResourceMap}dispose(){dispose(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?localize("aria.fileReferences.1","1 symbol in {0}, full path {1}",basename$1(this.uri),this.uri.fsPath):localize("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,basename$1(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new FilePreview(i))}catch(i){onUnexpectedError(i)}return this}}class ReferencesModel{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new Emitter$1,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(ReferencesModel._compareReferences);let s;for(const r of e)if((!s||!extUri.isEqual(s.uri,r.uri,!0))&&(s=new FileReferences(this,r.uri),this.groups.push(s)),s.children.length===0||ReferencesModel._compareReferences(r,s.children[s.children.length-1])!==0){const o=new OneReference(i===r,s,r,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(o),s.children.push(o)}}dispose(){dispose(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new ReferencesModel(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?localize("aria.result.0","No results found"):this.references.length===1?localize("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?localize("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):localize("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const r=i.children.length,o=i.parent.groups.length;return o===1||t&&s+10?(t?s=(s+1)%r:s=(s+r-1)%r,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%o,i.parent.groups[s].children[0]):(s=(s+o-1)%o,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,r)=>({idx:r,prefixLen:commonPrefixLength(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,r)=>s.prefixLen>r.prefixLen?-1:s.prefixLenr.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()&&Range$2.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 extUri.compare(e.uri,t.uri)||Range$2.compareRangesUsingStarts(e.range,t.range)}}const referencesWidget="";var __decorate$1g=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1g=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FileReferencesRenderer_1;let DataSource=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof ReferencesModel||e instanceof FileReferences}getChildren(e){if(e instanceof ReferencesModel)return e.groups;if(e instanceof FileReferences)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};DataSource=__decorate$1g([__param$1g(0,ITextModelService)],DataSource);class Delegate{getHeight(){return 23}getTemplateId(e){return e instanceof FileReferences?FileReferencesRenderer.id:OneReferenceRenderer.id}}let StringRepresentationProvider=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof OneReference){const i=(t=e.parent.getPreview(e))==null?void 0:t.preview(e.range);if(i)return i.value}return basename$1(e.uri)}};StringRepresentationProvider=__decorate$1g([__param$1g(0,IKeybindingService)],StringRepresentationProvider);class IdentityProvider{getId(e){return e instanceof OneReference?e.id:e.uri}}let FileReferencesTemplate=class extends Disposable{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new IconLabel(i,{supportHighlights:!0})),this.badge=new CountBadge(append$1(i,$$e(".count")),{},defaultCountBadgeStyles),e.appendChild(i)}set(e,t){const i=dirname$1(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(localize("referencesCount","{0} references",s)):this.badge.setTitleFormat(localize("referenceCount","{0} reference",s))}};FileReferencesTemplate=__decorate$1g([__param$1g(1,ILabelService)],FileReferencesTemplate);var Al;let FileReferencesRenderer=(Al=class{constructor(e){this._instantiationService=e,this.templateId=FileReferencesRenderer_1.id}renderTemplate(e){return this._instantiationService.createInstance(FileReferencesTemplate,e)}renderElement(e,t,i){i.set(e.element,createMatches(e.filterData))}disposeTemplate(e){e.dispose()}},FileReferencesRenderer_1=Al,Al.id="FileReferencesRenderer",Al);FileReferencesRenderer=FileReferencesRenderer_1=__decorate$1g([__param$1g(0,IInstantiationService)],FileReferencesRenderer);class OneReferenceTemplate extends Disposable{constructor(e){super(),this.label=this._register(new HighlightedLabel(e))}set(e,t){var s;const i=(s=e.parent.getPreview(e))==null?void 0:s.preview(e.range);if(!i||!i.value)this.label.set(`${basename$1(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:r,highlight:o}=i;t&&!FuzzyScore.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(r,createMatches(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(r,[o]))}}}const vg=class vg{constructor(){this.templateId=vg.id}renderTemplate(e){return new OneReferenceTemplate(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};vg.id="OneReferenceRenderer";let OneReferenceRenderer=vg;class AccessibilityProvider{getWidgetAriaLabel(){return localize("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var __decorate$1f=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1f=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Cg=class Cg{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new DisposableStore,this._callOnModelChange=new DisposableStore,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,r=e.children.length;s{const r=s.deltaDecorations([],t);for(let o=0;o{r.equals(9)&&(this._keybindingService.dispatchEvent(r,r.target),r.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(ReferencesTree,"ReferencesWidget",this._treeContainer,new Delegate,[this._instantiationService.createInstance(FileReferencesRenderer),this._instantiationService.createInstance(OneReferenceRenderer)],this._instantiationService.createInstance(DataSource),i),this._splitView.addView({onDidChange:Event$1.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:r=>{this._preview.layout({height:this._dim.height,width:r})}},Sizing.Distribute),this._splitView.addView({onDidChange:Event$1.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:r=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${r}px`,this._tree.layout(this._dim.height,r)}},Sizing.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(r,o)=>{r instanceof OneReference&&(o==="show"&&this._revealReference(r,!1),this._onDidSelectReference.fire({element:r,kind:o,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(r=>{r.sideBySide?s(r.element,"side"):r.editorOptions.pinned?s(r.element,"goto"):s(r.element,"show")})),hide(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Dimension(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=localize("noResults","No results"),show(this._messageContainer),Promise.resolve(void 0)):(hide(this._messageContainer),this._decorationsManager=new DecorationsManager(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),show(this._treeContainer),show(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 OneReference)return e;if(e instanceof FileReferences&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Schemas.inMemory?this.setTitle(basenameOrAuthority(e.uri),this._uriLabel.getUriLabel(dirname$1(e.uri))):this.setTitle(localize("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),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}dispose(this._previewModelReference);const r=s.object;if(r){const o=this._preview.getModel()===r.textEditorModel?0:1,a=Range$2.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(r.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,o)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};ReferenceWidget=__decorate$1f([__param$1f(3,IThemeService),__param$1f(4,ITextModelService),__param$1f(5,IInstantiationService),__param$1f(6,IPeekViewService),__param$1f(7,ILabelService),__param$1f(8,IKeybindingService)],ReferenceWidget);var __decorate$1e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ReferencesController_1;const ctxReferenceSearchVisible=new RawContextKey("referenceSearchVisible",!1,localize("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var Rl;let ReferencesController=(Rl=class{static get(e){return e.getContribution(ReferencesController_1.ID)}constructor(e,t,i,s,r,o,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=r,this._instantiationService=o,this._storageService=a,this._configurationService=l,this._disposables=new DisposableStore,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=ctxReferenceSearchVisible.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)==null||e.dispose(),(t=this._model)==null||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const r="peekViewLayout",o=LayoutData.fromJSON(this._storageService.get(r,0,"{}"));this._widget=this._instantiationService.createInstance(ReferenceWidget,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(localize("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(r,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)==null||c.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(localize("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new Position$1(e.startLineNumber,e.startColumn),f=this._model.nearestReference(d,u);if(f)return this._widget.setSelection(f).then(()=>{this._widget&&this._editor.getOption(87)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),r=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),r?this._editor.focus():this._widget&&o&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)==null||t.dispose(),(i=this._model)==null||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 s;(s=this._widget)==null||s.hide(),this._ignoreModelChangeEvent=!0;const i=Range$2.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(r=>{if(this._ignoreModelChangeEvent=!1,!r||!this._widget){this.closeWidget();return}if(this._editor===r)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=ReferencesController_1.get(r),a=this._model.clone();this.closeWidget(),r.focus(),o==null||o.toggleWidget(i,createCancelablePromise(l=>Promise.resolve(a)),this._peekMode??!1)}},r=>{this._ignoreModelChangeEvent=!1,onUnexpectedError(r)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:r}=e;this._editorService.openCodeEditor({resource:s,options:{selection:r,selectionSource:"code.jump",pinned:i}},this._editor,t)}},ReferencesController_1=Rl,Rl.ID="editor.contrib.referencesController",Rl);ReferencesController=ReferencesController_1=__decorate$1e([__param$1e(2,IContextKeyService),__param$1e(3,ICodeEditorService),__param$1e(4,INotificationService),__param$1e(5,IInstantiationService),__param$1e(6,IStorageService),__param$1e(7,IConfigurationService)],ReferencesController);function withController(n,e){const t=getOuterEditor(n);if(!t)return;const i=ReferencesController.get(t);i&&e(i)}KeybindingsRegistry.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:KeyChord(2089,60),when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(n){withController(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(n){withController(n,e=>{e.goToNextOrPreviousReference(!0)})}});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:ContextKeyExpr.or(ctxReferenceSearchVisible,PeekContext.inPeekEditor),handler(n){withController(n,e=>{e.goToNextOrPreviousReference(!1)})}});CommandsRegistry.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");CommandsRegistry.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");CommandsRegistry.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");CommandsRegistry.registerCommand("closeReferenceSearch",n=>withController(n,e=>e.closeWidget()));KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:ContextKeyExpr.and(PeekContext.inPeekEditor,ContextKeyExpr.not("config.editor.stablePeek"))});KeybindingsRegistry.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:ContextKeyExpr.and(ctxReferenceSearchVisible,ContextKeyExpr.not("config.editor.stablePeek"),ContextKeyExpr.or(EditorContextKeys.editorTextFocus,InputFocusedContext.negate()))});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:ContextKeyExpr.and(ctxReferenceSearchVisible,WorkbenchListFocusContextKey,WorkbenchTreeElementCanCollapse.negate(),WorkbenchTreeElementCanExpand.negate()),handler(n){var i;const t=(i=n.get(IListService).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof OneReference&&withController(n,s=>s.revealReference(t[0]))}});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:ContextKeyExpr.and(ctxReferenceSearchVisible,WorkbenchListFocusContextKey,WorkbenchTreeElementCanCollapse.negate(),WorkbenchTreeElementCanExpand.negate()),handler(n){var i;const t=(i=n.get(IListService).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof OneReference&&withController(n,s=>s.openReference(t[0],!0,!0))}});CommandsRegistry.registerCommand("openReference",n=>{var i;const t=(i=n.get(IListService).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof OneReference&&withController(n,s=>s.openReference(t[0],!1,!0))});var __decorate$1d=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1d=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ctxHasSymbols=new RawContextKey("hasSymbols",!1,localize("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),ISymbolNavigationService=createDecorator("ISymbolNavigationService");let SymbolNavigationService=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=ctxHasSymbols.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)==null||e.dispose(),(t=this._currentMessage)==null||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 EditorState(this._editorService),s=i.onDidChange(r=>{if(this._ignoreEditorChange)return;const o=this._editorService.getActiveCodeEditor();if(!o)return;const a=o.getModel(),l=o.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(isEqual(u.uri,a.uri))c=!0,d=d||Range$2.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=combinedDisposable(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:Range$2.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)==null||i.dispose();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?localize("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):localize("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};SymbolNavigationService=__decorate$1d([__param$1d(0,IContextKeyService),__param$1d(1,ICodeEditorService),__param$1d(2,INotificationService),__param$1d(3,IKeybindingService)],SymbolNavigationService);registerSingleton(ISymbolNavigationService,SymbolNavigationService,1);registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:ctxHasSymbols,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(ISymbolNavigationService).revealNext(e)}});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:ctxHasSymbols,primary:9,handler(n){n.get(ISymbolNavigationService).reset()}});let EditorState=class{constructor(e){this._listener=new Map,this._disposables=new DisposableStore,this._onDidChange=new Emitter$1,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(),dispose(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,combinedDisposable(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.dispose(),this._listener.delete(e)}};EditorState=__decorate$1d([__param$1d(0,ICodeEditorService)],EditorState);function shouldIncludeLocationLink(n,e){return e.uri.scheme===n.uri.scheme?!0:!matchesSomeScheme(e.uri,Schemas.walkThroughSnippet,Schemas.vscodeChatCodeBlock,Schemas.vscodeChatCodeCompareBlock)}async function getLocationLinks(n,e,t,i,s){const o=t.ordered(n,i).map(l=>Promise.resolve(s(l,n,e)).then(void 0,c=>{onUnexpectedExternalError(c)})),a=await Promise.all(o);return coalesce(a.flat()).filter(l=>shouldIncludeLocationLink(n,l))}function getDefinitionsAtPosition(n,e,t,i,s){return getLocationLinks(e,t,n,i,(r,o,a)=>r.provideDefinition(o,a,s))}function getDeclarationsAtPosition(n,e,t,i,s){return getLocationLinks(e,t,n,i,(r,o,a)=>r.provideDeclaration(o,a,s))}function getImplementationsAtPosition(n,e,t,i,s){return getLocationLinks(e,t,n,i,(r,o,a)=>r.provideImplementation(o,a,s))}function getTypeDefinitionsAtPosition(n,e,t,i,s){return getLocationLinks(e,t,n,i,(r,o,a)=>r.provideTypeDefinition(o,a,s))}function getReferencesAtPosition(n,e,t,i,s,r){return getLocationLinks(e,t,n,s,async(o,a,l)=>{var u,f;const c=(u=await o.provideReferences(a,l,{includeDeclaration:!0},r))==null?void 0:u.filter(g=>shouldIncludeLocationLink(a,g));if(!i||!c||c.length!==2)return c;const d=(f=await o.provideReferences(a,l,{includeDeclaration:!1},r))==null?void 0:f.filter(g=>shouldIncludeLocationLink(a,g));return d&&d.length===1?d:c})}async function _sortedAndDeduped(n){const e=await n(),t=new ReferencesModel(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}registerModelAndPositionCommand("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getDefinitionsAtPosition(i.definitionProvider,e,t,!1,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getDefinitionsAtPosition(i.definitionProvider,e,t,!0,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getTypeDefinitionsAtPosition(i.typeDefinitionProvider,e,t,!1,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeTypeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getTypeDefinitionsAtPosition(i.typeDefinitionProvider,e,t,!0,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getDeclarationsAtPosition(i.declarationProvider,e,t,!1,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeDeclarationProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getDeclarationsAtPosition(i.declarationProvider,e,t,!0,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeReferenceProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getReferencesAtPosition(i.referenceProvider,e,t,!1,!1,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeReferenceProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getReferencesAtPosition(i.referenceProvider,e,t,!1,!0,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeImplementationProvider",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getImplementationsAtPosition(i.implementationProvider,e,t,!1,CancellationToken.None);return _sortedAndDeduped(()=>s)});registerModelAndPositionCommand("_executeImplementationProvider_recursive",(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=getImplementationsAtPosition(i.implementationProvider,e,t,!0,CancellationToken.None);return _sortedAndDeduped(()=>s)});MenuRegistry.appendMenuItem(MenuId.EditorContext,{submenu:MenuId.EditorContextPeek,title:localize("peek.submenu","Peek"),group:"navigation",order:100});class SymbolNavigationAnchor{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof SymbolNavigationAnchor||Position$1.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const Bn=class Bn extends EditorAction2{static all(){return Bn._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Iterable.wrap(t.menu))(i.id===MenuId.EditorContext||i.id===MenuId.EditorContextPeek)&&(i.when=ContextKeyExpr.and(e.precondition,i.when));return t}constructor(e,t){super(Bn._patchConfig(t)),this.configuration=e,Bn._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const r=e.get(INotificationService),o=e.get(ICodeEditorService),a=e.get(IEditorProgressService),l=e.get(ISymbolNavigationService),c=e.get(ILanguageFeaturesService),d=e.get(IInstantiationService),u=t.getModel(),f=t.getPosition(),g=SymbolNavigationAnchor.is(i)?i:new SymbolNavigationAnchor(u,f),m=new EditorStateCancellationTokenSource(t,5),_=raceCancellation(this._getLocationModel(c,g.model,g.position,m.token),m.token).then(async v=>{var w;if(!v||m.token.isCancellationRequested)return;alert$1(v.ariaMessage);let C;if(v.referenceAt(u.uri,f)){const L=this._getAlternativeCommand(t);!Bn._activeAlternativeCommands.has(L)&&Bn._allSymbolNavigationCommands.has(L)&&(C=Bn._allSymbolNavigationCommands.get(L))}const S=v.references.length;if(S===0){if(!this.configuration.muteMessage){const L=u.getWordAtPosition(f);(w=MessageController.get(t))==null||w.showMessage(this._getNoResultFoundMessage(L),f)}}else if(S===1&&C)Bn._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(L=>C.runEditorCommand(L,t,i,s).finally(()=>{Bn._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(o,l,t,v,s)},v=>{r.error(v)}).finally(()=>{m.dispose()});return a.showWhile(_,250),_}async _onResult(e,t,i,s,r){const o=this._getGoToPreference(i);if(!(i instanceof EmbeddedCodeEditorWidget)&&(this.configuration.openInPeek||o==="peek"&&s.references.length>1))this._openInPeek(i,s,r);else{const a=s.firstReference(),l=s.references.length>1&&o==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,r):s.dispose(),o==="goto"&&t.put(a)}}async _openReference(e,t,i,s,r){let o;if(isLocationLink(i)&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:Range$2.collapseToStart(o),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(r){const l=a.getModel(),c=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const s=ReferencesController.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),createCancelablePromise(r=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Bn._allSymbolNavigationCommands=new Map,Bn._activeAlternativeCommands=new Set;let SymbolNavigationAction=Bn;class DefinitionAction extends SymbolNavigationAction{async _getLocationModel(e,t,i,s){return new ReferencesModel(await getDefinitionsAtPosition(e.definitionProvider,t,i,!1,s),localize("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?localize("noResultWord","No definition found for '{0}'",e.word):localize("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}var La;registerAction2((La=class extends DefinitionAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:La.id,title:{...localize2("actions.goToDecl.label","Go to Definition"),mnemonicTitle:localize({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:EditorContextKeys.hasDefinitionProvider,keybinding:[{when:EditorContextKeys.editorTextFocus,primary:70,weight:100},{when:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,IsWebContext),primary:2118,weight:100}],menu:[{id:MenuId.EditorContext,group:"navigation",order:1.1},{id:MenuId.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),CommandsRegistry.registerCommandAlias("editor.action.goToDeclaration",La.id)}},La.id="editor.action.revealDefinition",La));var ka;registerAction2((ka=class extends DefinitionAction{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:ka.id,title:localize2("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider,EditorContextKeys.isInEmbeddedEditor.toNegated()),keybinding:[{when:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,70),weight:100},{when:ContextKeyExpr.and(EditorContextKeys.editorTextFocus,IsWebContext),primary:KeyChord(2089,2118),weight:100}]}),CommandsRegistry.registerCommandAlias("editor.action.openDeclarationToTheSide",ka.id)}},ka.id="editor.action.revealDefinitionAside",ka));var Ia;registerAction2((Ia=class extends DefinitionAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Ia.id,title:localize2("actions.previewDecl.label","Peek Definition"),precondition:ContextKeyExpr.and(EditorContextKeys.hasDefinitionProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),keybinding:{when:EditorContextKeys.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:MenuId.EditorContextPeek,group:"peek",order:2}}),CommandsRegistry.registerCommandAlias("editor.action.previewDeclaration",Ia.id)}},Ia.id="editor.action.peekDefinition",Ia));class DeclarationAction extends SymbolNavigationAction{async _getLocationModel(e,t,i,s){return new ReferencesModel(await getDeclarationsAtPosition(e.declarationProvider,t,i,!1,s),localize("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?localize("decl.noResultWord","No declaration found for '{0}'",e.word):localize("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}var Pl;registerAction2((Pl=class extends DeclarationAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Pl.id,title:{...localize2("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:localize({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider,EditorContextKeys.isInEmbeddedEditor.toNegated()),menu:[{id:MenuId.EditorContext,group:"navigation",order:1.3},{id:MenuId.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?localize("decl.noResultWord","No declaration found for '{0}'",e.word):localize("decl.generic.noResults","No declaration found")}},Pl.id="editor.action.revealDeclaration",Pl));registerAction2(class extends DeclarationAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:localize2("actions.peekDecl.label","Peek Declaration"),precondition:ContextKeyExpr.and(EditorContextKeys.hasDeclarationProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),menu:{id:MenuId.EditorContextPeek,group:"peek",order:3}})}});class TypeDefinitionAction extends SymbolNavigationAction{async _getLocationModel(e,t,i,s){return new ReferencesModel(await getTypeDefinitionsAtPosition(e.typeDefinitionProvider,t,i,!1,s),localize("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?localize("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):localize("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}var Ml;registerAction2((Ml=class extends TypeDefinitionAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Ml.ID,title:{...localize2("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:localize({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:EditorContextKeys.hasTypeDefinitionProvider,keybinding:{when:EditorContextKeys.editorTextFocus,primary:0,weight:100},menu:[{id:MenuId.EditorContext,group:"navigation",order:1.4},{id:MenuId.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},Ml.ID="editor.action.goToTypeDefinition",Ml));var Ol;registerAction2((Ol=class extends TypeDefinitionAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Ol.ID,title:localize2("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:ContextKeyExpr.and(EditorContextKeys.hasTypeDefinitionProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),menu:{id:MenuId.EditorContextPeek,group:"peek",order:4}})}},Ol.ID="editor.action.peekTypeDefinition",Ol));class ImplementationAction extends SymbolNavigationAction{async _getLocationModel(e,t,i,s){return new ReferencesModel(await getImplementationsAtPosition(e.implementationProvider,t,i,!1,s),localize("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?localize("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):localize("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}var $l;registerAction2(($l=class extends ImplementationAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:$l.ID,title:{...localize2("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:localize({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:EditorContextKeys.hasImplementationProvider,keybinding:{when:EditorContextKeys.editorTextFocus,primary:2118,weight:100},menu:[{id:MenuId.EditorContext,group:"navigation",order:1.45},{id:MenuId.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},$l.ID="editor.action.goToImplementation",$l));var Fl;registerAction2((Fl=class extends ImplementationAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Fl.ID,title:localize2("actions.peekImplementation.label","Peek Implementations"),precondition:ContextKeyExpr.and(EditorContextKeys.hasImplementationProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),keybinding:{when:EditorContextKeys.editorTextFocus,primary:3142,weight:100},menu:{id:MenuId.EditorContextPeek,group:"peek",order:5}})}},Fl.ID="editor.action.peekImplementation",Fl));class ReferencesAction extends SymbolNavigationAction{_getNoResultFoundMessage(e){return e?localize("references.no","No references found for '{0}'",e.word):localize("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}registerAction2(class extends ReferencesAction{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...localize2("goToReferences.label","Go to References"),mnemonicTitle:localize({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),keybinding:{when:EditorContextKeys.editorTextFocus,primary:1094,weight:100},menu:[{id:MenuId.EditorContext,group:"navigation",order:1.45},{id:MenuId.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new ReferencesModel(await getReferencesAtPosition(e.referenceProvider,t,i,!0,!1,s),localize("ref.title","References"))}});registerAction2(class extends ReferencesAction{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:localize2("references.action.label","Peek References"),precondition:ContextKeyExpr.and(EditorContextKeys.hasReferenceProvider,PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated()),menu:{id:MenuId.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new ReferencesModel(await getReferencesAtPosition(e.referenceProvider,t,i,!1,!1,s),localize("ref.title","References"))}});class GenericGoToLocationAction extends SymbolNavigationAction{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:localize2("label.generic","Go to Any Symbol"),precondition:ContextKeyExpr.and(PeekContext.notInPeekEditor,EditorContextKeys.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new ReferencesModel(this._references,localize("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&localize("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}CommandsRegistry.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:URI},{name:"position",description:"The position at which to start",constraint:Position$1.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:async(n,e,t,i,s,r,o)=>{assertType(URI.isUri(e)),assertType(Position$1.isIPosition(t)),assertType(Array.isArray(i)),assertType(typeof s>"u"||typeof s=="string"),assertType(typeof o>"u"||typeof o=="boolean");const a=n.get(ICodeEditorService),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(isCodeEditor(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends GenericGoToLocationAction{_getNoResultFoundMessage(u){return r||super._getNoResultFoundMessage(u)}}({muteMessage:!r,openInPeek:!!o,openToSide:!1},i,s);c.get(IInstantiationService).invokeFunction(d.run.bind(d),l)})}});CommandsRegistry.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:URI},{name:"position",description:"The position at which to start",constraint:Position$1.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:async(n,e,t,i,s)=>{n.get(ICommandService).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});CommandsRegistry.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{assertType(URI.isUri(e)),assertType(Position$1.isIPosition(t));const i=n.get(ILanguageFeaturesService),s=n.get(ICodeEditorService);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(r=>{if(!isCodeEditor(r)||!r.hasModel())return;const o=ReferencesController.get(r);if(!o)return;const a=createCancelablePromise(c=>getReferencesAtPosition(i.referenceProvider,r.getModel(),Position$1.lift(t),!1,!1,c).then(d=>new ReferencesModel(d,localize("ref.title","References")))),l=new Range$2(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(o.toggleWidget(l,a,!1))})}});CommandsRegistry.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function showGoToContextMenu(n,e,t,i){const s=n.get(ITextModelService),r=n.get(IContextMenuService),o=n.get(ICommandService),a=n.get(IInstantiationService),l=n.get(INotificationService);if(await i.item.resolve(CancellationToken.None),!i.part.location)return;const c=i.part.location,d=[],u=new Set(MenuRegistry.getMenuItems(MenuId.EditorContext).map(g=>isIMenuItem(g)?g.command.id:generateUuid()));for(const g of SymbolNavigationAction.all())u.has(g.desc.id)&&d.push(new Action(g.desc.id,MenuItemAction.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const m=await s.createModelReference(c.uri);try{const _=new SymbolNavigationAnchor(m.object.textEditorModel,Range$2.getStartPosition(c.range)),v=i.item.anchor.range;await a.invokeFunction(g.runEditorCommand.bind(g),e,_,v)}finally{m.dispose()}}));if(i.part.command){const{command:g}=i.part;d.push(new Separator),d.push(new Action(g.id,g.title,void 0,!0,async()=>{try{await o.executeCommand(g.id,...g.arguments??[])}catch(m){l.notify({severity:Severity.Error,source:i.item.provider.displayName,message:m})}}))}const f=e.getOption(128);r.showContextMenu({domForShadowRoot:f?e.getDomNode()??void 0:void 0,getAnchor:()=>{const g=getDomNodePagePosition(t);return{x:g.left,y:g.top+g.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function goToDefinitionWithLocation(n,e,t,i){const r=await n.get(ITextModelService).createModelReference(i.uri);await t.invokeWithinContext(async o=>{const a=e.hasSideBySideModifier,l=o.get(IContextKeyService),c=PeekContext.inPeekEditor.getValue(l),d=!a&&t.getOption(89)&&!c;return new DefinitionAction({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(o,new SymbolNavigationAnchor(r.object.textEditorModel,Range$2.getStartPosition(i.range)),Range$2.lift(i.range))}),r.dispose()}var __decorate$1c=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1c=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlayHintsController_1;class InlayHintsCache{constructor(){this._entries=new LRUCache(50)}get(e){const t=InlayHintsCache._key(e);return this._entries.get(t)}set(e,t){const i=InlayHintsCache._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const IInlayHintsCache=createDecorator("IInlayHintsCache");registerSingleton(IInlayHintsCache,InlayHintsCache,1);class RenderedInlayHintLabelPart{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class ActiveInlayHintInfo{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}var wo;let InlayHintsController=(wo=class{static get(e){return e.getContribution(InlayHintsController_1.ID)??void 0}constructor(e,t,i,s,r,o,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=r,this._notificationService=o,this._instaService=a,this._disposables=new DisposableStore,this._sessionDisposables=new DisposableStore,this._decorationsMetadata=new Map,this._ruleFactory=new DynamicCssRules(this._editor),this._activeRenderMode=0,this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(142)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(142);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(ModifierKeyEmitter.getInstance().event(c=>{if(!this._editor.hasModel())return;const d=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(d!==this._activeRenderMode){this._activeRenderMode=d;const u=this._editor.getModel(),f=this._copyInlayHintsWithCurrentAnchor(u);this._updateHintsDecorators([u.getFullModelRange()],f),o.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(toDisposable(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const r=new Set,o=new RunOnceScheduler(async()=>{const a=Date.now();s==null||s.dispose(!0),s=new CancellationTokenSource$1;const l=t.onWillDispose(()=>s==null?void 0:s.cancel());try{const c=s.token,d=await InlayHintsFragments.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(o.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){d.dispose();return}for(const u of d.provider)typeof u.onDidChangeInlayHints=="function"&&!r.has(u)&&(r.add(u),this._sessionDisposables.add(u.onDidChangeInlayHints(()=>{o.isScheduled()||o.schedule()})));this._sessionDisposables.add(d),this._updateHintsDecorators(d.ranges,d.items),this._cacheHintsForFastRestore(t)}catch(c){onUnexpectedError(c)}finally{s.dispose(),l.dispose()}},this._debounceInfo.get(t));this._sessionDisposables.add(o),this._sessionDisposables.add(toDisposable(()=>s==null?void 0:s.dispose(!0))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!o.isScheduled())&&o.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{s==null||s.cancel();const l=Math.max(o.delay,1250);o.schedule(l)})),this._sessionDisposables.add(this._installDblClickGesture(()=>o.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new DisposableStore,t=e.add(new ClickLinkGesture(this._editor)),i=new DisposableStore;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[r]=s,o=this._getInlayHintLabelPart(r),a=this._editor.getModel();if(!o||!a){i.clear();return}const l=new CancellationTokenSource$1;i.add(toDisposable(()=>l.dispose(!0))),o.item.resolve(l.token),this._activeInlayHintPart=o.part.command||o.part.location?new ActiveInlayHintInfo(o,r.hasTriggerModifier):void 0;const c=a.validatePosition(o.item.hint.position).lineNumber,d=new Range$2(c,1,c,a.getLineMaxColumn(c)),u=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],u),i.add(toDisposable(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],u)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const r=this._getInlayHintLabelPart(s);if(r){const o=r.part;o.location?this._instaService.invokeFunction(goToDefinitionWithLocation,s,this._editor,o.location):Command$1.is(o.command)&&await this._invokeCommand(o.command,r.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(CancellationToken.None),isNonEmptyArray(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(r=>EditOperation.replace(Range$2.lift(r.range),r.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!isHTMLElement(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(showGoToContextMenu,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var i;if(e.target.type!==6)return;const t=(i=e.target.detail.injectedText)==null?void 0:i.options;if(t instanceof ModelDecorationInjectedTextOptions&&(t==null?void 0:t.attachedData)instanceof RenderedInlayHintLabelPart)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Severity.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const r=e.getDecorationRange(i);if(r){const o=new InlayHintAnchor(r,s.item.anchor.direction),a=s.item.with({anchor:o});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const r of i.sort(Range$2.compareRangesUsingStarts)){const o=t.validateRange(new Range$2(r.startLineNumber-30,r.startColumn,r.endLineNumber+30,r.endColumn));s.length===0||!Range$2.areIntersectingOrTouching(s[s.length-1],o)?s.push(o):s[s.length-1]=Range$2.plusRange(s[s.length-1],o)}return s}_updateHintsDecorators(e,t){var m,_;const i=[],s=(v,C,S,w,L)=>{const I={content:S,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:C.className,cursorStops:w,attachedData:L};i.push({item:v,classNameRef:C,decoration:{range:v.anchor.range,options:{description:"InlayHint",showIfCollapsed:v.anchor.range.isEmpty(),collapseOnReplaceEdit:!v.anchor.range.isEmpty(),stickiness:0,[v.anchor.direction]:this._activeRenderMode===0?I:void 0}}})},r=(v,C)=>{const S=this._ruleFactory.createClassNameRef({width:`${o/3|0}px`,display:"inline-block"});s(v,S," ",C?InjectedTextCursorStops.Right:InjectedTextCursorStops.None)},{fontSize:o,fontFamily:a,padding:l,isUniform:c}=this._getLayoutInfo(),d="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(d,a);let u={line:0,totalLen:0};for(const v of t){if(u.line!==v.anchor.range.startLineNumber&&(u={line:v.anchor.range.startLineNumber,totalLen:0}),u.totalLen>InlayHintsController_1._MAX_LABEL_LEN)continue;v.hint.paddingLeft&&r(v,!1);const C=typeof v.hint.label=="string"?[{label:v.hint.label}]:v.hint.label;for(let S=0;S0&&(R=R.slice(0,-A)+"…",T=!0),s(v,this._ruleFactory.createClassNameRef(N),fixSpace(R),I&&!v.hint.paddingRight?InjectedTextCursorStops.Right:InjectedTextCursorStops.None,new RenderedInlayHintLabelPart(v,S)),T)break}if(v.hint.paddingRight&&r(v,!0),i.length>InlayHintsController_1._MAX_DECORATORS)break}const f=[];for(const[v,C]of this._decorationsMetadata){const S=(_=this._editor.getModel())==null?void 0:_.getDecorationRange(v);S&&e.some(w=>w.containsRange(S))&&(f.push(v),C.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const g=StableEditorScrollState.capture(this._editor);this._editor.changeDecorations(v=>{const C=v.deltaDecorations(f,i.map(S=>S.decoration));for(let S=0;Si)&&(r=i);const o=e.fontFamily||s;return{fontSize:r,fontFamily:o,padding:t,isUniform:!t&&o===s&&r===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}},InlayHintsController_1=wo,wo.ID="editor.contrib.InlayHints",wo._MAX_DECORATORS=1500,wo._MAX_LABEL_LEN=43,wo);InlayHintsController=InlayHintsController_1=__decorate$1c([__param$1c(1,ILanguageFeaturesService),__param$1c(2,ILanguageFeatureDebounceService),__param$1c(3,IInlayHintsCache),__param$1c(4,ICommandService),__param$1c(5,INotificationService),__param$1c(6,IInstantiationService)],InlayHintsController);function fixSpace(n){const e=" ";return n.replace(/[ \t]/g,e)}CommandsRegistry.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;assertType(URI.isUri(t)),assertType(Range$2.isIRange(i));const{inlayHintsProvider:s}=n.get(ILanguageFeaturesService),r=await n.get(ITextModelService).createModelReference(t);try{const o=await InlayHintsFragments.create(s,r.object.textEditorModel,[Range$2.lift(i)],CancellationToken.None),a=o.items.map(l=>l.hint);return setTimeout(()=>o.dispose(),0),a}finally{r.dispose()}});var __decorate$1b=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1b=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class InlayHintsHoverAnchor extends HoverForeignElementAnchor{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let InlayHintsHover=class extends MarkdownHoverParticipant{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,o,l,s,r,c),this._resolverService=a,this.hoverOrdinal=6}suggestHoverAnchor(e){var s;if(!InlayHintsController.get(this._editor)||e.target.type!==6)return null;const i=(s=e.target.detail.injectedText)==null?void 0:s.options;return i instanceof ModelDecorationInjectedTextOptions&&i.attachedData instanceof RenderedInlayHintLabelPart?new InlayHintsHoverAnchor(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof InlayHintsHoverAnchor?new AsyncIterableObject(async s=>{const{part:r}=e;if(await r.item.resolve(i),i.isCancellationRequested)return;let o;typeof r.item.hint.tooltip=="string"?o=new MarkdownString().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(o=r.item.hint.tooltip),o&&s.emitOne(new MarkdownHover(this,e.range,[o],!1,0)),isNonEmptyArray(r.item.hint.textEdits)&&s.emitOne(new MarkdownHover(this,e.range,[new MarkdownString().appendText(localize("hint.dbl","Double-click to insert"))],!1,10001));let a;if(typeof r.part.tooltip=="string"?a=new MarkdownString().appendText(r.part.tooltip):r.part.tooltip&&(a=r.part.tooltip),a&&s.emitOne(new MarkdownHover(this,e.range,[a],!1,1)),r.part.location||r.part.command){let c;const u=this._editor.getOption(78)==="altKey"?isMacintosh?localize("links.navigate.kb.meta.mac","cmd + click"):localize("links.navigate.kb.meta","ctrl + click"):isMacintosh?localize("links.navigate.kb.alt.mac","option + click"):localize("links.navigate.kb.alt","alt + click");r.part.location&&r.part.command?c=new MarkdownString().appendText(localize("hint.defAndCommand","Go to Definition ({0}), right click for more",u)):r.part.location?c=new MarkdownString().appendText(localize("hint.def","Go to Definition ({0})",u)):r.part.command&&(c=new MarkdownString(`[${localize("hint.cmd","Execute Command")}](${asCommandLink(r.part.command)} "${r.part.command.title}") (${u})`,{isTrusted:!0})),c&&s.emitOne(new MarkdownHover(this,e.range,[c],!1,1e4))}const l=await this._resolveInlayHintLabelPartHover(r,i);for await(const c of l)s.emitOne(c)}):AsyncIterableObject.EMPTY}async _resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return AsyncIterableObject.EMPTY;const{uri:i,range:s}=e.part.location,r=await this._resolverService.createModelReference(i);try{const o=r.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(o)?getHoverProviderResultsAsAsyncIterable(this._languageFeaturesService.hoverProvider,o,new Position$1(s.startLineNumber,s.startColumn),t).filter(a=>!isEmptyMarkdownString(a.hover.contents)).map(a=>new MarkdownHover(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):AsyncIterableObject.EMPTY}finally{r.dispose()}}};InlayHintsHover=__decorate$1b([__param$1b(1,ILanguageService),__param$1b(2,IOpenerService),__param$1b(3,IKeybindingService),__param$1b(4,IHoverService),__param$1b(5,IConfigurationService),__param$1b(6,ITextModelService),__param$1b(7,ILanguageFeaturesService),__param$1b(8,ICommandService)],InlayHintsHover);class RenderedContentHover extends Disposable{constructor(e,t,i,s,r,o){super();const a=t.anchor,l=t.hoverParts;this._renderedHoverParts=this._register(new RenderedContentHoverParts(e,i,l,o,r));const{showAtPosition:c,showAtSecondaryPosition:d}=RenderedContentHover.computeHoverPositions(e,a.range,l);this.shouldAppearBeforeContent=l.some(u=>u.isBeforeContent),this.showAtPosition=c,this.showAtSecondaryPosition=d,this.initialMousePosX=a.initialMousePosX,this.initialMousePosY=a.initialMousePosY,this.shouldFocus=s.shouldFocus,this.source=s.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let s=1;if(e.hasModel()){const d=e._getViewModel(),u=d.coordinatesConverter,f=u.convertModelRangeToViewRange(t),g=d.getLineMinColumn(f.startLineNumber),m=new Position$1(f.startLineNumber,g);s=u.convertViewPositionToModelPosition(m).column}const r=t.startLineNumber;let o=t.startColumn,a;for(const d of i){const u=d.range,f=u.startLineNumber===r,g=u.endLineNumber===r;if(f&&g){const _=u.startColumn,v=Math.min(o,_);o=Math.max(v,s)}d.forceShowAtRange&&(a=u)}let l,c;if(a){const d=a.getStartPosition();l=d,c=d}else l=t.getStartPosition(),c=new Position$1(r,o);return{showAtPosition:l,showAtSecondaryPosition:c}}}class RenderedStatusBar{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}const yg=class yg extends Disposable{constructor(e,t,i,s,r){super(),this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=r,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,r,s)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return Disposable.None;let i=t[0].range;for(const r of t){const o=r.range;i=Range$2.plusRange(i,o)}const s=e.createDecorationsCollection();return s.set([{range:i,options:yg._DECORATION_OPTIONS}]),toDisposable(()=>{s.clear()})}_renderParts(e,t,i,s){const r=new EditorHoverStatusBar(s),o={fragment:this._fragment,statusBar:r,...i},a=new DisposableStore;for(const c of e){const d=this._renderHoverPartsForParticipant(t,c,o);a.add(d);for(const u of d.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:c,hoverPart:u.hoverPart,hoverElement:u.hoverElement})}const l=this._renderStatusBar(this._fragment,r);return l&&(a.add(l),this._renderedParts.push({type:"statusBar",hoverElement:l.hoverElement,actions:l.actions})),toDisposable(()=>{a.dispose()})}_renderHoverPartsForParticipant(e,t,i){const s=e.filter(o=>o.owner===t);return s.length>0?t.renderHoverParts(i,s):new RenderedHoverParts([])}_renderStatusBar(e,t){if(t.hasContent)return new RenderedStatusBar(e,t)}_registerListenersOnRenderedParts(){const e=new DisposableStore;return this._renderedParts.forEach((t,i)=>{const s=t.hoverElement;s.tabIndex=0,e.add(addDisposableListener(s,EventType$1.FOCUS_IN,r=>{r.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(addDisposableListener(s,EventType$1.FOCUS_OUT,r=>{r.stopPropagation(),this._focusedHoverPartIndex=-1}))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof MarkdownHoverParticipant&&!(i instanceof InlayHintsHover));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof ColorHoverParticipant)}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;const s=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,t);if(s===void 0)return;const r=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,s,i);r&&(this._renderedParts[t]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:r.hoverPart,hoverElement:r.hoverElement},this._context.onContentsChanged())}isColorPickerVisible(){var e;return((e=this._colorHoverParticipant)==null?void 0:e.isColorPickerVisible())??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const r=this._renderedParts.findIndex(o=>o.type==="hoverPart"&&o.participant===e);if(r===-1)throw new BugIndicatingError;return t-r}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}};yg._DECORATION_OPTIONS=ModelDecorationOptions.register({description:"content-hover-highlight",className:"hoverHighlight"});let RenderedContentHoverParts=yg;var __decorate$1a=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1a=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ContentHoverWidgetWrapper=class extends Disposable{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._onContentsChanged=this._register(new Emitter$1),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(ContentHoverWidget,this._editor)),this._participants=this._initializeHoverParticipants(),this._computer=new ContentHoverComputer(this._editor,this._participants),this._hoverOperation=this._register(new HoverOperation(this._editor,this._computer)),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of HoverParticipantRegistry.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>{var i;return(i=t.handleResize)==null?void 0:i.call(t)})})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{if(!this._computer.anchor)return;const i=t.hasLoadingMessage?this._addLoadingMessage(t.value):t.value;this._withResult(new HoverResult(this._computer.anchor,i,t.isComplete))}));const e=this._contentHoverWidget.getDomNode();this._register(addStandardDisposableListener(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(addStandardDisposableListener(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(TokenizationRegistry.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,i,s,r){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1;const a=this._editor.getOption(60).sticky,l=r&&this._contentHoverWidget.isMouseGettingCloser(r.event.posx,r.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._contentHoverWidget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,r){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=r,this._hoverOperation.start(t))}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){if(!this._computer.anchor)return e;for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const s=e.hoverParts.length===0,r=this._computer.insistOnKeepingHoverVisible;s&&r||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover=new RenderedContentHover(this._editor,e,this._participants,this._computer,t,this._keybindingService),this._renderedContentHover.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover):this._renderedContentHover.dispose()}_hideHover(){this._contentHoverWidget.hide()}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._onContentsChanged.fire(),this._contentHoverWidget.onContentsChanged()},setMinimumDimensions:s=>{this._contentHoverWidget.setMinimumDimensions(s)}}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const r=i[0];return this._startShowingOrUpdateHover(r,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const s of this._participants){if(!s.suggestHoverAnchor)continue;const r=s.suggestHoverAnchor(e);r&&t.push(r)}const i=e.target;switch(i.type){case 6:{t.push(new HoverRangeAnchor(0,i.range,e.event.posx,e.event.posy));break}case 7:{const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTextr.priority-s.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!isMousePositionWithinElement(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new HoverRangeAnchor(0,e,void 0,void 0),t,i,s,null)}async updateHoverVerbosityLevel(e,t,i){var s;(s=this._renderedContentHover)==null||s.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){var e;return((e=this._renderedContentHover)==null?void 0:e.focusedHoverPartIndex)??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){this._contentHoverWidget.focus()}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){var e;return((e=this._renderedContentHover)==null?void 0:e.isColorPickerVisible())??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};ContentHoverWidgetWrapper=__decorate$1a([__param$1a(1,IInstantiationService),__param$1a(2,IKeybindingService)],ContentHoverWidgetWrapper);const hover="";var __decorate$19=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$19=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ContentHoverController_1;const _sticky=!1;var Bl;let ContentHoverController=(Bl=class extends Disposable{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._onHoverContentsChanged=this._register(new Emitter$1),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new DisposableStore,this._hoverState={mouseDown:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new RunOnceScheduler(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(ContentHoverController_1.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._shouldNotHideCurrentHoverWidget(e)&&this._hideWidgets()}_shouldNotHideCurrentHoverWidget(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()}_isMouseOnContentHoverWidget(e){var i;const t=(i=this._contentWidget)==null?void 0:i.getDomNode();return t?isMousePositionWithinElement(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldNotHideCurrentHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=(o,a)=>{const l=this._isMouseOnContentHoverWidget(o);return a&&l},s=o=>{var c;const a=this._isMouseOnContentHoverWidget(o),l=((c=this._contentWidget)==null?void 0:c.isColorPickerVisible)??!1;return a&&l},r=(o,a)=>{var l,c,d,u;return(a&&((c=this._contentWidget)==null?void 0:c.containsNode((l=o.event.browserEvent.view)==null?void 0:l.document.activeElement))&&!((u=(d=o.event.browserEvent.view)==null?void 0:d.getSelection())!=null&&u.isCollapsed))??!1};return i(e,t)||s(e)||r(e,t)}_onEditorMouseMove(e){var a,l,c,d;if(this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,(a=this._contentWidget)!=null&&a.isFocused||(l=this._contentWidget)!=null&&l.isResizing))return;const t=this._hoverSettings.sticky;if(t&&((c=this._contentWidget)!=null&&c.isVisibleFromKeyboard))return;if(this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const s=this._hoverSettings.hidingDelay;if(((d=this._contentWidget)==null?void 0:d.isVisible)&&t&&s>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(s);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var l;if(!e)return;const i=(l=e.target.element)==null?void 0:l.classList.contains("colorpicker-color-decoration"),s=this._editor.getOption(149),r=this._hoverSettings.enabled,o=this._hoverState.activatedByDecoratorClick;if(i&&(s==="click"&&!o||s==="hover"&&!r&&!_sticky||s==="clickAndHover"&&!r&&!o)||!i&&!r&&!o){this._hideWidgets();return}this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateContentWidget().showsOrWillShow(e)}_onKeyDown(e){var s;if(!this._editor.hasModel())return;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1||t.kind===2&&(t.commandId===SHOW_OR_FOCUS_HOVER_ACTION_ID||t.commandId===INCREASE_HOVER_VERBOSITY_ACTION_ID||t.commandId===DECREASE_HOVER_VERBOSITY_ACTION_ID)&&((s=this._contentWidget)==null?void 0:s.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||i||this._hideWidgets()}_hideWidgets(){var e,t;this._hoverState.mouseDown&&((e=this._contentWidget)!=null&&e.isColorPickerVisible)||InlineSuggestionHintsContentWidget.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,(t=this._contentWidget)==null||t.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(ContentHoverWidgetWrapper,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,s,r=!1){this._hoverState.activatedByDecoratorClick=r,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){var e;return((e=this._contentWidget)==null?void 0:e.widget.isResizing)||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){var e;(e=this._contentWidget)==null||e.focus()}scrollUp(){var e;(e=this._contentWidget)==null||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)==null||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)==null||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)==null||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)==null||e.pageUp()}pageDown(){var e;(e=this._contentWidget)==null||e.pageDown()}goToTop(){var e;(e=this._contentWidget)==null||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)==null||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isVisible}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._contentWidget)==null||e.dispose()}},ContentHoverController_1=Bl,Bl.ID="editor.contrib.contentHover",Bl);ContentHoverController=ContentHoverController_1=__decorate$19([__param$19(1,IInstantiationService),__param$19(2,IKeybindingService)],ContentHoverController);const Sm=class Sm extends Disposable{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(149);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==ColorDecorationInjectedTextMarker||!i.range)return;const s=this._editor.getContribution(ContentHoverController.ID);if(s&&!s.isColorPickerVisible){const r=new Range$2(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);s.showContentHover(r,1,0,!1,!0)}}};Sm.ID="editor.contrib.colorContribution";let ColorContribution=Sm;registerEditorContribution(ColorContribution.ID,ColorContribution,2);HoverParticipantRegistry.register(ColorHoverParticipant);var __decorate$18=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$18=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},StandaloneColorPickerController_1,StandaloneColorPickerWidget_1,Vl;let StandaloneColorPickerController=(Vl=class extends Disposable{constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=EditorContextKeys.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=EditorContextKeys.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)==null||e.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(StandaloneColorPickerWidget,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)==null||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)==null||e.updateEditor(),this.hide()}static get(e){return e.getContribution(StandaloneColorPickerController_1.ID)}},StandaloneColorPickerController_1=Vl,Vl.ID="editor.contrib.standaloneColorPickerController",Vl);StandaloneColorPickerController=StandaloneColorPickerController_1=__decorate$18([__param$18(1,IContextKeyService),__param$18(2,IInstantiationService)],StandaloneColorPickerController);registerEditorContribution(StandaloneColorPickerController.ID,StandaloneColorPickerController,1);const PADDING=8,CLOSE_BUTTON_WIDTH=22;var Wl;let StandaloneColorPickerWidget=(Wl=class extends Disposable{constructor(e,t,i,s,r,o,a){var u;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=r,this._languageFeaturesService=o,this._editorWorkerService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new Emitter$1),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(StandaloneColorPickerParticipant,this._editor),this._position=(u=this._editor._getViewModel())==null?void 0:u.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),c=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},d=this._register(trackFocus(this._body));this._register(d.onDidBlur(f=>{this.hide()})),this._register(d.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var m;const g=(m=f.target.element)==null?void 0:m.classList;g&&g.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(c),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return StandaloneColorPickerWidget_1.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new StandaloneColorPickerResult(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new DefaultDocumentColorProvider(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),s=this._register(new EditorHoverStatusBar(this._keybindingService)),r={fragment:i,statusBar:s,onContentsChanged:()=>{},hide:()=>this.hide()};this._colorHover=e;const o=this._standaloneColorPickerParticipant.renderHoverParts(r,[e]);if(!o)return;this._register(o.disposables);const a=o.colorPicker;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),a.layout();const l=a.body,c=l.saturationBox.domNode.clientWidth,d=l.domNode.clientWidth-c-CLOSE_BUTTON_WIDTH-PADDING,u=a.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const f=a.header,g=f.pickedColorNode;g.style.width=c+PADDING+"px";const m=f.originalColorNode;m.style.width=d+"px";const _=a.header.closeButton;_==null||_.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},StandaloneColorPickerWidget_1=Wl,Wl.ID="editor.contrib.standaloneColorPickerWidget",Wl);StandaloneColorPickerWidget=StandaloneColorPickerWidget_1=__decorate$18([__param$18(3,IInstantiationService),__param$18(4,IKeybindingService),__param$18(5,ILanguageFeaturesService),__param$18(6,IEditorWorkerService)],StandaloneColorPickerWidget);class StandaloneColorPickerResult{constructor(e,t){this.value=e,this.foundInEditor=t}}class ShowOrFocusStandaloneColorPicker extends EditorAction2{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...localize2("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:localize({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:MenuId.CommandPalette}],metadata:{description:localize2("showOrFocusStandaloneColorPickerDescription","Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){var i;(i=StandaloneColorPickerController.get(t))==null||i.showOrFocus()}}class HideStandaloneColorPicker extends EditorAction{constructor(){super({id:"editor.action.hideColorPicker",label:localize({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:EditorContextKeys.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:localize2("hideColorPickerDescription","Hide the standalone color picker.")}})}run(e,t){var i;(i=StandaloneColorPickerController.get(t))==null||i.hide()}}class InsertColorWithStandaloneColorPicker extends EditorAction{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:localize({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:EditorContextKeys.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:localize2("insertColorWithStandaloneColorPickerDescription","Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){var i;(i=StandaloneColorPickerController.get(t))==null||i.insertColor()}}registerEditorAction(HideStandaloneColorPicker);registerEditorAction(InsertColorWithStandaloneColorPicker);registerAction2(ShowOrFocusStandaloneColorPicker);class BlockCommentCommand{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,r=e.length;if(i+s>r)return!1;for(let o=0;o=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,r,o){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,u=r.getLineContent(a),f=r.getLineContent(c);let g=u.lastIndexOf(t,l-1+t.length),m=f.indexOf(i,d-1-i.length);if(g!==-1&&m!==-1)if(a===c)u.substring(g+t.length,m).indexOf(i)>=0&&(g=-1,m=-1);else{const v=u.substring(g+t.length),C=f.substring(0,m);(v.indexOf(i)>=0||C.indexOf(i)>=0)&&(g=-1,m=-1)}let _;g!==-1&&m!==-1?(s&&g+t.length0&&f.charCodeAt(m-1)===32&&(i=" "+i,m-=1),_=BlockCommentCommand._createRemoveBlockCommentOperations(new Range$2(a,g+t.length+1,c,m+1),t,i)):(_=BlockCommentCommand._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=_.length===1?i:null);for(const v of _)o.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return Range$2.isEmpty(e)?s.push(EditOperation.delete(new Range$2(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(EditOperation.delete(new Range$2(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(EditOperation.delete(new Range$2(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const r=[];return Range$2.isEmpty(e)?r.push(EditOperation.replace(new Range$2(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(r.push(EditOperation.insert(new Position$1(e.startLineNumber,e.startColumn),t+(s?" ":""))),r.push(EditOperation.insert(new Position$1(e.endLineNumber,e.endColumn),(s?" ":"")+i))),r}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const r=e.getLanguageIdAtPosition(i,s),o=this.languageConfigurationService.getLanguageConfiguration(r).comments;!o||!o.blockCommentStartToken||!o.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],r=i[1];return new Selection$1(s.range.endLineNumber,s.range.endColumn,r.range.startLineNumber,r.range.startColumn)}else{const s=i[0].range,r=this._usedEndToken?-this._usedEndToken.length-1:0;return new Selection$1(s.endLineNumber,s.endColumn+r,s.endLineNumber,s.endColumn+r)}}}class LineCommentCommand{constructor(e,t,i,s,r,o,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=r,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const r=e.getLanguageIdAtPosition(t,1),o=s.getLanguageConfiguration(r).comments,a=o?o.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;cr?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class CommentLineAction extends EditorAction{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ILanguageConfigurationService);if(!t.hasModel())return;const s=t.getModel(),r=[],o=s.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,u)=>({selection:d,index:u,ignoreFirstLine:!1}));l.sort((d,u)=>Range$2.compareRangesUsingStarts(d.selection,u.selection));let c=l[0];for(let d=1;d=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$17=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ContextMenuController_1,Hl;let ContextMenuController=(Hl=class{static get(e){return e.getContribution(ContextMenuController_1.ID)}constructor(e,t,i,s,r,o,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=r,this._menuService=o,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new DisposableStore,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),u=c.srcElement;u.shadowRoot&&getShadowRoot(d)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const r of s){const[,o]=r;let a=0;for(const l of o)if(l instanceof SubmenuItemAction){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new SubmenuAction(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new Separator)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let s=t;if(!s){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=getDomNodePagePosition(this._editor.getDomNode()),l=a.left+o.left,c=a.top+o.top+o.height;s={x:l,y:c}}const r=this._editor.getOption(128)&&!isIOS;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>s,getActions:()=>e,getActionViewItem:o=>{const a=this._keybindingFor(o);if(a)return new ActionViewItem(o,o,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=o;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new ActionViewItem(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()||isStandaloneEditorWorkspace(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let i=0;const s=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),r=(c,d)=>new SubmenuAction(`menu-action-${++i}`,c,d,void 0),o=(c,d,u,f,g)=>{if(!d)return s({label:c,enabled:d,run:()=>{}});const m=v=>()=>{this._configurationService.updateValue(u,v)},_=[];for(const v of g)_.push(s({label:v.label,checked:f===v.value,run:m(v.value)}));return r(c,_)},a=[];a.push(s({label:localize("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Separator),a.push(s({label:localize("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(o(localize("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:localize("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:localize("context.minimap.size.fill","Fill"),value:"fill"},{label:localize("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(o(localize("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:localize("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:localize("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(128)&&!isIOS;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},ContextMenuController_1=Hl,Hl.ID="editor.contrib.contextmenu",Hl);ContextMenuController=ContextMenuController_1=__decorate$17([__param$17(1,IContextMenuService),__param$17(2,IContextViewService),__param$17(3,IContextKeyService),__param$17(4,IKeybindingService),__param$17(5,IMenuService),__param$17(6,IConfigurationService),__param$17(7,IWorkspaceContextService)],ContextMenuController);class ShowContextMenu extends EditorAction{constructor(){super({id:"editor.action.showContextMenu",label:localize("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=ContextMenuController.get(t))==null||i.showContextMenu()}}registerEditorContribution(ContextMenuController.ID,ContextMenuController,2);registerEditorAction(ShowContextMenu);class CursorState{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new CursorState(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new StackElement(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 StackElement(new CursorState(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 StackElement(new CursorState(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}};Sg.ID="editor.contrib.cursorUndoRedoController";let CursorUndoRedoController=Sg;class CursorUndo extends EditorAction{constructor(){super({id:"cursorUndo",label:localize("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var s;(s=CursorUndoRedoController.get(t))==null||s.cursorUndo()}}class CursorRedo extends EditorAction{constructor(){super({id:"cursorRedo",label:localize("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var s;(s=CursorUndoRedoController.get(t))==null||s.cursorRedo()}}registerEditorContribution(CursorUndoRedoController.ID,CursorUndoRedoController,0);registerEditorAction(CursorUndo);registerEditorAction(CursorRedo);const dnd="";class DragAndDropCommand{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 Range$2(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 Selection$1(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 Selection$1(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(hasTriggerModifier(e)&&(this._modifierPressed=!0),this._mouseDown&&hasTriggerModifier(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(hasTriggerModifier(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===lo.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(r=>t.position&&r.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}hasTriggerModifier(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 Position$1(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:r,selectionStartColumn:o}=s;i=[new Selection$1(r,o,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new Selection$1(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(hasTriggerModifier(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(lo.ID,new DragAndDropCommand(this._dragSelection,t,hasTriggerModifier(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 Range$2(e.lineNumber,e.column,e.lineNumber,e.column),options:lo._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()}};lo.ID="editor.contrib.dragAndDrop",lo.TRIGGER_KEY_VALUE=isMacintosh?6:5,lo._DECORATION_OPTIONS=ModelDecorationOptions.register({description:"dnd-target",className:"dnd-target"});let DragAndDropController=lo;registerEditorContribution(DragAndDropController.ID,DragAndDropController,2);registerEditorContribution(CopyPasteController.ID,CopyPasteController,0);registerEditorFeature(DefaultPasteProvidersFeature);registerEditorCommand(new class extends EditorCommand{constructor(){super({id:changePasteTypeCommandId,precondition:pasteWidgetVisibleCtx,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e){var t;return(t=CopyPasteController.get(e))==null?void 0:t.changePasteType()}});registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.hidePasteWidget",precondition:pasteWidgetVisibleCtx,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e){var t;(t=CopyPasteController.get(e))==null||t.clearWidgets()}});var zl;registerEditorAction((zl=class extends EditorAction{constructor(){super({id:"editor.action.pasteAs",label:localize("pasteAs","Paste As..."),alias:"Paste As...",precondition:EditorContextKeys.writable,metadata:{description:"Paste as",args:[{name:"args",schema:zl.argsSchema}]}})}run(e,t,i){var r;let s=typeof(i==null?void 0:i.kind)=="string"?i.kind:void 0;return!s&&i&&(s=typeof i.id=="string"?i.id:void 0),(r=CopyPasteController.get(t))==null?void 0:r.pasteAs(s?new HierarchicalKind(s):void 0)}},zl.argsSchema={type:"object",properties:{kind:{type:"string",description:localize("pasteAs.kind","The kind of the paste edit to try applying. If not provided or there are multiple edits for this kind, the editor will show a picker.")}}},zl));registerEditorAction(class extends EditorAction{constructor(){super({id:"editor.action.pasteAsText",label:localize("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:EditorContextKeys.writable})}run(n,e){var t;return(t=CopyPasteController.get(e))==null?void 0:t.pasteAs({providerId:DefaultTextPasteOrDropEditProvider.id})}});class TreeViewsDnDService{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 DraggedTreeItemsIdentifier{constructor(e){this.identifier=e}}const ITreeViewsDnDService=createDecorator("treeViewsDndService");registerSingleton(ITreeViewsDnDService,TreeViewsDnDService,1);var __decorate$16=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$16=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},DropIntoEditorController_1;const defaultProviderConfig="editor.experimental.dropIntoEditor.defaultProvider",changeDropTypeCommandId="editor.changeDropType",dropWidgetVisibleCtx=new RawContextKey("dropWidgetVisible",!1,localize("dropWidgetVisible","Whether the drop widget is showing"));var Ul;let DropIntoEditorController=(Ul=class extends Disposable{static get(e){return e.getContribution(DropIntoEditorController_1.ID)}constructor(e,t,i,s,r){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=r,this.treeItemsTransfer=LocalSelectionTransfer.getInstance(),this._dropProgressManager=this._register(t.createInstance(InlineProgressManager,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(PostEditWidgetManager,"dropIntoEditor",e,dropWidgetVisibleCtx,{id:changeDropTypeCommandId,label:localize("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(o=>this.onDropIntoEditor(e,o.position,o.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var r;if(!i.dataTransfer||!e.hasModel())return;(r=this._currentOperation)==null||r.cancel(),e.focus(),e.setPosition(t);const s=createCancelablePromise(async o=>{const a=new DisposableStore,l=a.add(new EditorStateCancellationTokenSource(e,1,void 0,o));try{const c=await this.extractDataTransferData(i);if(c.size===0||l.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const u=this._languageFeaturesService.documentDropEditProvider.ordered(d).filter(g=>g.dropMimeTypes?g.dropMimeTypes.some(m=>c.matches(m)):!0),f=a.add(await this.getDropEdits(u,d,t,c,l));if(l.token.isCancellationRequested)return;if(f.edits.length){const g=this.getInitialActiveEditIndex(d,f.edits),m=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([Range$2.fromPositions(t)],{activeEditIndex:g,allEdits:f.edits},m,async _=>_,o)}}finally{a.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,localize("dropIntoEditorProgress","Running drop handlers. Click to cancel"),s,{cancel:()=>s.cancel()}),this._currentOperation=s}async getDropEdits(e,t,i,s,r){const o=new DisposableStore,a=await raceCancellation(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,s,r.token);return d&&o.add(d),d==null?void 0:d.edits.map(u=>({...u,providerId:c.id}))}catch(d){console.error(d)}})),r.token),l=coalesce(a??[]).flat();return{edits:sortEditsByYieldTo(l),dispose:()=>o.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(defaultProviderConfig,{resource:e.uri});for(const[s,r]of Object.entries(i)){const o=new HierarchicalKind(r),a=t.findIndex(l=>o.value===l.providerId&&l.handledMimeType&&matchesMimeType(s,[l.handledMimeType]));if(a>=0)return a}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new VSDataTransfer;const t=toExternalVSDataTransfer(e.dataTransfer);if(this.treeItemsTransfer.hasData(DraggedTreeItemsIdentifier.prototype)){const i=this.treeItemsTransfer.getData(DraggedTreeItemsIdentifier.prototype);if(Array.isArray(i))for(const s of i){const r=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(r)for(const[o,a]of r)t.replace(o,a)}}return t}},DropIntoEditorController_1=Ul,Ul.ID="editor.contrib.dropIntoEditorController",Ul);DropIntoEditorController=DropIntoEditorController_1=__decorate$16([__param$16(1,IInstantiationService),__param$16(2,IConfigurationService),__param$16(3,ILanguageFeaturesService),__param$16(4,ITreeViewsDnDService)],DropIntoEditorController);registerEditorContribution(DropIntoEditorController.ID,DropIntoEditorController,2);registerEditorFeature(DefaultDropProvidersFeature);registerEditorCommand(new class extends EditorCommand{constructor(){super({id:changeDropTypeCommandId,precondition:dropWidgetVisibleCtx,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=DropIntoEditorController.get(e))==null||i.changeDropType()}});registerEditorCommand(new class extends EditorCommand{constructor(){super({id:"editor.hideDropWidget",precondition:dropWidgetVisibleCtx,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e,t){var i;(i=DropIntoEditorController.get(e))==null||i.clearWidgets()}});Registry.as(Extensions$6.Configuration).registerConfiguration({...editorConfigurationBaseNode,properties:{[defaultProviderConfig]:{type:"object",scope:5,description:localize("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});const Gi=class Gi{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Gi._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Gi._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let r=this._editor.getModel().getDecorationRange(t);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){const o=r.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(o);r=new Range$2(r.startLineNumber,r.startColumn,o,a)}this._rangeHighlightDecorationId=s.addDecoration(r,Gi._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Gi._FIND_MATCH_DECORATION;const r=[];if(e.length>1e3){s=Gi._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let u=e[0].range.startLineNumber,f=e[0].range.endLineNumber;for(let g=1,m=e.length;g=_.startLineNumber?_.endLineNumber>f&&(f=_.endLineNumber):(r.push({range:new Range$2(u,1,f,1),options:Gi._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=_.startLineNumber,f=_.endLineNumber)}r.push({range:new Range$2(u,1,f,1),options:Gi._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=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,Gi._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return r;if(!(r.startColumn0){const i=[];for(let o=0;oRange$2.compareRangesUsingStarts(o.range,a.range));const s=[];let r=i[0];for(let o=1;o0?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 validateSpecificSpecialCharacter(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function buildReplaceStringForSpecificSpecialCharacter(n,e,t){const i=e.split(t),s=n[0].split(t);let r="";return i.forEach((o,a)=>{r+=buildReplaceStringWithCasePreserved([s[a]],o)+t}),r.slice(0,-1)}class StaticValueReplacePattern{constructor(e){this.staticValue=e,this.kind=0}}class DynamicPiecesReplacePattern{constructor(e){this.pieces=e,this.kind=1}}class ReplacePattern{static fromStaticValue(e){return new ReplacePattern([ReplacePiece.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new StaticValueReplacePattern(""):e.length===1&&e[0].staticValue!==null?this._state=new StaticValueReplacePattern(e[0].staticValue):this._state=new DynamicPiecesReplacePattern(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?buildReplaceStringWithCasePreserved(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,r=this._state.pieces.length;s0){const l=[],c=o.caseOps.length;let d=0;for(let u=0,f=a.length;u=c){l.push(a.slice(u));break}switch(o.caseOps[d]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),d++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),d++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const o=n.charCodeAt(i);switch(o){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(o));break}continue}if(r===36){if(i++,i>=s)break;const o=n.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-48;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,dispose(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},RESEARCH_DELAY)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new Range$2(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,MATCHES_LIMIT);this._decorations.set(s,i);const r=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(r);if(o===0&&s.length>0){const a=findFirstIdxMonotonousOrArrLen(s.map(l=>l.range),l=>Range$2.compareRangesUsingStarts(l,r)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const r=this._editor.getModel();return t||s===1?(i===1?i=r.getLineCount():i--,s=r.getLineMaxColumn(i)):s--,new Position$1(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const r=this._editor.getModel();return t||s===r.getLineMaxColumn(i)?(i===r.getLineCount()?i=1:i++,s=1):s++,new Position$1(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()FindModelBoundToEditorModel._getSearchRange(this._editor.getModel(),r));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=MATCHES_LIMIT?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new SearchParams(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(132):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let u="mu";i.ignoreCase&&(u+="i"),i.global&&(u+="g"),i=new RegExp(i.source,u)}const s=this._editor.getModel(),r=s.getValue(1),o=s.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=r.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=r.replace(i,a.buildReplaceString(null,c));const d=new ReplaceCommandThatPreservesSelection(o,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let o=0,a=i.length;oo.range),s);this._executeEditorCommand("replaceAll",r)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(r=>new Selection$1(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn));const s=this._editor.getSelection();for(let r=0,o=i.length;rthis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:asCssVariable(inputActiveOptionBorder),inputActiveOptionForeground:asCssVariable(inputActiveOptionForeground),inputActiveOptionBackground:asCssVariable(inputActiveOptionBackground)},r=this._register(createInstantHoverDelegate());this.caseSensitive=this._register(new CaseSensitiveToggle({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverDelegate:r,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new WholeWordsToggle({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverDelegate:r,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new RegexToggle({appendTitle:this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),isChecked:this._state.isRegex,hoverDelegate:r,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let a=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(addDisposableListener(this._domNode,EventType$1.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(addDisposableListener(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return wg.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};wg.ID="editor.contrib.findOptionsWidget";let FindOptionsWidget=wg;function effectiveOptionValue(n,e){return n===1?!0:n===2?!1:e}class FindReplaceState extends Disposable{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return effectiveOptionValue(this._isRegexOverride,this._isRegex)}get wholeWord(){return effectiveOptionValue(this._wholeWordOverride,this._wholeWord)}get matchCase(){return effectiveOptionValue(this._matchCaseOverride,this._matchCase)}get preserveCase(){return effectiveOptionValue(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new Emitter$1),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let r=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,r=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,r=!0),typeof i<"u"&&(Range$2.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,r=!0)),r&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var d;const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let r=!1;const o=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&((d=e.searchScope)!=null&&d.every(u=>{var f;return(f=this._searchScope)==null?void 0:f.some(g=>!Range$2.equalsRange(g,u))})||(this._searchScope=e.searchScope,s.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,o!==this.isRegex&&(r=!0,s.isRegex=!0),a!==this.wholeWord&&(r=!0,s.wholeWord=!0),l!==this.matchCase&&(r=!0,s.matchCase=!0),c!==this.preserveCase&&(r=!0,s.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=MATCHES_LIMIT}}const findWidget="",NLS_DEFAULT_LABEL=localize("defaultLabel","input"),NLS_PRESERVE_CASE_LABEL=localize("label.preserveCaseToggle","Preserve Case");class PreserveCaseToggle extends Toggle{constructor(e){super({icon:Codicon.preserveCase,title:NLS_PRESERVE_CASE_LABEL+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??getDefaultHoverDelegate("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ReplaceInput extends Widget$1{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new Emitter$1),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new Emitter$1),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new Emitter$1),this._onInput=this._register(new Emitter$1),this._onKeyUp=this._register(new Emitter$1),this._onPreserveCaseKeyDown=this._register(new Emitter$1),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||NLS_DEFAULT_LABEL;const r=s.appendPreserveCaseLabel||"",o=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new HistoryInputBox(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new PreserveCaseToggle({appendTitle:r,isChecked:!1,...s.toggleStyles})),this._register(this.preserveCase.onChange(f=>{this._onDidOptionChange.fire(f),!f&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(f=>{this._onPreserveCaseKeyDown.fire(f)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,f=>{if(f.equals(15)||f.equals(17)||f.equals(9)){const g=d.indexOf(this.domNode.ownerDocument.activeElement);if(g>=0){let m=-1;f.equals(17)?m=(g+1)%d.length:f.equals(15)&&(g===0?m=d.length-1:m=g-1),f.equals(9)?(d[g].blur(),this.inputBox.focus()):m>=0&&d[m].focus(),EventHelper.stop(f,!0)}}});const u=document.createElement("div");u.className="controls",u.style.display=this._showOptionButtons?"block":"none",u.appendChild(this.preserveCase.domNode),this.domNode.appendChild(u),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,f=>this._onKeyDown.fire(f)),this.onkeyup(this.inputBox.inputElement,f=>this._onKeyUp.fire(f)),this.oninput(this.inputBox.inputElement,f=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,f=>this._onMouseDown.fire(f))}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.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var __decorate$15=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$15=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const historyNavigationVisible=new RawContextKey("suggestWidgetVisible",!1,localize("suggestWidgetVisible","Whether suggestion are visible")),HistoryNavigationWidgetFocusContext="historyNavigationWidgetFocus",HistoryNavigationForwardsEnablementContext="historyNavigationForwardsEnabled",HistoryNavigationBackwardsEnablementContext="historyNavigationBackwardsEnabled";let lastFocusedWidget;const widgets=[];function registerAndCreateHistoryNavigationContext(n,e){if(widgets.includes(e))throw new Error("Cannot register the same widget multiple times");widgets.push(e);const t=new DisposableStore,i=new RawContextKey(HistoryNavigationWidgetFocusContext,!1).bindTo(n),s=new RawContextKey(HistoryNavigationForwardsEnablementContext,!0).bindTo(n),r=new RawContextKey(HistoryNavigationBackwardsEnablementContext,!0).bindTo(n),o=()=>{i.set(!0),lastFocusedWidget=e},a=()=>{i.set(!1),lastFocusedWidget===e&&(lastFocusedWidget=void 0)};return isActiveElement(e.element)&&o(),t.add(e.onDidFocus(()=>o())),t.add(e.onDidBlur(()=>a())),t.add(toDisposable(()=>{widgets.splice(widgets.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:r,dispose(){t.dispose()}}}let ContextScopedFindInput=class extends FindInput{constructor(e,t,i,s){super(e,t,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(registerAndCreateHistoryNavigationContext(r,this.inputBox))}};ContextScopedFindInput=__decorate$15([__param$15(3,IContextKeyService)],ContextScopedFindInput);let ContextScopedReplaceInput=class extends ReplaceInput{constructor(e,t,i,s,r=!1){super(e,t,r,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(registerAndCreateHistoryNavigationContext(o,this.inputBox))}};ContextScopedReplaceInput=__decorate$15([__param$15(3,IContextKeyService)],ContextScopedReplaceInput);KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetFocusContext),ContextKeyExpr.equals(HistoryNavigationBackwardsEnablementContext,!0),ContextKeyExpr.not("isComposing"),historyNavigationVisible.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{lastFocusedWidget==null||lastFocusedWidget.showPreviousValue()}});KeybindingsRegistry.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:ContextKeyExpr.and(ContextKeyExpr.has(HistoryNavigationWidgetFocusContext),ContextKeyExpr.equals(HistoryNavigationForwardsEnablementContext,!0),ContextKeyExpr.not("isComposing"),historyNavigationVisible.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{lastFocusedWidget==null||lastFocusedWidget.showNextValue()}});function showHistoryKeybindingHint(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))==null?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))==null?void 0:t.getElectronAccelerator())==="Down"}const findCollapsedIcon=registerIcon("find-collapsed",Codicon.chevronRight,localize("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),findExpandedIcon=registerIcon("find-expanded",Codicon.chevronDown,localize("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),findSelectionIcon=registerIcon("find-selection",Codicon.selection,localize("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),findReplaceIcon=registerIcon("find-replace",Codicon.replace,localize("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),findReplaceAllIcon=registerIcon("find-replace-all",Codicon.replaceAll,localize("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),findPreviousMatchIcon=registerIcon("find-previous-match",Codicon.arrowUp,localize("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),findNextMatchIcon=registerIcon("find-next-match",Codicon.arrowDown,localize("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),NLS_FIND_DIALOG_LABEL=localize("label.findDialog","Find / Replace"),NLS_FIND_INPUT_LABEL=localize("label.find","Find"),NLS_FIND_INPUT_PLACEHOLDER=localize("placeholder.find","Find"),NLS_PREVIOUS_MATCH_BTN_LABEL=localize("label.previousMatchButton","Previous Match"),NLS_NEXT_MATCH_BTN_LABEL=localize("label.nextMatchButton","Next Match"),NLS_TOGGLE_SELECTION_FIND_TITLE=localize("label.toggleSelectionFind","Find in Selection"),NLS_CLOSE_BTN_LABEL=localize("label.closeButton","Close"),NLS_REPLACE_INPUT_LABEL=localize("label.replace","Replace"),NLS_REPLACE_INPUT_PLACEHOLDER=localize("placeholder.replace","Replace"),NLS_REPLACE_BTN_LABEL=localize("label.replaceButton","Replace"),NLS_REPLACE_ALL_BTN_LABEL=localize("label.replaceAllButton","Replace All"),NLS_TOGGLE_REPLACE_MODE_BTN_LABEL=localize("label.toggleReplaceButton","Toggle Replace"),NLS_MATCHES_COUNT_LIMIT_TITLE=localize("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",MATCHES_LIMIT),NLS_MATCHES_LOCATION=localize("label.matchesLocation","{0} of {1}"),NLS_NO_RESULTS=localize("label.noResults","No results"),FIND_WIDGET_INITIAL_WIDTH=419,PART_WIDTH=275,FIND_INPUT_AREA_WIDTH=PART_WIDTH-54;let MAX_MATCHES_COUNT_WIDTH=69;const FIND_INPUT_AREA_HEIGHT=33,ctrlEnterReplaceAllWarningPromptedKey="ctrlEnterReplaceAll.windows.donotask",ctrlKeyMod=isMacintosh?256:2048;class FindWidgetViewZone{constructor(e){this.afterLineNumber=e,this.heightInPx=FIND_INPUT_AREA_HEIGHT,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function stopPropagationForMultiLineUpwards(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function stopPropagationForMultiLineDownwards(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(92)&&(this._codeEditor.getOption(92)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(146)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const f=this._codeEditor.getOption(41).loop;this._state.change({loop:f},!1);const g=this._codeEditor.getOption(41).addExtraSpaceOnTop;g&&!this._viewZone&&(this._viewZone=new FindWidgetViewZone(0),this._showViewZone()),!g&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const u=await this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}})),this._findInputFocused=CONTEXT_FIND_INPUT_FOCUSED.bindTo(o),this._findFocusTracker=this._register(trackFocus(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=CONTEXT_REPLACE_INPUT_FOCUSED.bindTo(o),this._replaceFocusTracker=this._register(trackFocus(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new FindWidgetViewZone(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return xg.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(92)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=getTotalWidth(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,onUnexpectedError)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var t;this._matchesCount.style.minWidth=MAX_MATCHES_COUNT_WIDTH+"px",this._state.matchesCount>=MATCHES_LIMIT?this._matchesCount.title=NLS_MATCHES_COUNT_LIMIT_TITLE:this._matchesCount.title="",(t=this._matchesCount.firstChild)==null||t.remove();let e;if(this._state.matchesCount>0){let i=String(this._state.matchesCount);this._state.matchesCount>=MATCHES_LIMIT&&(i+="+");let s=String(this._state.matchesPosition);s==="0"&&(s="?"),e=format$1(NLS_MATCHES_LOCATION,s,i)}else e=NLS_NO_RESULTS;this._matchesCount.appendChild(document.createTextNode(e)),alert$1(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),MAX_MATCHES_COUNT_WIDTH=Math.max(MAX_MATCHES_COUNT_WIDTH,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===NLS_NO_RESULTS)return i===""?localize("ariaSearchNoResultEmpty","{0} found",e):localize("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=localize("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),r=this._codeEditor.getModel();return r&&t.startLineNumber<=r.getLineCount()&&t.startLineNumber>=1?`${r.getLineContent(t.startLineNumber)}, ${s}`:s}return localize("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(92);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=getDomNodePagePosition(i),r=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=s.left+(r?r.left:0),a=r?r.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=getTopLeftOffset(this._domNode).left;o>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new FindWidgetViewZone(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const r=this._getHeight();if(r===i.heightInPx)return;const o=r-i.heightInPx;i.heightInPx=r,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o);return}else{let r=this._getHeight();if(r-=this._codeEditor.getOption(84).top,r<=0)return;i.heightInPx=r,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let r=!1,o=!1,a=!1;if(this._resized&&getTotalWidth(this._domNode)>FIND_WIDGET_INITIAL_WIDTH){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=getTotalWidth(this._findInput.domNode);return}if(FIND_WIDGET_INITIAL_WIDTH+28+s>=i&&(o=!0),FIND_WIDGET_INITIAL_WIDTH+28+s-MAX_MATCHES_COUNT_WIDTH>=i&&(a=!0),FIND_WIDGET_INITIAL_WIDTH+28+s-MAX_MATCHES_COUNT_WIDTH>=i+50&&(r=!0),this._domNode.classList.toggle("collapsed-find-widget",r),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",o),!a&&!r&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:r,narrowFindWidget:a,reducedFindWidget:o}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!Range$2.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(ctrlKeyMod|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return stopPropagationForMultiLineUpwards(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return stopPropagationForMultiLineDownwards(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(ctrlKeyMod|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{isWindows&&isNative&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(localize("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(ctrlEnterReplaceAllWarningPromptedKey,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return stopPropagationForMultiLineUpwards(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return stopPropagationForMultiLineDownwards(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new ContextScopedFindInput(null,this._contextViewProvider,{width:FIND_INPUT_AREA_WIDTH,label:NLS_FIND_INPUT_LABEL,placeholder:NLS_FIND_INPUT_PLACEHOLDER,appendCaseSensitiveLabel:this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(FIND_IDS.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(FIND_IDS.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>showHistoryKeybindingHint(this._keybindingService),inputBoxStyles:defaultInputBoxStyles,toggleStyles:defaultToggleStyles},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),isLinux&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(createInstantHoverDelegate());this._prevBtn=this._register(new SimpleButton({label:NLS_PREVIOUS_MATCH_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction),icon:findPreviousMatchIcon,hoverDelegate:i,onTrigger:()=>{assertIsDefined(this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction)).run().then(void 0,onUnexpectedError)}},this._hoverService)),this._nextBtn=this._register(new SimpleButton({label:NLS_NEXT_MATCH_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.NextMatchFindAction),icon:findNextMatchIcon,hoverDelegate:i,onTrigger:()=>{assertIsDefined(this._codeEditor.getAction(FIND_IDS.NextMatchFindAction)).run().then(void 0,onUnexpectedError)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",s.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Toggle({icon:findSelectionIcon,title:NLS_TOGGLE_SELECTION_FIND_TITLE+this._keybindingLabelFor(FIND_IDS.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:asCssVariable(inputActiveOptionBackground),inputActiveOptionBorder:asCssVariable(inputActiveOptionBorder),inputActiveOptionForeground:asCssVariable(inputActiveOptionForeground)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new SimpleButton({label:NLS_CLOSE_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand),icon:widgetClose,hoverDelegate:i,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:d=>{d.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),d.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new ContextScopedReplaceInput(null,void 0,{label:NLS_REPLACE_INPUT_LABEL,placeholder:NLS_REPLACE_INPUT_PLACEHOLDER,appendPreserveCaseLabel:this._keybindingLabelFor(FIND_IDS.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>showHistoryKeybindingHint(this._keybindingService),inputBoxStyles:defaultInputBoxStyles,toggleStyles:defaultToggleStyles},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(d=>this._onReplaceInputKeyDown(d))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(d=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(d=>{d.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),d.preventDefault())}));const o=this._register(createInstantHoverDelegate());this._replaceBtn=this._register(new SimpleButton({label:NLS_REPLACE_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.ReplaceOneAction),icon:findReplaceIcon,hoverDelegate:o,onTrigger:()=>{this._controller.replace()},onKeyDown:d=>{d.equals(1026)&&(this._closeBtn.focus(),d.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new SimpleButton({label:NLS_REPLACE_ALL_BTN_LABEL+this._keybindingLabelFor(FIND_IDS.ReplaceAllAction),icon:findReplaceAllIcon,hoverDelegate:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new SimpleButton({label:NLS_TOGGLE_REPLACE_MODE_BTN_LABEL,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=NLS_FIND_DIALOG_LABEL,this._domNode.role="dialog",this._domNode.style.width=`${FIND_WIDGET_INITIAL_WIDTH}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new Sash(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let c=FIND_WIDGET_INITIAL_WIDTH;this._register(this._resizeSash.onDidStart(()=>{c=getTotalWidth(this._domNode)})),this._register(this._resizeSash.onDidChange(d=>{this._resized=!0;const u=c+d.startX-d.currentX;if(uf||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=getTotalWidth(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const d=getTotalWidth(this._domNode);if(d{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{var r,o;if(s.equals(10)||s.equals(3)){this._opts.onTrigger(),s.preventDefault();return}(o=(r=this._opts).onKeyDown)==null||o.call(r,s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findCollapsedIcon)),this._domNode.classList.add(...ThemeIcon.asClassNameArray(findExpandedIcon))):(this._domNode.classList.remove(...ThemeIcon.asClassNameArray(findExpandedIcon)),this._domNode.classList.add(...ThemeIcon.asClassNameArray(findCollapsedIcon)))}}registerThemingParticipant((n,e)=>{const t=n.getColor(editorFindMatchHighlightBorder);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${isHighContrast(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(editorFindRangeHighlightBorder);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${isHighContrast(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(contrastBorder);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const r=n.getColor(editorFindMatchForeground);r&&e.addRule(`.monaco-editor .findMatchInline { color: ${r}; }`);const o=n.getColor(editorFindMatchHighlightForeground);o&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`)});var __decorate$14=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$14=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},CommonFindController_1;const SEARCH_STRING_MAX_LENGTH=524288;function getSelectionSearchString(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!CONTEXT_FIND_INPUT_FOCUSED.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=escapeRegExpCharacters(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=getSelectionSearchString(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=escapeRegExpCharacters(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=getSelectionSearchString(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(r=>!r.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new FindModelBoundToEditorModel(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?(e=this._editor.getModel())!=null&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(localize("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},CommonFindController_1=Kl,Kl.ID="editor.contrib.findController",Kl);CommonFindController=CommonFindController_1=__decorate$14([__param$14(1,IContextKeyService),__param$14(2,IStorageService),__param$14(3,IClipboardService),__param$14(4,INotificationService),__param$14(5,IHoverService)],CommonFindController);let FindController=class extends CommonFindController{constructor(e,t,i,s,r,o,a,l,c){super(e,i,a,l,o,c),this._contextViewService=t,this._keybindingService=s,this._themeService=r,this._widget=null,this._findOptionsWidget=null}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new FindWidget(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService,this._hoverService)),this._findOptionsWidget=this._register(new FindOptionsWidget(this._editor,this._state,this._keybindingService))}};FindController=__decorate$14([__param$14(1,IContextViewService),__param$14(2,IContextKeyService),__param$14(3,IKeybindingService),__param$14(4,IThemeService),__param$14(5,INotificationService),__param$14(6,IStorageService),__param$14(7,IClipboardService),__param$14(8,IHoverService)],FindController);const StartFindAction=registerMultiEditorAction(new MultiEditorAction({id:FIND_IDS.StartFindAction,label:localize("startFindAction","Find"),alias:"Find",precondition:ContextKeyExpr.or(EditorContextKeys.focus,ContextKeyExpr.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"3_find",title:localize({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));StartFindAction.addImplementation(0,(n,e,t)=>{const i=CommonFindController.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const findArgDescription={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class StartFindWithArgsAction extends EditorAction{constructor(){super({id:FIND_IDS.StartFindWithArgs,label:localize("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:findArgDescription})}async run(e,t,i){const s=CommonFindController.get(t);if(s){const r=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},r),s.setGlobalBufferTerm(s.getState().searchString)}}}class StartFindWithSelectionAction extends EditorAction{constructor(){super({id:FIND_IDS.StartFindWithSelection,label:localize("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=CommonFindController.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}class MatchFindAction extends EditorAction{async run(e,t){const i=CommonFindController.get(t);i&&!this._run(i)&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class NextMatchFindAction extends MatchFindAction{constructor(){super({id:FIND_IDS.NextMatchFindAction,label:localize("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:EditorContextKeys.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_FIND_INPUT_FOCUSED),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class PreviousMatchFindAction extends MatchFindAction{constructor(){super({id:FIND_IDS.PreviousMatchFindAction,label:localize("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:EditorContextKeys.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_FIND_INPUT_FOCUSED),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class MoveToMatchFindAction extends EditorAction{constructor(){super({id:FIND_IDS.GoToMatchFindAction,label:localize("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:CONTEXT_FIND_WIDGET_VISIBLE}),this._highlightDecorations=[]}run(e,t,i){const s=CommonFindController.get(t);if(!s)return;const r=s.getState().matchesCount;if(r<1){e.get(INotificationService).notify({severity:Severity.Warning,message:localize("findMatchAction.noResults","No matches. Try searching for something else.")});return}const o=e.get(IQuickInputService),a=new DisposableStore,l=a.add(o.createInputBox());l.placeholder=localize("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",r);const c=u=>{const f=parseInt(u);if(isNaN(f))return;const g=s.getState().matchesCount;if(f>0&&f<=g)return f-1;if(f<0&&f>=-g)return g+f},d=u=>{const f=c(u);if(typeof f=="number"){l.validationMessage=void 0,s.goToMatch(f);const g=s.getState().currentMatch;g&&this.addDecorations(t,g)}else l.validationMessage=localize("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(u=>{d(u)})),a.add(l.onDidAccept(()=>{const u=c(l.value);typeof u=="number"?(s.goToMatch(u),l.hide()):l.validationMessage=localize("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:themeColorFromId(overviewRulerRangeHighlight),position:OverviewRulerLane.Full}}}])})}}class SelectionMatchFindAction extends EditorAction{async run(e,t){const i=CommonFindController.get(t);if(!i)return;const s=getSelectionSearchString(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))}}class NextSelectionMatchFindAction extends SelectionMatchFindAction{constructor(){super({id:FIND_IDS.NextSelectionMatchFindAction,label:localize("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class PreviousSelectionMatchFindAction extends SelectionMatchFindAction{constructor(){super({id:FIND_IDS.PreviousSelectionMatchFindAction,label:localize("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const StartFindReplaceAction=registerMultiEditorAction(new MultiEditorAction({id:FIND_IDS.StartFindReplaceAction,label:localize("startReplace","Replace"),alias:"Replace",precondition:ContextKeyExpr.or(EditorContextKeys.focus,ContextKeyExpr.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:MenuId.MenubarEditMenu,group:"3_find",title:localize({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));StartFindReplaceAction.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(92))return!1;const i=CommonFindController.get(e);if(!i)return!1;const s=e.getSelection(),r=i.isFindInputFocused(),o=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!r,a=r||o?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:o?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});registerEditorContribution(CommonFindController.ID,FindController,0);registerEditorAction(StartFindWithArgsAction);registerEditorAction(StartFindWithSelectionAction);registerEditorAction(NextMatchFindAction);registerEditorAction(PreviousMatchFindAction);registerEditorAction(MoveToMatchFindAction);registerEditorAction(NextSelectionMatchFindAction);registerEditorAction(PreviousSelectionMatchFindAction);const FindCommand=EditorCommand.bindToContribution(CommonFindController.get);registerEditorCommand(new FindCommand({id:FIND_IDS.CloseFindWidgetCommand,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,ContextKeyExpr.not("isComposing")),primary:9,secondary:[1033]}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:ToggleCaseSensitiveKeybinding.primary,mac:ToggleCaseSensitiveKeybinding.mac,win:ToggleCaseSensitiveKeybinding.win,linux:ToggleCaseSensitiveKeybinding.linux}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:ToggleWholeWordKeybinding.primary,mac:ToggleWholeWordKeybinding.mac,win:ToggleWholeWordKeybinding.win,linux:ToggleWholeWordKeybinding.linux}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:ToggleRegexKeybinding.primary,mac:ToggleRegexKeybinding.mac,win:ToggleRegexKeybinding.win,linux:ToggleRegexKeybinding.linux}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:ToggleSearchScopeKeybinding.primary,mac:ToggleSearchScopeKeybinding.mac,win:ToggleSearchScopeKeybinding.win,linux:ToggleSearchScopeKeybinding.linux}}));registerEditorCommand(new FindCommand({id:FIND_IDS.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:TogglePreserveCaseKeybinding.primary,mac:TogglePreserveCaseKeybinding.mac,win:TogglePreserveCaseKeybinding.win,linux:TogglePreserveCaseKeybinding.linux}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceOneAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:3094}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceOneAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_REPLACE_INPUT_FOCUSED),primary:3}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceAllAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:2563}}));registerEditorCommand(new FindCommand({id:FIND_IDS.ReplaceAllAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,CONTEXT_REPLACE_INPUT_FOCUSED),primary:void 0,mac:{primary:2051}}}));registerEditorCommand(new FindCommand({id:FIND_IDS.SelectAllMatchesAction,precondition:CONTEXT_FIND_WIDGET_VISIBLE,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:EditorContextKeys.focus,primary:515}}));const folding="",foldSourceAbbr={0:" ",1:"u",2:"r"},MAX_FOLDING_REGIONS=65535,MAX_LINE_NUMBER=16777215,MASK_INDENT=4278190080;class BitField{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<MAX_FOLDING_REGIONS)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new BitField(e.length),this._userDefinedStates=new BitField(e.length),this._recoveredStates=new BitField(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const r=e[e.length-1];return this.getStartLineNumber(r)<=i&&this.getEndLineNumber(r)>=s};for(let i=0,s=this._startIndexes.length;iMAX_LINE_NUMBER||o>MAX_LINE_NUMBER)throw new Error("startLineNumber or endLineNumber must not exceed "+MAX_LINE_NUMBER);for(;e.length>0&&!t(r,o);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=r+((a&255)<<24),this._endIndexes[i]=o+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&MAX_LINE_NUMBER}getEndLineNumber(e){return this._endIndexes[e]&MAX_LINE_NUMBER}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&MASK_INDENT)>>>16);return t===MAX_FOLDING_REGIONS?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(v)?S=>SS=u.startLineNumber))d&&d.startLineNumber===u.startLineNumber?(u.source===1?v=u:(v=d,v.isCollapsed=u.isCollapsed&&(d.endLineNumber===u.endLineNumber||!(s!=null&&s.startsInside(d.startLineNumber+1,d.endLineNumber+1))),v.source=0),d=o(++l)):(v=u,u.isCollapsed&&u.source===0&&(v.source=2)),u=a(++c);else{let C=c,S=u;for(;;){if(!S||S.startLineNumber>d.endLineNumber){v=d;break}if(S.source===1&&S.endLineNumber>d.endLineNumber)break;S=a(++C)}d=o(++l)}if(v){for(;g&&g.endLineNumberv.startLineNumber&&v.startLineNumber>m&&v.endLineNumber<=i&&(!g||g.endLineNumber>=v.endLineNumber)&&(_.push(v),m=v.startLineNumber,g&&f.push(g),g=v)}}return _}}class FoldingRegion{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class FoldingModel{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new Emitter$1,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new FoldingRegions(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,r=-1,o=-1;const a=l=>{for(;so&&(o=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const u=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,u),r=Math.max(r,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const r of e)if(!(r.startLineNumber>s.endLineNumber||s.startLineNumber>r.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,s=this._regions.length;i=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const a=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const o=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);(!r.checksum||o===r.checksum)&&t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:r.isCollapsed??!0,source:r.source??0})}const s=FoldingRegions.sanitizeAndMerge(this._regions,t,i);this.updatePost(FoldingRegions.fromFoldRanges(s))}_getLinesChecksum(e,t){return hash(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),r=1;for(;s>=0;){const o=this._regions.toRegion(s);(!t||t(o,r))&&i.push(o),r++,s=o.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,r=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const o=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(o[o.length-1]);)o.pop();o.push(c),t(c,o.length)&&i.push(c)}else break}}else for(let o=s,a=this._regions.length;o1){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==o&&c0)for(const r of i){const o=n.getRegionAtLine(r);if(o&&(o.isCollapsed!==e&&s.push(o),t>1)){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==e&&co.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...o)}n.toggleCollapseState(s)}function setCollapseStateUp(n,e,t){const i=[];for(const s of t){const r=n.getAllRegionsAtLine(s,o=>o.isCollapsed!==e);r.length>0&&i.push(r[0])}n.toggleCollapseState(i)}function setCollapseStateAtLevel(n,e,t,i){const s=(o,a)=>a===e&&o.isCollapsed!==t&&!i.some(l=>o.containsLine(l)),r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function setCollapseStateForRest(n,e,t){const i=[];for(const o of t){const a=n.getAllRegionsAtLine(o,void 0);a.length>0&&i.push(a[0])}const s=o=>i.every(a=>!a.containedBy(o)&&!o.containedBy(a))&&o.isCollapsed!==e,r=n.getRegionsInside(null,s);n.toggleCollapseState(r)}function setCollapseStateForMatchingLines(n,e,t){const i=n.textModel,s=n.regions,r=[];for(let o=s.length-1;o>=0;o--)if(t!==s.isCollapsed(o)){const a=s.getStartLineNumber(o);e.test(i.getLineContent(a))&&r.push(s.toRegion(o))}n.toggleCollapseState(r)}function setCollapseStateForType(n,e,t){const i=n.regions,s=[];for(let r=i.length-1;r>=0;r--)t!==i.isCollapsed(r)&&e===i.getType(r)&&s.push(i.toRegion(r));n.toggleCollapseState(s)}function getParentFoldLine(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function getPreviousFoldLine(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function getNextFoldLine(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||countEOL(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,r=Number.MAX_VALUE,o=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return findRange(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const r=o=>((!s||!isInside(o,s))&&(s=findRange(this._hiddenRanges,o)),s?s.startLineNumber-1:null);for(let o=0,a=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function isInside(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function findRange(n,e){const t=findFirstIdxMonotonousOrArrLen(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const MAX_FOLDING_REGIONS_FOR_INDENT_DEFAULT=5e3,ID_INDENT_PROVIDER="indent";class IndentRangeProvider{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=ID_INDENT_PROVIDER}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(computeRanges(this.editorModel,i,s,this.foldingRangesLimit))}}let RangesCollector$1=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>MAX_LINE_NUMBER||t>MAX_LINE_NUMBER)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let r=this._length-1,o=0;r>=0;r--,o++)i[o]=this._startIndexes[r],s[o]=this._endIndexes[r];return new FoldingRegions(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const r=e.getOptions().tabSize,o=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),f=computeIndentLevel(u,r);(f{}};function computeRanges(n,e,t,i=foldingRangesLimitDefault){const s=n.getOptions().tabSize,r=new RangesCollector$1(i);let o;t&&(o=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=computeIndentLevel(d,s);let f=a[a.length-1];if(u===-1){e&&(f.endAbove=c);continue}let g;if(o&&(g=d.match(o)))if(g[1]){let m=a.length-1;for(;m>0&&a[m].indent!==-2;)m--;if(m>0){a.length=m+1,f=a[m],r.insertFirst(c,f.line,u),f.line=c,f.indent=u,f.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(f.indent>u){do a.pop(),f=a[a.length-1];while(f.indent>u);const m=f.endAbove-1;m-c>=1&&r.insertFirst(c,m,u)}f.indent===u?f.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return r.toIndentRanges(n)}const foldBackground=registerColor("editor.foldBackground",{light:transparent(editorSelectionBackground,.3),dark:transparent(editorSelectionBackground,.3),hcDark:null,hcLight:null},localize("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},localize("collapsedTextColor","Color of the collapsed text after the first line of a folded range."));registerColor("editorGutter.foldingControlForeground",iconForeground,localize("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const foldingExpandedIcon=registerIcon("folding-expanded",Codicon.chevronDown,localize("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),foldingCollapsedIcon=registerIcon("folding-collapsed",Codicon.chevronRight,localize("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),foldingManualCollapsedIcon=registerIcon("folding-manual-collapsed",foldingCollapsedIcon,localize("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),foldingManualExpandedIcon=registerIcon("folding-manual-expanded",foldingExpandedIcon,localize("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),foldedBackgroundMinimap={color:themeColorFromId(foldBackground),position:1},collapsed=localize("linesCollapsed","Click to expand the range."),expanded=localize("linesExpanded","Click to collapse the range."),Ti=class Ti{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ti.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ti.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ti.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ti.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ti.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ti.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ti.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ti.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ti.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ti.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ti.MANUALLY_EXPANDED_VISUAL_DECORATION:Ti.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Ti.COLLAPSED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:collapsed,firstLineDecorationClassName:ThemeIcon.asClassName(foldingCollapsedIcon)}),Ti.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:foldedBackgroundMinimap,isWholeLine:!0,linesDecorationsTooltip:collapsed,firstLineDecorationClassName:ThemeIcon.asClassName(foldingCollapsedIcon)}),Ti.MANUALLY_COLLAPSED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:collapsed,firstLineDecorationClassName:ThemeIcon.asClassName(foldingManualCollapsedIcon)}),Ti.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:foldedBackgroundMinimap,isWholeLine:!0,linesDecorationsTooltip:collapsed,firstLineDecorationClassName:ThemeIcon.asClassName(foldingManualCollapsedIcon)}),Ti.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=ModelDecorationOptions.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:collapsed}),Ti.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=ModelDecorationOptions.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:foldedBackgroundMinimap,isWholeLine:!0,linesDecorationsTooltip:collapsed}),Ti.EXPANDED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ThemeIcon.asClassName(foldingExpandedIcon),linesDecorationsTooltip:expanded}),Ti.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ThemeIcon.asClassName(foldingExpandedIcon),linesDecorationsTooltip:expanded}),Ti.MANUALLY_EXPANDED_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ThemeIcon.asClassName(foldingManualExpandedIcon),linesDecorationsTooltip:expanded}),Ti.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=ModelDecorationOptions.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:ThemeIcon.asClassName(foldingManualExpandedIcon),linesDecorationsTooltip:expanded}),Ti.NO_CONTROLS_EXPANDED_RANGE_DECORATION=ModelDecorationOptions.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),Ti.HIDDEN_RANGE_DECORATION=ModelDecorationOptions.register({description:"folding-hidden-range-decoration",stickiness:1});let FoldingDecorationProvider=Ti;const foldingContext={},ID_SYNTAX_PROVIDER="syntax";class SyntaxRangeProvider{constructor(e,t,i,s,r){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=r,this.id=ID_SYNTAX_PROVIDER,this.disposables=new DisposableStore,r&&this.disposables.add(r);for(const o of t)typeof o.onDidChange=="function"&&this.disposables.add(o.onDidChange(i))}compute(e){return collectSyntaxRanges(this.providers,this.editorModel,e).then(t=>{var i;return t?sanitizeRanges(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function collectSyntaxRanges(n,e,t){let i=null;const s=n.map((r,o)=>Promise.resolve(r.provideFoldingRanges(e,foldingContext,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:o,kind:c.kind})}},onUnexpectedExternalError));return Promise.all(s).then(r=>i)}class RangesCollector{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>MAX_LINE_NUMBER||t>MAX_LINE_NUMBER)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._nestingLevels[r]=s,this._types[r]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),r=new Uint32Array(e),o=[];for(let a=0,l=0;a{let l=o.start-a.start;return l===0&&(l=o.rank-a.rank),l}),i=new RangesCollector(e);let s;const r=[];for(const o of t)if(!s)s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else if(o.start>s.start)if(o.end<=s.end)r.push(s),s=o,i.add(o.start,o.end,o.kind&&o.kind.value,r.length);else{if(o.start>s.end){do s=r.pop();while(s&&o.start>s.end);s&&r.push(s),s=o}i.add(o.start,o.end,o.kind&&o.kind.value,r.length)}return i.toIndentRanges()}var __decorate$13=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$13=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},FoldingController_1;const CONTEXT_FOLDING_ENABLED=new RawContextKey("foldingEnabled",!1);var jl;let FoldingController=(jl=class extends Disposable{static get(e){return e.getContribution(FoldingController_1.ID)}static getFoldingRangeProviders(e,t){var s;const i=e.foldingRangeProvider.ordered(t);return((s=FoldingController_1._foldingRangeSelector)==null?void 0:s.call(FoldingController_1,i,t))??i}constructor(e,t,i,s,r,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new DisposableStore),this.editor=e,this._foldingLimitReporter=new RangesLimitReporter(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=r.for(o.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new FoldingDecorationProvider(e),this.foldingDecorationProvider.showFoldingControls=a.get(111),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(111)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(111),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new FoldingModel(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new HiddenRangeModel(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Delayer(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new RunOnceScheduler(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)==null||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new IndentRangeProvider(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=FoldingController_1.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new SyntaxRangeProvider(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new StopWatch,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=createCancelablePromise(r=>i.compute(r));return s.then(r=>{if(r&&s===this.foldingRegionPromise){let o;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=r.setCollapsedAllOfType(FoldingRangeKind.Imports.value,!0);c&&(o=StableEditorScrollState.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(r,toSelectedLines(a)),o==null||o.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(onUnexpectedError(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const r of i){const o=r.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(o)&&s.push(...t.getAllRegionsAtLine(o,a=>a.isCollapsed&&o>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,onUnexpectedError)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,r=e.target.element.offsetLeft;if(s.offsetX-r<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,r=e.target.range;if(!r||r.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||r.startColumn!==a.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const a=o.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=f=>!f.containedBy(o)&&!o.containedBy(f),u=t.getRegionsInside(null,d);for(const f of u)f.isCollapsed&&c.push(f);c.length===0&&(c=u)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const u of t.getRegionsInside(o))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(o)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},FoldingController_1=jl,jl.ID="editor.contrib.folding",jl);FoldingController=FoldingController_1=__decorate$13([__param$13(1,IContextKeyService),__param$13(2,ILanguageConfigurationService),__param$13(3,INotificationService),__param$13(4,ILanguageFeatureDebounceService),__param$13(5,ILanguageFeaturesService)],FoldingController);class RangesLimitReporter{constructor(e){this.editor=e,this._onDidChange=new Emitter$1,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class FoldingAction extends EditorAction{runEditorCommand(e,t,i){const s=e.get(ILanguageConfigurationService),r=FoldingController.get(t);if(!r)return;const o=r.getFoldingModel();if(o)return this.reportTelemetry(e,t),o.then(a=>{if(a){this.invoke(r,a,t,i,s);const l=t.getSelection();l&&r.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function toSelectedLines(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const s=i.startLineNumber;if(s>=e&&s<=t)return!0}return!1}}}function foldingArgumentsConstraint(n){if(!isUndefined$1(n)){if(!isObject(n))return!1;const e=n;if(!isUndefined$1(e.levels)&&!isNumber$3(e.levels)||!isUndefined$1(e.direction)&&!isString$3(e.direction)||!isUndefined$1(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(isNumber$3)))return!1}return!0}class UnfoldAction extends FoldingAction{constructor(){super({id:"editor.unfold",label:localize("unfoldAction.label","Unfold"),alias:"Unfold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to unfold. If not set, defaults to 1. + * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. + * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. + `,constraint:foldingArgumentsConstraint,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const r=s&&s.levels||1,o=this.getLineNumbers(s,i);s&&s.direction==="up"?setCollapseStateLevelsUp(t,!1,r,o):setCollapseStateLevelsDown(t,!1,r,o)}}class UnFoldRecursivelyAction extends FoldingAction{constructor(){super({id:"editor.unfoldRecursively",label:localize("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2142),weight:100}})}invoke(e,t,i,s){setCollapseStateLevelsDown(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class FoldAction extends FoldingAction{constructor(){super({id:"editor.fold",label:localize("foldAction.label","Fold"),alias:"Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + * 'levels': Number of levels to fold. + * 'direction': If 'up', folds given number of levels up otherwise folds down. + * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. + If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. + `,constraint:foldingArgumentsConstraint,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const r=this.getLineNumbers(s,i),o=s&&s.levels,a=s&&s.direction;typeof o!="number"&&typeof a!="string"?setCollapseStateUp(t,!0,r):a==="up"?setCollapseStateLevelsUp(t,!0,o||1,r):setCollapseStateLevelsDown(t,!0,o||1,r)}}class ToggleFoldAction extends FoldingAction{constructor(){super({id:"editor.toggleFold",label:localize("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);toggleCollapseState(t,1,s)}}class FoldRecursivelyAction extends FoldingAction{constructor(){super({id:"editor.foldRecursively",label:localize("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);setCollapseStateLevelsDown(t,!0,Number.MAX_VALUE,s)}}class ToggleFoldRecursivelyAction extends FoldingAction{constructor(){super({id:"editor.toggleFoldRecursively",label:localize("toggleFoldRecursivelyAction.label","Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,3114),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);toggleCollapseState(t,Number.MAX_VALUE,s)}}class FoldAllBlockCommentsAction extends FoldingAction{constructor(){super({id:"editor.foldAllBlockComments",label:localize("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2138),weight:100}})}invoke(e,t,i,s,r){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Comment.value,!0);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+escapeRegExpCharacters(a.blockCommentStartToken));setCollapseStateForMatchingLines(t,l,!0)}}}}class FoldAllRegionsAction extends FoldingAction{constructor(){super({id:"editor.foldAllMarkerRegions",label:localize("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2077),weight:100}})}invoke(e,t,i,s,r){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Region.value,!0);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);setCollapseStateForMatchingLines(t,l,!0)}}}}class UnfoldAllRegionsAction extends FoldingAction{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:localize("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2078),weight:100}})}invoke(e,t,i,s,r){if(t.regions.hasTypes())setCollapseStateForType(t,FoldingRangeKind.Region.value,!1);else{const o=i.getModel();if(!o)return;const a=r.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);setCollapseStateForMatchingLines(t,l,!1)}}}}class FoldAllExceptAction extends FoldingAction{constructor(){super({id:"editor.foldAllExcept",label:localize("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);setCollapseStateForRest(t,!0,s)}}class UnfoldAllExceptAction extends FoldingAction{constructor(){super({id:"editor.unfoldAllExcept",label:localize("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);setCollapseStateForRest(t,!1,s)}}class FoldAllAction extends FoldingAction{constructor(){super({id:"editor.foldAll",label:localize("foldAllAction.label","Fold All"),alias:"Fold All",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2069),weight:100}})}invoke(e,t,i){setCollapseStateLevelsDown(t,!0)}}class UnfoldAllAction extends FoldingAction{constructor(){super({id:"editor.unfoldAll",label:localize("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2088),weight:100}})}invoke(e,t,i){setCollapseStateLevelsDown(t,!1)}}const pl=class pl extends FoldingAction{getFoldingLevel(){return parseInt(this.id.substr(pl.ID_PREFIX.length))}invoke(e,t,i){setCollapseStateAtLevel(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};pl.ID_PREFIX="editor.foldLevel",pl.ID=e=>pl.ID_PREFIX+e;let FoldLevelAction=pl;class GotoParentFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoParentFold",label:localize("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const r=getParentFoldLine(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class GotoPreviousFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoPreviousFold",label:localize("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const r=getPreviousFoldLine(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class GotoNextFoldAction extends FoldingAction{constructor(){super({id:"editor.gotoNextFold",label:localize("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const r=getNextFoldLine(s[0],t);r!==null&&i.setSelection({startLineNumber:r,startColumn:1,endLineNumber:r,endColumn:1})}}}class FoldRangeFromSelectionAction extends FoldingAction{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:localize("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2135),weight:100}})}invoke(e,t,i){var o;const s=[],r=i.getSelections();if(r){for(const a of r){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(s.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=FoldingRegions.sanitizeAndMerge(t.regions,s,(o=i.getModel())==null?void 0:o.getLineCount());t.updatePost(FoldingRegions.fromFoldRanges(a))}}}}class RemoveFoldRangeFromSelectionAction extends FoldingAction{constructor(){super({id:"editor.removeManualFoldingRanges",label:localize("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const r=[];for(const o of s){const{startLineNumber:a,endLineNumber:l}=o;r.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(r),e.triggerFoldingModelChanged()}}}registerEditorContribution(FoldingController.ID,FoldingController,0);registerEditorAction(UnfoldAction);registerEditorAction(UnFoldRecursivelyAction);registerEditorAction(FoldAction);registerEditorAction(FoldRecursivelyAction);registerEditorAction(ToggleFoldRecursivelyAction);registerEditorAction(FoldAllAction);registerEditorAction(UnfoldAllAction);registerEditorAction(FoldAllBlockCommentsAction);registerEditorAction(FoldAllRegionsAction);registerEditorAction(UnfoldAllRegionsAction);registerEditorAction(FoldAllExceptAction);registerEditorAction(UnfoldAllExceptAction);registerEditorAction(ToggleFoldAction);registerEditorAction(GotoParentFoldAction);registerEditorAction(GotoPreviousFoldAction);registerEditorAction(GotoNextFoldAction);registerEditorAction(FoldRangeFromSelectionAction);registerEditorAction(RemoveFoldRangeFromSelectionAction);for(let n=1;n<=7;n++)registerInstantiatedEditorAction(new FoldLevelAction({id:FoldLevelAction.ID(n),label:localize("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:CONTEXT_FOLDING_ENABLED,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2048|21+n),weight:100}}));CommandsRegistry.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof URI))throw illegalArgument();const i=n.get(ILanguageFeaturesService),s=n.get(IModelService).getModel(t);if(!s)throw illegalArgument();const r=n.get(IConfigurationService);if(!r.getValue("editor.folding",{resource:t}))return[];const o=n.get(ILanguageConfigurationService),a=r.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return r.getValue("editor.foldingMaximumRegions",{resource:t})},update:(g,m)=>{}},c=new IndentRangeProvider(s,o,l);let d=c;if(a!=="indentation"){const g=FoldingController.getFoldingRangeProviders(i,s);g.length&&(d=new SyntaxRangeProvider(s,g,()=>{},l,c))}const u=await d.compute(CancellationToken.None),f=[];try{if(u)for(let g=0;g=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$12=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},fu;let FormatOnType=(fu=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new DisposableStore,this._sessionDisposables=new DisposableStore,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(r=>{r.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new CharacterSet;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const r=s.charCodeAt(s.length-1);i.has(r)&&this._trigger(String.fromCharCode(r))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new CancellationTokenSource$1,r=this._editor.onDidChangeModelContent(o=>{if(o.isFlush){s.cancel(),r.dispose();return}for(let a=0,l=o.changes.length;a{s.token.isCancellationRequested||isNonEmptyArray(o)&&(this._accessibilitySignalService.playSignal(AccessibilitySignal.format,{userGesture:!1}),FormattingEdit.execute(this._editor,o,!0))}).finally(()=>{r.dispose()})}},fu.ID="editor.contrib.autoFormat",fu);FormatOnType=__decorate$12([__param$12(1,ILanguageFeaturesService),__param$12(2,IEditorWorkerService),__param$12(3,IAccessibilitySignalService)],FormatOnType);var gu;let FormatOnPaste=(gu=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new DisposableStore,this._callOnModel=new DisposableStore,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(55)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(formatDocumentRangesWithSelectedProvider,this.editor,e,2,Progress.None,CancellationToken.None,!1).catch(onUnexpectedError))}},gu.ID="editor.contrib.formatOnPaste",gu);FormatOnPaste=__decorate$12([__param$12(1,ILanguageFeaturesService),__param$12(2,IInstantiationService)],FormatOnPaste);class FormatDocumentAction extends EditorAction{constructor(){super({id:"editor.action.formatDocument",label:localize("formatDocument.label","Format Document"),alias:"Format Document",precondition:ContextKeyExpr.and(EditorContextKeys.notInCompositeEditor,EditorContextKeys.writable,EditorContextKeys.hasDocumentFormattingProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(IInstantiationService);await e.get(IEditorProgressService).showWhile(i.invokeFunction(formatDocumentWithSelectedProvider,t,1,Progress.None,CancellationToken.None,!0),250)}}}class FormatSelectionAction extends EditorAction{constructor(){super({id:"editor.action.formatSelection",label:localize("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2084),weight:100},contextMenuOpts:{when:EditorContextKeys.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(IInstantiationService),s=t.getModel(),r=t.getSelections().map(a=>a.isEmpty()?new Range$2(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(IEditorProgressService).showWhile(i.invokeFunction(formatDocumentRangesWithSelectedProvider,t,r,1,Progress.None,CancellationToken.None,!0),250)}}registerEditorContribution(FormatOnType.ID,FormatOnType,2);registerEditorContribution(FormatOnPaste.ID,FormatOnPaste,2);registerEditorAction(FormatDocumentAction);registerEditorAction(FormatSelectionAction);CommandsRegistry.registerCommand("editor.action.format",async n=>{const e=n.get(ICodeEditorService).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(ICommandService);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var __decorate$11=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$11=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class TreeElement{remove(){var e;(e=this.parent)==null||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let r=0;t.children.get(s)!==void 0;r++)s=`${i}_${r}`;return s}static empty(e){return e.children.size===0}}class OutlineElement extends TreeElement{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class OutlineGroup extends TreeElement{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class OutlineModel extends TreeElement{static create(e,t,i){const s=new CancellationTokenSource$1(i),r=new OutlineModel(t.uri),o=e.ordered(t),a=o.map((c,d)=>{const u=TreeElement.findId(`provider_${d}`,r),f=new OutlineGroup(u,r,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(g=>{for(const m of g||[])OutlineModel._makeOutlineElement(m,f);return f},g=>(onUnexpectedExternalError(g),f)).then(g=>{TreeElement.empty(g)?g.remove():r._groups.set(u,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);equals$1(c,o)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?OutlineModel.create(e,t,i):r._compact()).finally(()=>{s.dispose(),l.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=TreeElement.findId(e,t),s=new OutlineElement(i,t,e);if(e.children)for(const r of e.children)OutlineModel._makeOutlineElement(r,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Iterable.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof OutlineElement?e.push(t.symbol):e.push(...Iterable.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>Range$2.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return OutlineModel._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>Position$1.compare(Range$2.getStartPosition(i.range),Range$2.getStartPosition(s.range))||Position$1.compare(Range$2.getEndPosition(s.range),Range$2.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&OutlineModel._flattenDocumentSymbols(e,s.children,s.name)}}const IOutlineModelService=createDecorator("IOutlineModelService");let OutlineModelService=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new DisposableStore,this._cache=new LRUCache(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let r=this._cache.get(e.id);if(!r||r.versionId!==e.getVersionId()||!equals$1(r.provider,s)){const a=new CancellationTokenSource$1;r={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:OutlineModel.create(i,e,a.token),model:void 0},this._cache.set(e.id,r);const l=Date.now();r.promise.then(c=>{r.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(r.model)return r.model;r.promiseCnt+=1;const o=t.onCancellationRequested(()=>{--r.promiseCnt===0&&(r.source.cancel(),this._cache.delete(e.id))});try{return await r.promise}finally{o.dispose()}}};OutlineModelService=__decorate$11([__param$11(0,ILanguageFeaturesService),__param$11(1,ILanguageFeatureDebounceService),__param$11(2,IModelService)],OutlineModelService);registerSingleton(IOutlineModelService,OutlineModelService,1);CommandsRegistry.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;assertType(URI.isUri(t));const i=n.get(IOutlineModelService),r=await n.get(ITextModelService).createModelReference(t);try{return(await i.getOrCreate(r.object.textEditorModel,CancellationToken.None)).getTopLevelSymbols()}finally{r.dispose()}});const ls=class ls extends Disposable{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=ls.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=ls.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=ls.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=ls.suppressSuggestions.bindTo(this.contextKeyService),this._register(autorun(i=>{const s=this.model.read(i),r=s==null?void 0:s.state.read(i),o=!!(r!=null&&r.inlineCompletion)&&(r==null?void 0:r.primaryGhostText)!==void 0&&!(r!=null&&r.primaryGhostText.isEmpty());this.inlineCompletionVisible.set(o),r!=null&&r.primaryGhostText&&(r!=null&&r.inlineCompletion)&&this.suppressSuggestions.set(r.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(autorun(i=>{const s=this.model.read(i);let r=!1,o=!0;const a=s==null?void 0:s.primaryGhostText.read(i);if(s!=null&&s.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],d=c[0],u=s.textModel.getLineIndentColumn(a.lineNumber);if(l<=u){let g=firstNonWhitespaceIndex(d);g===-1&&(g=d.length-1),r=g>0;const m=s.textModel.getOptions().tabSize;o=CursorColumns.visibleColumnFromColumn(d,g+1,m){t.setStyle(n.read(i))})),e}const ghostTextView="";class GhostText{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new TextEdit([...this.parts.map(r=>new SingleTextEdit(Range$2.fromPositions(new Position$1(1,r.column)),r.lines.join(` +`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class GhostTextPart{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=splitLines(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class GhostTextReplacement{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=s,this.parts=[new GhostTextPart(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=splitLines(this.text)}renderForScreenReader(e){return this.newLines.join(` +`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function ghostTextsOrReplacementsEqual(n,e){return equals$1(n,e,ghostTextOrReplacementEquals)}function ghostTextOrReplacementEquals(n,e){return n===e?!0:!n||!e?!1:n instanceof GhostText&&e instanceof GhostText||n instanceof GhostTextReplacement&&e instanceof GhostTextReplacement?n.equals(e):!1}const array=[];function getReadonlyEmptyArray(){return array}class ColumnRange{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new BugIndicatingError(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new Range$2(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function applyObservableDecorations(n,e){const t=new DisposableStore,i=n.createDecorationsCollection();return t.add(autorunOpts({debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const r=e.read(s);i.set(r)})),t.add({dispose:()=>{i.clear()}}),t}function addPositions(n,e){return new Position$1(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function subtractPositions(n,e){return new Position$1(n.lineNumber-e.lineNumber+1,n.lineNumber-e.lineNumber===0?n.column-e.column+1:n.column)}var __decorate$10=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$10=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const GHOST_TEXT_DESCRIPTION="ghost-text";let GhostTextView=class extends Disposable{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=observableValue(this,!1),this.currentTextModel=observableFromEvent(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=derived(this,s=>{if(this.isDisposed.read(s))return;const r=this.currentTextModel.read(s);if(r!==this.model.targetTextModel.read(s))return;const o=this.model.ghostText.read(s);if(!o)return;const a=o instanceof GhostTextReplacement?o.columnRange:void 0,l=[],c=[];function d(_,v){if(c.length>0){const C=c[c.length-1];v&&C.decorations.push(new LineDecoration(C.content.length+1,C.content.length+1+_[0].length,v,0)),C.content+=_[0],_=_.slice(1)}for(const C of _)c.push({content:C,decorations:v?[new LineDecoration(1,C.length+1,v,0)]:[]})}const u=r.getLineContent(o.lineNumber);let f,g=0;for(const _ of o.parts){let v=_.lines;f===void 0?(l.push({column:_.column,text:v[0],preview:_.preview}),v=v.slice(1)):d([u.substring(g,_.column-1)],void 0),v.length>0&&(d(v,GHOST_TEXT_DESCRIPTION),f===void 0&&_.column<=u.length&&(f=_.column)),g=_.column-1}f!==void 0&&d([u.substring(g)],void 0);const m=f!==void 0?new ColumnRange(f,u.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:m,lineNumber:o.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:r}}),this.decorations=derived(this,s=>{const r=this.uiState.read(s);if(!r)return[];const o=[];r.replacedRange&&o.push({range:r.replacedRange.toRange(r.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of r.inlineTexts)o.push({range:Range$2.fromPositions(new Position$1(r.lineNumber,a.column)),options:{description:GHOST_TEXT_DESCRIPTION,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:InjectedTextCursorStops.Left},showIfCollapsed:!0}});return o}),this.additionalLinesWidget=this._register(new AdditionalLinesWidget(this.editor,this.languageService.languageIdCodec,derived(s=>{const r=this.uiState.read(s);return r?{lineNumber:r.lineNumber,additionalLines:r.additionalLines,minReservedLineCount:r.additionalReservedLineCount,targetTextModel:r.targetTextModel}:void 0}))),this._register(toDisposable(()=>{this.isDisposed.set(!0,void 0)})),this._register(applyObservableDecorations(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};GhostTextView=__decorate$10([__param$10(2,ILanguageService)],GhostTextView);class AdditionalLinesWidget extends Disposable{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=observableSignalFromEvent("editorOptionChanged",Event$1.filter(this.editor.onDidChangeConfiguration,s=>s.hasChanged(33)||s.hasChanged(118)||s.hasChanged(100)||s.hasChanged(95)||s.hasChanged(51)||s.hasChanged(50)||s.hasChanged(67))),this._register(autorun(s=>{const r=this.lines.read(s);this.editorOptionsChanged.read(s),r?this.updateLines(r.lineNumber,r.additionalLines,r.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const s=this.editor.getModel();if(!s)return;const{tabSize:r}=s.getOptions();this.editor.changeViewZones(o=>{this._viewZoneId&&(o.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");renderLines(l,r,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=o.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function renderLines(n,e,t,i,s){const r=i.get(33),o=i.get(118),a="none",l=i.get(95),c=i.get(51),d=i.get(50),u=i.get(67),f=new StringBuilder(1e4);f.appendString('
    ');for(let _=0,v=t.length;_');const w=isBasicASCII(S),L=containsRTL(S),I=LineTokens.createEmpty(S,s);renderViewLine(new RenderLineInput(d.isMonospace&&!r,d.canUseHalfwidthRightwardsArrow,S,!1,w,L,0,I,C.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,o,a,l,c!==EditorFontLigatures.OFF,null),f),f.appendString("
    ")}f.appendString(""),applyFontInfo(n,d);const g=f.build(),m=ttPolicy?ttPolicy.createHTML(g):g;n.innerHTML=m}const ttPolicy=createTrustedTypesPolicy("editorGhostText",{createHTML:n=>n});function fixBracketsInLine(n,e){const t=new DenseKeyProvider,i=new LanguageAgnosticBracketTokens(t,c=>e.getLanguageConfiguration(c)),s=new TextBufferTokenizer(new StaticTokenizerSource([n]),i),r=parseDocument(s,[],void 0,!0);let o="";const a=n.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=lengthAdd(d,c.openingBracket.length),c.child&&(l(c.child,d),d=lengthAdd(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=lengthAdd(d,c.closingBracket.length);else{const f=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);o+=f}else if(c.kind!==3){if(c.kind===0||c.kind===1)o+=a.substring(d,lengthAdd(d,c.length));else if(c.kind===4)for(const u of c.children)l(u,d),d=lengthAdd(d,u.length)}}return l(r,lengthZero),o}class StaticTokenizerSource{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}async function provideInlineCompletions(n,e,t,i,s=CancellationToken.None,r){const o=e instanceof Position$1?getDefaultRange(e,t):e,a=n.all(t),l=new SetMap;for(const C of a)C.groupId&&l.add(C.groupId,C);function c(C){if(!C.yieldsToGroupIds)return[];const S=[];for(const w of C.yieldsToGroupIds||[]){const L=l.get(w);for(const I of L)S.push(I)}return S}const d=new Map,u=new Set;function f(C,S){if(S=[...S,C],u.has(C))return S;u.add(C);try{const w=c(C);for(const L of w){const I=f(L,S);if(I)return I}}finally{u.delete(C)}}function g(C){const S=d.get(C);if(S)return S;const w=f(C,[]);w&&onUnexpectedExternalError(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${w.map(I=>I.toString?I.toString():""+I).join(" -> ")}`));const L=new DeferredPromise;return d.set(C,L.p),(async()=>{var I;if(!w){const N=c(C);for(const R of N){const T=await g(R);if(T&&T.items.length>0)return}}try{return e instanceof Position$1?await C.provideInlineCompletions(t,e,i,s):await((I=C.provideInlineEdits)==null?void 0:I.call(C,t,e,i,s))}catch(N){onUnexpectedExternalError(N);return}})().then(I=>L.complete(I),I=>L.error(I)),L.p}const m=await Promise.all(a.map(async C=>({provider:C,completions:await g(C)}))),_=new Map,v=[];for(const C of m){const S=C.completions;if(!S)continue;const w=new InlineCompletionList(S,C.provider);v.push(w);for(const L of S.items){const I=InlineCompletionItem.from(L,w,o,t,r);_.set(I.hash(),I)}}return new InlineCompletionProviderResult(Array.from(_.values()),new Set(_.keys()),v)}class InlineCompletionProviderResult{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class InlineCompletionList{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class InlineCompletionItem{static from(e,t,i,s,r){let o,a,l=e.range?Range$2.lift(e.range):i;if(typeof e.insertText=="string"){if(o=e.insertText,r&&e.completeBracketPairs){o=closeBrackets(o,l.getStartPosition(),s,r);const c=o.length-e.insertText.length;c!==0&&(l=new Range$2(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(r&&e.completeBracketPairs){e.insertText.snippet=closeBrackets(e.insertText.snippet,l.getStartPosition(),s,r);const u=e.insertText.snippet.length-c;u!==0&&(l=new Range$2(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+u))}const d=new SnippetParser().parse(e.insertText.snippet);d.children.length===1&&d.children[0]instanceof Text?(o=d.children[0].value,a=void 0):(o=d.toString(),a={snippet:e.insertText.snippet,range:l})}else assertNever(e.insertText);return new InlineCompletionItem(o,e.command,l,o,a,e.additionalTextEdits||getReadonlyEmptyArray(),e,t)}constructor(e,t,i,s,r,o,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=s,this.snippetInfo=r,this.additionalTextEdits=o,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,` +`),s=e.replace(/\r\n|\r/g,` +`)}withRange(e){return new InlineCompletionItem(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new SingleTextEdit(this.range,this.insertText)}}function getDefaultRange(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new Range$2(n.lineNumber,t.startColumn,n.lineNumber,i):Range$2.fromPositions(n,n.with(void 0,i))}function closeBrackets(n,e,t,i){const r=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,o=t.tokenization.tokenizeLineWithEdit(e,r.length-(e.column-1),n),a=o==null?void 0:o.sliceAndInflate(e.column-1,r.length,0);return a?fixBracketsInLine(a,i):n}function singleTextRemoveCommonPrefix(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=e.getValueInRange(i,1),r=commonPrefixLength(s,n.text),o=TextLength.ofText(s.substring(0,r)).addToPosition(n.range.getStartPosition()),a=n.text.substring(r),l=Range$2.fromPositions(o,n.range.getEndPosition());return new SingleTextEdit(l,a)}function singleTextEditAugments(n,e){return n.text.startsWith(e.text)&&rangeExtends(n.range,e.range)}function computeGhostText(n,e,t,i,s=0){let r=singleTextRemoveCommonPrefix(n,e);if(r.range.endLineNumber!==r.range.startLineNumber)return;const o=e.getLineContent(r.range.startLineNumber),a=getLeadingWhitespace(o).length;if(r.range.startColumn-1<=a){const m=getLeadingWhitespace(r.text).length,_=o.substring(r.range.startColumn-1,a),[v,C]=[r.range.getStartPosition(),r.range.getEndPosition()],S=v.column+_.length<=C.column?v.delta(0,_.length):C,w=Range$2.fromPositions(S,C),L=r.text.startsWith(_)?r.text.substring(_.length):r.text.substring(m);r=new SingleTextEdit(w,L)}const c=e.getValueInRange(r.range),d=cachingDiff(c,r.text);if(!d)return;const u=r.range.startLineNumber,f=new Array;if(t==="prefix"){const m=d.filter(_=>_.originalLength===0);if(m.length>1||m.length===1&&m[0].originalStart!==c.length)return}const g=r.text.length-s;for(const m of d){const _=r.range.startColumn+m.originalStart+m.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.range.startLineNumber&&_0)return;if(m.modifiedLength===0)continue;const v=m.modifiedStart+m.modifiedLength,C=Math.max(m.modifiedStart,Math.min(v,g)),S=r.text.substring(m.modifiedStart,C),w=r.text.substring(C,Math.max(m.modifiedStart,v));S.length>0&&f.push(new GhostTextPart(_,S,!1)),w.length>0&&f.push(new GhostTextPart(_,w,!0))}return new GhostText(u,f)}function rangeExtends(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let lastRequest;function cachingDiff(n,e){if((lastRequest==null?void 0:lastRequest.originalValue)===n&&(lastRequest==null?void 0:lastRequest.newValue)===e)return lastRequest==null?void 0:lastRequest.changes;{let t=smartDiff(n,e,!0);if(t){const i=deletedCharacters(t);if(i>0){const s=smartDiff(n,e,!1);s&&deletedCharacters(s)5e3||e.length>5e3)return;function i(c){let d=0;for(let u=0,f=c.length;ud&&(d=g)}return d}const s=Math.max(i(n),i(e));function r(c){if(c<0)throw new Error("unexpected");return s+c+1}function o(c){let d=0,u=0;const f=new Int32Array(c.length);for(let g=0,m=c.length;ga},{getElements:()=>l}).ComputeDiff(!1).changes}var __decorate$$=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let InlineCompletionsSource=class extends Disposable{constructor(e,t,i,s,r){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=s,this.languageConfigurationService=r,this._updateOperation=this._register(new MutableDisposable),this.inlineCompletions=disposableObservableValue("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=disposableObservableValue("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var d,u;const s=new UpdateRequest(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if((d=this._updateOperation.value)!=null&&d.request.satisfies(s))return this._updateOperation.value.promise;if((u=r.get())!=null&&u.request.satisfies(s))return Promise.resolve(!0);const o=!!this._updateOperation.value;this._updateOperation.clear();const a=new CancellationTokenSource$1,l=(async()=>{if((o||t.triggerKind===InlineCompletionTriggerKind$1.Automatic)&&await wait$1(this._debounceValue.get(this.textModel),a.token),a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==s.versionId)return!1;const g=new Date,m=await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,a.token,this.languageConfigurationService);if(a.token.isCancellationRequested||this._store.isDisposed||this.textModel.getVersionId()!==s.versionId)return!1;const _=new Date;this._debounceValue.update(this.textModel,_.getTime()-g.getTime());const v=new UpToDateInlineCompletions(m,s,this.textModel,this.versionId);if(i){const C=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!m.has(C)&&v.prepend(i.inlineCompletion,C.range,!0)}return this._updateOperation.clear(),transaction(C=>{r.set(v,C)}),!0})(),c=new UpdateOperation(s,a,l);return this._updateOperation.value=c,l}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;(t=this._updateOperation.value)!=null&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};InlineCompletionsSource=__decorate$$([__param$$(3,ILanguageFeaturesService),__param$$(4,ILanguageConfigurationService)],InlineCompletionsSource);function wait$1(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class UpdateRequest{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&equalsIfDefined(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,itemEquals())&&(e.context.triggerKind===InlineCompletionTriggerKind$1.Automatic||this.context.triggerKind===InlineCompletionTriggerKind$1.Explicit)&&this.versionId===e.versionId}}class UpdateOperation{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class UpToDateInlineCompletions{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,s){this.inlineCompletionProviderResult=e,this.request=t,this._textModel=i,this._versionId=s,this._refCount=1,this._prependedInlineCompletionItems=[];const r=i.deltaDecorations([],e.completions.map(o=>({range:o.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((o,a)=>new InlineCompletionWithUpdatedRange(o,r[a],this._textModel,this._versionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this._textModel.isDisposed()||this._textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const s=this._textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new InlineCompletionWithUpdatedRange(e,s,this._textModel,this._versionId)),this._prependedInlineCompletionItems.push(e)}}class InlineCompletionWithUpdatedRange{get forwardStable(){return this.inlineCompletion.source.inlineCompletions.enableForwardStability??!1}constructor(e,t,i,s){this.inlineCompletion=e,this.decorationId=t,this._textModel=i,this._modelVersion=s,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._updatedRange=derivedOpts({owner:this,equalsFn:Range$2.equalsRange},r=>(this._modelVersion.read(r),this._textModel.getDecorationRange(this.decorationId)))}toInlineCompletion(e){return this.inlineCompletion.withRange(this._updatedRange.read(e)??emptyRange)}toSingleTextEdit(e){return new SingleTextEdit(this._updatedRange.read(e)??emptyRange,this.inlineCompletion.insertText)}isVisible(e,t,i){const s=singleTextRemoveCommonPrefix(this._toFilterTextReplacement(i),e),r=this._updatedRange.read(i);if(!r||!this.inlineCompletion.range.getStartPosition().equals(r.getStartPosition())||t.lineNumber!==s.range.startLineNumber)return!1;const o=e.getValueInRange(s.range,1),a=s.text,l=Math.max(0,t.column-s.range.startColumn);let c=a.substring(0,l),d=a.substring(l),u=o.substring(0,l),f=o.substring(l);const g=e.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=g&&(u=u.trimStart(),u.length===0&&(f=f.trimStart()),c=c.trimStart(),c.length===0&&(d=d.trimStart())),c.startsWith(u)&&!!matchesSubString(f,d)}canBeReused(e,t){const i=this._updatedRange.read(void 0);return!!i&&i.containsPosition(t)&&this.isVisible(e,t,void 0)&&TextLength.ofRange(i).isGreaterThanOrEqualTo(TextLength.ofRange(this.inlineCompletion.range))}_toFilterTextReplacement(e){return new SingleTextEdit(this._updatedRange.read(e)??emptyRange,this.inlineCompletion.filterText)}}const emptyRange=new Range$2(1,1,1,1),Context$1={Visible:historyNavigationVisible,HasFocusedSuggestion:new RawContextKey("suggestWidgetHasFocusedSuggestion",!1,localize("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new RawContextKey("suggestWidgetDetailsVisible",!1,localize("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new RawContextKey("suggestWidgetMultipleSuggestions",!1,localize("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new RawContextKey("suggestionMakesTextEdit",!0,localize("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new RawContextKey("acceptSuggestionOnEnter",!0,localize("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new RawContextKey("suggestionHasInsertAndReplaceRange",!1,localize("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new RawContextKey("suggestionInsertMode",void 0,{type:"string",description:localize("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new RawContextKey("suggestionCanResolve",!1,localize("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},suggestWidgetStatusbarMenu=new MenuId("suggestWidgetStatusBar");class CompletionItem{constructor(e,t,i,s){var r;this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=FuzzyScore.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(r=t.label)==null?void 0:r.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,Range$2.isIRange(t.range)?(this.editStart=new Position$1(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Position$1(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Position$1(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||Range$2.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Position$1(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Position$1(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Position$1(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||Range$2.spansMultipleLines(t.range.insert)||Range$2.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new StopWatch(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{isCancellationError(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const Eg=class Eg{constructor(e=2,t=new Set,i=new Set,s=new Map,r=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=r}};Eg.default=new Eg;let CompletionOptions=Eg;class CompletionItemModel{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function provideSuggestionItems(n,e,t,i=CompletionOptions.default,s={triggerKind:0},r=CancellationToken.None){const o=new StopWatch;t=t.clone();const a=e.getWordAtPosition(t),l=a?new Range$2(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):Range$2.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],u=new DisposableStore,f=[];let g=!1;const m=(v,C,S)=>{var L;let w=!1;if(!C)return w;for(const I of C.suggestions)if(!i.kindFilter.has(I.kind)){if(!i.showDeprecated&&((L=I==null?void 0:I.tags)!=null&&L.includes(1)))continue;I.range||(I.range=c),I.sortText||(I.sortText=typeof I.label=="string"?I.label:I.label.label),!g&&I.insertTextRules&&I.insertTextRules&4&&(g=SnippetParser.guessNeedsClipboard(I.insertText)),d.push(new CompletionItem(t,I,C,v)),w=!0}return isDisposable(C)&&u.add(C),f.push({providerName:v._debugDisplayName??"unknown_provider",elapsedProvider:C.duration??-1,elapsedOverall:S.elapsed()}),w},_=(async()=>{})();for(const v of n.orderedGroups(e)){let C=!1;if(await Promise.all(v.map(async S=>{if(i.providerItemsToReuse.has(S)){const w=i.providerItemsToReuse.get(S);w.forEach(L=>d.push(L)),C=C||w.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(S)))try{const w=new StopWatch,L=await S.provideCompletionItems(e,t,s,r);C=m(S,L,w)||C}catch(w){onUnexpectedExternalError(w)}})),C||r.isCancellationRequested)break}return await _,r.isCancellationRequested?(u.dispose(),Promise.reject(new CancellationError)):new CompletionItemModel(d.sort(getSuggestionComparator(i.snippetSortOrder)),g,{entries:f,elapsed:o.elapsed()},u)}function defaultComparator(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 snippetUpComparator(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return defaultComparator(n,e)}function snippetDownComparator(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return defaultComparator(n,e)}const _snippetComparators=new Map;_snippetComparators.set(0,snippetUpComparator);_snippetComparators.set(2,snippetDownComparator);_snippetComparators.set(1,defaultComparator);function getSuggestionComparator(n){return _snippetComparators.get(n)}CommandsRegistry.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,r]=e;assertType(URI.isUri(t)),assertType(Position$1.isIPosition(i)),assertType(typeof s=="string"||!s),assertType(typeof r=="number"||!r);const{completionProvider:o}=n.get(ILanguageFeaturesService),a=await n.get(ITextModelService).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),u=await provideSuggestionItems(o,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?1:0});for(const f of u.items)c.length<(r??0)&&c.push(f.resolve(CancellationToken.None)),l.incomplete=l.incomplete||f.container.incomplete,l.suggestions.push(f.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>u.disposable.dispose(),100)}}finally{a.dispose()}});function showSimpleSuggestions(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class QuickSuggestionsOptions{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}}}const snippetSession="";function normalizeDriveLetter(n,e=isWindows){return hasDriveLetter(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var __decorate$_=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$_=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class CompositeSnippetVariableResolver{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class SelectionBasedVariableResolver{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const r=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);r&&(i=r.value,s=r.multiline)}if(i&&s&&e.snippet){const r=this._model.getLineContent(this._selection.startLineNumber),o=getLeadingWhitespace(r,0,this._selection.startColumn-1);let a=o;e.snippet.walk(c=>c===e?!1:(c instanceof Text&&(a=getLeadingWhitespace(splitLines(c.value).pop())),!0));const l=commonPrefixLength(a,o);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,u)=>`${d}${a.substr(l)}${u}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class ModelBasedVariableResolver{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return basename$2(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=basename$2(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return dirname$2(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(dirname$1(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class ClipboardBasedVariableResolver{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!isFalsyOrWhitespace(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let CommentBasedVariableResolver=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};CommentBasedVariableResolver=__decorate$_([__param$_(2,ILanguageConfigurationService)],CommentBasedVariableResolver);const cs=class cs{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return cs.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return cs.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return cs.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return cs.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",r=Math.trunc(Math.abs(i/60)),o=r<10?"0"+r:r,a=Math.abs(i)-r*60,l=a<10?"0"+a:a;return s+o+":"+l}}};cs.dayNames=[localize("Sunday","Sunday"),localize("Monday","Monday"),localize("Tuesday","Tuesday"),localize("Wednesday","Wednesday"),localize("Thursday","Thursday"),localize("Friday","Friday"),localize("Saturday","Saturday")],cs.dayNamesShort=[localize("SundayShort","Sun"),localize("MondayShort","Mon"),localize("TuesdayShort","Tue"),localize("WednesdayShort","Wed"),localize("ThursdayShort","Thu"),localize("FridayShort","Fri"),localize("SaturdayShort","Sat")],cs.monthNames=[localize("January","January"),localize("February","February"),localize("March","March"),localize("April","April"),localize("May","May"),localize("June","June"),localize("July","July"),localize("August","August"),localize("September","September"),localize("October","October"),localize("November","November"),localize("December","December")],cs.monthNamesShort=[localize("JanuaryShort","Jan"),localize("FebruaryShort","Feb"),localize("MarchShort","Mar"),localize("AprilShort","Apr"),localize("MayShort","May"),localize("JuneShort","Jun"),localize("JulyShort","Jul"),localize("AugustShort","Aug"),localize("SeptemberShort","Sep"),localize("OctoberShort","Oct"),localize("NovemberShort","Nov"),localize("DecemberShort","Dec")];let TimeBasedVariableResolver=cs;class WorkspaceBasedVariableResolver{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=toWorkspaceIdentifier(this._workspaceService.getWorkspace());if(!isEmptyWorkspaceIdentifier(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(isSingleFolderWorkspaceIdentifier(e))return basename$2(e.uri.path);let t=basename$2(e.configPath.path);return t.endsWith(WORKSPACE_EXTENSION)&&(t=t.substr(0,t.length-WORKSPACE_EXTENSION.length-1)),t}_resoveWorkspacePath(e){if(isSingleFolderWorkspaceIdentifier(e))return normalizeDriveLetter(e.uri.fsPath);const t=basename$2(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?normalizeDriveLetter(i):"/"}}class RandomBasedVariableResolver{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return generateUuid()}}var __decorate$Z=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$Z=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SnippetSession_1;const Vn=class Vn{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=groupBy(t.placeholders,Placeholder.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),r=this._snippet.fullLen(i),o=Range$2.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+r)),a=i.isFinalTabstop?Vn._decor.inactiveFinal:Vn._decor.inactive,l=t.addDecoration(o,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const r of this._placeholderGroups[this._placeholderGroupsIdx])if(r.transform){const o=this._placeholderDecorations.get(r),a=this._editor.getModel().getDecorationRange(o),l=this._editor.getModel().getValueInRange(a),c=r.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const r=new Set,o=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);o.push(new Selection$1(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(l,a.isFinalTabstop?Vn._decor.activeFinal:Vn._decor.active),r.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const u=this._placeholderDecorations.get(d);s.changeDecorationOptions(u,d.isFinalTabstop?Vn._decor.activeFinal:Vn._decor.active),r.add(d)}}for(const[a,l]of this._placeholderDecorations)r.has(a)||s.changeDecorationOptions(l,a.isFinalTabstop?Vn._decor.inactiveFinal:Vn._decor.inactive);return o});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Placeholder){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const r=this._placeholderDecorations.get(s),o=this._editor.getModel().getDecorationRange(r);if(!o){e.delete(s.index);break}i.push(o)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof Choice,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const r=e.shift();console.assert(r._offset!==-1),console.assert(!r._placeholderDecorations);const o=r._snippet.placeholderInfo.last.index;for(const l of r._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=s.index+(o+1)/this._nestingLevel:l.index=s.index+l.index/this._nestingLevel;this._snippet.replace(s,r._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const l of r._snippet.placeholders){const c=r._snippet.offset(l),d=r._snippet.fullLen(l),u=Range$2.fromPositions(t.getPositionAt(r._offset+c),t.getPositionAt(r._offset+c+d)),f=i.addDecoration(u,Vn._decor.inactive);this._placeholderDecorations.set(l,f)}}this._placeholderGroups=groupBy(this._snippet.placeholders,Placeholder.compareByIndex)})}};Vn._decor={active:ModelDecorationOptions.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:ModelDecorationOptions.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:ModelDecorationOptions.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:ModelDecorationOptions.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let OneSnippet=Vn;const _defaultOptions$1={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let SnippetSession=SnippetSession_1=class{static adjustWhitespace(e,t,i,s,r){const o=e.getLineContent(t.lineNumber),a=getLeadingWhitespace(o,0,t.column-1);let l;return s.walk(c=>{if(!(c instanceof Text)||c.parent instanceof Choice||r&&!r.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const f=s.offset(c);if(f===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??s.toString();const g=l.charCodeAt(f-1);(g===10||g===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let g=1;gL.get(IWorkspaceContextService)),m=e.invokeWithinContext(L=>new ModelBasedVariableResolver(L.get(ILabelService),f)),_=()=>a,v=f.getValueInRange(SnippetSession_1.adjustSelection(f,e.getSelection(),i,0)),C=f.getValueInRange(SnippetSession_1.adjustSelection(f,e.getSelection(),0,s)),S=f.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((L,I)=>({selection:L,idx:I})).sort((L,I)=>Range$2.compareRangesUsingStarts(L.selection,I.selection));for(const{selection:L,idx:I}of w){let N=SnippetSession_1.adjustSelection(f,L,i,0),R=SnippetSession_1.adjustSelection(f,L,0,s);v!==f.getValueInRange(N)&&(N=L),C!==f.getValueInRange(R)&&(R=L);const T=L.setStartPosition(N.startLineNumber,N.startColumn).setEndPosition(R.endLineNumber,R.endColumn),A=new SnippetParser().parse(t,!0,r),F=T.getStartPosition(),B=SnippetSession_1.adjustWhitespace(f,F,o||I>0&&S!==f.getLineFirstNonWhitespaceColumn(L.positionLineNumber),A);A.resolveVariables(new CompositeSnippetVariableResolver([m,new ClipboardBasedVariableResolver(_,I,w.length,e.getOption(79)==="spread"),new SelectionBasedVariableResolver(f,L,I,l),new CommentBasedVariableResolver(f,L,c),new TimeBasedVariableResolver,new WorkspaceBasedVariableResolver(g),new RandomBasedVariableResolver])),d[I]=EditOperation.replace(T,A.toString()),d[I].identifier={major:I,minor:0},d[I]._isTracked=!0,u[I]=new OneSnippet(e,A,B)}return{edits:d,snippets:u}}static createEditsAndSnippetsFromEdits(e,t,i,s,r,o,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new SnippetParser,u=new TextmateSnippet,f=new CompositeSnippetVariableResolver([e.invokeWithinContext(m=>new ModelBasedVariableResolver(m.get(ILabelService),c)),new ClipboardBasedVariableResolver(()=>r,0,e.getSelections().length,e.getOption(79)==="spread"),new SelectionBasedVariableResolver(c,e.getSelection(),0,o),new CommentBasedVariableResolver(c,e.getSelection(),a),new TimeBasedVariableResolver,new WorkspaceBasedVariableResolver(e.invokeWithinContext(m=>m.get(IWorkspaceContextService))),new RandomBasedVariableResolver]);t=t.sort((m,_)=>Range$2.compareRangesUsingStarts(m.range,_.range));let g=0;for(let m=0;m0){const I=t[m-1].range,N=Range$2.fromPositions(I.getEndPosition(),_.getStartPosition()),R=new Text(c.getValueInRange(N));u.appendChild(R),g+=R.value.length}const C=d.parseFragment(v,u);SnippetSession_1.adjustWhitespace(c,_.getStartPosition(),!0,u,new Set(C)),u.resolveVariables(f);const S=u.toString(),w=S.slice(g);g=S.length;const L=EditOperation.replace(_,w);L.identifier={major:m,minor:0},L._isTracked=!0,l.push(L)}return d.ensureFinalTabstop(u,i,!0),{edits:l,snippets:[new OneSnippet(e,u,"")]}}constructor(e,t,i=_defaultOptions$1,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){dispose(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?SnippetSession_1.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):SnippetSession_1.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const s=i.filter(r=>!!r.identifier);for(let r=0;rSelection$1.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=_defaultOptions$1){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=SnippetSession_1.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,r=>{const o=r.filter(l=>!!l.identifier);for(let l=0;lSelection$1.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{r.push(...s.get(o))})}e.sort(Range$2.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(Range$2.compareRangesUsingStarts);for(let r=0;r0}};SnippetSession=SnippetSession_1=__decorate$Z([__param$Z(3,ILanguageConfigurationService)],SnippetSession);var __decorate$Y=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$Y=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SnippetController2_1;const _defaultOptions={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var _r;let SnippetController2=(_r=class{static get(e){return e.getContribution(SnippetController2_1.ID)}constructor(e,t,i,s,r){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=r,this._snippetListener=new DisposableStore,this._modelVersionId=-1,this._inSnippet=SnippetController2_1.InSnippetMode.bindTo(s),this._hasNextTabstop=SnippetController2_1.HasNextTabstop.bindTo(s),this._hasPrevTabstop=SnippetController2_1.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?_defaultOptions:{..._defaultOptions,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(assertType(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new SnippetSession(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,u)=>{if(!this._session||d!==this._editor.getModel()||!Position$1.equals(this._editor.getPosition(),u))return;const{activeChoice:f}=this._session;if(!f||f.choice.options.length===0)return;const g=d.getValueInRange(f.range),m=!!f.choice.options.find(v=>v.value===g),_=[];for(let v=0;v{o==null||o.dispose(),a=!1},c=()=>{a||(o=this._languageFeaturesService.completionProvider.register({language:r.getLanguageId(),pattern:r.uri.fsPath,scheme:r.uri.scheme,exclusive:!0},s),this._snippetListener.add(o),a=!0)};this._choiceCompletions={provider:s,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{showSimpleSuggestions(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)==null||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}},SnippetController2_1=_r,_r.ID="snippetController2",_r.InSnippetMode=new RawContextKey("inSnippetMode",!1,localize("inSnippetMode","Whether the editor in current in snippet mode")),_r.HasNextTabstop=new RawContextKey("hasNextTabstop",!1,localize("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),_r.HasPrevTabstop=new RawContextKey("hasPrevTabstop",!1,localize("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),_r);SnippetController2=SnippetController2_1=__decorate$Y([__param$Y(1,ILogService),__param$Y(2,ILanguageFeaturesService),__param$Y(3,IContextKeyService),__param$Y(4,ILanguageConfigurationService)],SnippetController2);registerEditorContribution(SnippetController2.ID,SnippetController2,4);const CommandCtor=EditorCommand.bindToContribution(SnippetController2.get);registerEditorCommand(new CommandCtor({id:"jumpToNextSnippetPlaceholder",precondition:ContextKeyExpr.and(SnippetController2.InSnippetMode,SnippetController2.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:EditorContextKeys.textInputFocus,primary:2}}));registerEditorCommand(new CommandCtor({id:"jumpToPrevSnippetPlaceholder",precondition:ContextKeyExpr.and(SnippetController2.InSnippetMode,SnippetController2.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:EditorContextKeys.textInputFocus,primary:1026}}));registerEditorCommand(new CommandCtor({id:"leaveSnippet",precondition:SnippetController2.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}}));registerEditorCommand(new CommandCtor({id:"acceptSnippet",precondition:SnippetController2.InSnippetMode,handler:n=>n.finish()}));var __decorate$X=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$X=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let InlineCompletionsModel=class extends Disposable{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,r,o,a,l,c,d,u,f){super(),this.textModel=e,this.selectedSuggestItem=t,this._textModelVersionId=i,this._positions=s,this._debounceValue=r,this._suggestPreviewEnabled=o,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=d,this._commandService=u,this._languageConfigurationService=f,this._source=this._register(this._instantiationService.createInstance(InlineCompletionsSource,this.textModel,this._textModelVersionId,this._debounceValue)),this._isActive=observableValue(this,!1),this._forceUpdateExplicitlySignal=observableSignal(this),this._selectedInlineCompletionId=observableValue(this,void 0),this._primaryPosition=derived(this,m=>this._positions.read(m)[0]??new Position$1(1,1)),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([VersionIdChangeReason.Redo,VersionIdChangeReason.Undo,VersionIdChangeReason.AcceptWord]),this._fetchInlineCompletionsPromise=derivedHandleChanges({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:InlineCompletionTriggerKind$1.Automatic}),handleChange:(m,_)=>(m.didChange(this._textModelVersionId)&&this._preserveCurrentCompletionReasons.has(this._getReason(m.change))?_.preserveCurrentCompletion=!0:m.didChange(this._forceUpdateExplicitlySignal)&&(_.inlineCompletionTriggerKind=InlineCompletionTriggerKind$1.Explicit),!0)},(m,_)=>{if(this._forceUpdateExplicitlySignal.read(m),!(this._enabled.read(m)&&this.selectedSuggestItem.read(m)||this._isActive.read(m))){this._source.cancelUpdate();return}this._textModelVersionId.read(m);const C=this._source.suggestWidgetInlineCompletions.get(),S=this.selectedSuggestItem.read(m);if(C&&!S){const R=this._source.inlineCompletions.get();transaction(T=>{(!R||C.request.versionId>R.request.versionId)&&this._source.inlineCompletions.set(C.clone(),T),this._source.clearSuggestWidgetInlineCompletions(T)})}const w=this._primaryPosition.read(m),L={triggerKind:_.inlineCompletionTriggerKind,selectedSuggestionInfo:S==null?void 0:S.toSelectedSuggestionInfo()},I=this.selectedInlineCompletion.get(),N=_.preserveCurrentCompletion||I!=null&&I.forwardStable?I:void 0;return this._source.fetch(w,L,N)}),this._filteredInlineCompletionItems=derivedOpts({owner:this,equalsFn:itemsEquals()},m=>{const _=this._source.inlineCompletions.read(m);if(!_)return[];const v=this._primaryPosition.read(m);return _.inlineCompletions.filter(S=>S.isVisible(this.textModel,v,m))}),this.selectedInlineCompletionIndex=derived(this,m=>{const _=this._selectedInlineCompletionId.read(m),v=this._filteredInlineCompletionItems.read(m),C=this._selectedInlineCompletionId===void 0?-1:v.findIndex(S=>S.semanticId===_);return C===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):C}),this.selectedInlineCompletion=derived(this,m=>{const _=this._filteredInlineCompletionItems.read(m),v=this.selectedInlineCompletionIndex.read(m);return _[v]}),this.activeCommands=derivedOpts({owner:this,equalsFn:itemsEquals()},m=>{var _;return((_=this.selectedInlineCompletion.read(m))==null?void 0:_.inlineCompletion.source.inlineCompletions.commands)??[]}),this.lastTriggerKind=this._source.inlineCompletions.map(this,m=>m==null?void 0:m.request.context.triggerKind),this.inlineCompletionsCount=derived(this,m=>{if(this.lastTriggerKind.read(m)===InlineCompletionTriggerKind$1.Explicit)return this._filteredInlineCompletionItems.read(m).length}),this.state=derivedOpts({owner:this,equalsFn:(m,_)=>!m||!_?m===_:ghostTextsOrReplacementsEqual(m.ghostTexts,_.ghostTexts)&&m.inlineCompletion===_.inlineCompletion&&m.suggestItem===_.suggestItem},m=>{const _=this.textModel,v=this.selectedSuggestItem.read(m);if(v){const C=singleTextRemoveCommonPrefix(v.toSingleTextEdit(),_),S=this._computeAugmentation(C,m);if(!this._suggestPreviewEnabled.read(m)&&!S)return;const L=(S==null?void 0:S.edit)??C,I=S?S.edit.text.length-C.text.length:0,N=this._suggestPreviewMode.read(m),R=this._positions.read(m),T=[L,...getSecondaryEdits(this.textModel,R,L)],A=T.map((B,W)=>computeGhostText(B,_,N,R[W],I)).filter(isDefined),F=A[0]??new GhostText(L.range.endLineNumber,[]);return{edits:T,primaryGhostText:F,ghostTexts:A,inlineCompletion:S==null?void 0:S.completion,suggestItem:v}}else{if(!this._isActive.read(m))return;const C=this.selectedInlineCompletion.read(m);if(!C)return;const S=C.toSingleTextEdit(m),w=this._inlineSuggestMode.read(m),L=this._positions.read(m),I=[S,...getSecondaryEdits(this.textModel,L,S)],N=I.map((R,T)=>computeGhostText(R,_,w,L[T],0)).filter(isDefined);return N[0]?{edits:I,primaryGhostText:N[0],ghostTexts:N,inlineCompletion:C,suggestItem:void 0}:void 0}}),this.ghostTexts=derivedOpts({owner:this,equalsFn:ghostTextsOrReplacementsEqual},m=>{const _=this.state.read(m);if(_)return _.ghostTexts}),this.primaryGhostText=derivedOpts({owner:this,equalsFn:ghostTextOrReplacementEquals},m=>{const _=this.state.read(m);if(_)return _==null?void 0:_.primaryGhostText}),this._register(recomputeInitiallyAndOnChange(this._fetchInlineCompletionsPromise));let g;this._register(autorun(m=>{var C,S;const _=this.state.read(m),v=_==null?void 0:_.inlineCompletion;if((v==null?void 0:v.semanticId)!==(g==null?void 0:g.semanticId)&&(g=v,v)){const w=v.inlineCompletion,L=w.source;(S=(C=L.provider).handleItemDidShow)==null||S.call(C,L.inlineCompletions,w.sourceInlineCompletion,w.insertText)}}))}_getReason(e){return e!=null&&e.isUndoing?VersionIdChangeReason.Undo:e!=null&&e.isRedoing?VersionIdChangeReason.Redo:this.isAcceptingPartially?VersionIdChangeReason.AcceptWord:VersionIdChangeReason.Other}async trigger(e){this._isActive.set(!0,e),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e){subtransaction(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineCompletionsPromise.get()}stop(e){subtransaction(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),r=s?s.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(isDefined);return mapFindFirst(r,a=>{let l=a.toSingleTextEdit(t);return l=singleTextRemoveCommonPrefix(l,i,Range$2.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),singleTextEditAugments(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){var s;if(e.getModel()!==this.textModel)throw new BugIndicatingError;const t=this.state.get();if(!t||t.primaryGhostText.isEmpty()||!t.inlineCompletion)return;const i=t.inlineCompletion.toInlineCompletion(void 0);if(i.command&&i.source.addRef(),e.pushUndoStop(),i.snippetInfo)e.executeEdits("inlineSuggestion.accept",[EditOperation.replace(i.range,""),...i.additionalTextEdits]),e.setPosition(i.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(s=SnippetController2.get(e))==null||s.insert(i.snippetInfo.snippet,{undoStopBefore:!1});else{const r=t.edits,o=getEndPositionsAfterApplying(r).map(a=>Selection$1.fromPositions(a));e.executeEdits("inlineSuggestion.accept",[...r.map(a=>EditOperation.replace(a.range,a.text)),...i.additionalTextEdits]),e.setSelections(o,"inlineCompletionAccept")}this.stop(),i.command&&(await this._commandService.executeCommand(i.command.id,...i.command.arguments||[]).then(void 0,onUnexpectedExternalError),i.source.removeRef())}async acceptNextWord(e){await this._acceptNext(e,(t,i)=>{const s=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),r=this._languageConfigurationService.getLanguageConfiguration(s),o=new RegExp(r.wordDefinition.source,r.wordDefinition.flags.replace("g","")),a=i.match(o);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const d=/\s+/g.exec(i);return d&&d.index!==void 0&&d.index+d[0].length{const s=i.match(/\n/);return s&&s.index!==void 0?s.index+1:i.length},1)}async _acceptNext(e,t,i){if(e.getModel()!==this.textModel)throw new BugIndicatingError;const s=this.state.get();if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;const r=s.primaryGhostText,o=s.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){await this.accept(e);return}const a=r.parts[0],l=new Position$1(r.lineNumber,a.column),c=a.text,d=t(l,c);if(d===c.length&&r.parts.length===1){this.accept(e);return}const u=c.substring(0,d),f=this._positions.get(),g=f[0];o.source.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const m=Range$2.fromPositions(g,l),_=e.getModel().getValueInRange(m)+u,v=new SingleTextEdit(m,_),C=[v,...getSecondaryEdits(this.textModel,f,v)],S=getEndPositionsAfterApplying(C).map(w=>Selection$1.fromPositions(w));e.executeEdits("inlineSuggestion.accept",C.map(w=>EditOperation.replace(w.range,w.text))),e.setSelections(S,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const m=Range$2.fromPositions(o.range.getStartPosition(),TextLength.ofText(u).addToPosition(l)),_=e.getModel().getValueInRange(m,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,_.length,{kind:i})}}finally{o.source.removeRef()}}handleSuggestAccepted(e){var r,o;const t=singleTextRemoveCommonPrefix(e.toSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const s=i.completion.inlineCompletion;(o=(r=s.source.provider).handlePartialAccept)==null||o.call(r,s.source.inlineCompletions,s.sourceInlineCompletion,t.text.length,{kind:2})}};InlineCompletionsModel=__decorate$X([__param$X(9,IInstantiationService),__param$X(10,ICommandService),__param$X(11,ILanguageConfigurationService)],InlineCompletionsModel);var VersionIdChangeReason;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(VersionIdChangeReason||(VersionIdChangeReason={}));function getSecondaryEdits(n,e,t){if(e.length===1)return[];const i=e[0],s=e.slice(1),r=t.range.getStartPosition(),o=t.range.getEndPosition(),a=n.getValueInRange(Range$2.fromPositions(i,o)),l=subtractPositions(i,r);if(l.lineNumber<1)return onUnexpectedError(new BugIndicatingError(`positionWithinTextEdit line number should be bigger than 0. + Invalid subtraction between ${i.toString()} and ${r.toString()}`)),[];const c=substringPos(t.text,l);return s.map(d=>{const u=addPositions(subtractPositions(d,r),o),f=n.getValueInRange(Range$2.fromPositions(d,u)),g=commonPrefixLength(a,f),m=Range$2.fromPositions(d,d.delta(0,g));return new SingleTextEdit(m,c)})}function substringPos(n,e){let t="";const i=splitLinesIncludeSeparators(n);for(let s=e.lineNumber-1;sr.range,Range$2.compareRangesUsingStarts)),i=new TextEdit(e.apply(n)).getNewRanges();return e.inverse().apply(i).map(r=>r.getEndPosition())}var __decorate$W=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$W=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SuggestMemoryService_1;class Memory{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let r=0;rl&&u.type===i[c].completion.kind&&u.insertText===i[c].completion.insertText&&(l=u.touch,a=c),i[c].completion.preselect&&o===-1)return o=c}return a!==-1?a:o!==-1?o:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:CompletionItemKinds.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class PrefixMemory extends Memory{constructor(){super("recentlyUsedByPrefix"),this._trie=TernarySearchTree.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),r=`${e.getLanguageId()}/${s}`;this._trie.set(r,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const r=`${e.getLanguageId()}/${s}`;let o=this._trie.get(r);if(o||(o=this._trie.findSubstr(r)),o)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:CompletionItemKinds.fromString(i.type),this._trie.set(t,i)}}}var Ta;let SuggestMemoryService=(Ta=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new DisposableStore,this._persistSoon=new RunOnceScheduler(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===WillSaveStateReason.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var s;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((s=this._strategy)==null?void 0:s.name)!==i){this._saveState();const r=SuggestMemoryService_1._strategyCtors.get(i)||NoMemory;this._strategy=new r;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${SuggestMemoryService_1._storagePrefix}/${i}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${SuggestMemoryService_1._storagePrefix}/${this._strategy.name}`,i,t,1)}}},SuggestMemoryService_1=Ta,Ta._strategyCtors=new Map([["recentlyUsedByPrefix",PrefixMemory],["recentlyUsed",LRUMemory],["first",NoMemory]]),Ta._storagePrefix="suggest/memories",Ta);SuggestMemoryService=SuggestMemoryService_1=__decorate$W([__param$W(0,IStorageService),__param$W(1,IConfigurationService)],SuggestMemoryService);const ISuggestMemoryService=createDecorator("ISuggestMemories");registerSingleton(ISuggestMemoryService,SuggestMemoryService,1);var __decorate$V=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$V=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},WordContextKey_1,ql;let WordContextKey=(ql=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=WordContextKey_1.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(124)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)==null||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(124)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),r=i.getWordAtPosition(s.getStartPosition());if(!r){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(r.endColumn===s.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},WordContextKey_1=ql,ql.AtEnd=new RawContextKey("atEndOfWord",!1),ql);WordContextKey=WordContextKey_1=__decorate$V([__param$V(1,IContextKeyService)],WordContextKey);var __decorate$U=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$U=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SuggestAlternatives_1,Gl;let SuggestAlternatives=(Gl=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=SuggestAlternatives_1.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)==null||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(SuggestAlternatives_1._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let r=t.items.length;r>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));r--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=SuggestAlternatives_1._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},SuggestAlternatives_1=Gl,Gl.OtherSuggestions=new RawContextKey("hasOtherSuggestions",!1),Gl);SuggestAlternatives=SuggestAlternatives_1=__decorate$U([__param$U(1,IContextKeyService)],SuggestAlternatives);class CommitCharacterController{constructor(e,t,i,s){this._disposables=new DisposableStore,this._disposables.add(i.onDidSuggest(r=>{r.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(r=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(r=>{if(this._active&&!t.isFrozen()&&i.state!==0){const o=r.charCodeAt(r.length-1);this._active.acceptCharacters.has(o)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!isNonEmptyArray(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new CharacterSet;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const En=class En{async provideSelectionRanges(e,t){const i=[];for(const s of t){const r=[];i.push(r);const o=new Map;await new Promise(a=>En._bracketsRightYield(a,0,e,s,o)),await new Promise(a=>En._bracketsLeftYield(a,0,e,s,o,r))}return i}static _bracketsRightYield(e,t,i,s,r){const o=new Map,a=Date.now();for(;;){if(t>=En._maxRounds){e();break}if(!s){e();break}const l=i.bracketPairs.findNextBracket(s);if(!l){e();break}if(Date.now()-a>En._maxDuration){setTimeout(()=>En._bracketsRightYield(e,t+1,i,s,r));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,u=o.has(d)?o.get(d):0;o.set(d,u+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let u=o.has(d)?o.get(d):0;if(u-=1,o.set(d,Math.max(0,u)),u<0){let f=r.get(d);f||(f=new LinkedList,r.set(d,f)),f.push(l.range)}}s=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,r,o){const a=new Map,l=Date.now();for(;;){if(t>=En._maxRounds&&r.size===0){e();break}if(!s){e();break}const c=i.bracketPairs.findPrevBracket(s);if(!c){e();break}if(Date.now()-l>En._maxDuration){setTimeout(()=>En._bracketsLeftYield(e,t+1,i,s,r,o));break}if(c.bracketInfo.isOpeningBracket){const u=c.bracketInfo.bracketText;let f=a.has(u)?a.get(u):0;if(f-=1,a.set(u,Math.max(0,f)),f<0){const g=r.get(u);if(g){const m=g.shift();g.size===0&&r.delete(u);const _=Range$2.fromPositions(c.range.getEndPosition(),m.getStartPosition()),v=Range$2.fromPositions(c.range.getStartPosition(),m.getEndPosition());o.push({range:_}),o.push({range:v}),En._addBracketLeading(i,v,o)}}}else{const u=c.bracketInfo.getOpeningBrackets()[0].bracketText,f=a.has(u)?a.get(u):0;a.set(u,f+1)}s=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,r=e.getLineFirstNonWhitespaceColumn(s);r!==0&&r!==t.startColumn&&(i.push({range:Range$2.fromPositions(new Position$1(s,r),t.getEndPosition())}),i.push({range:Range$2.fromPositions(new Position$1(s,1),t.getEndPosition())}));const o=s-1;if(o>0){const a=e.getLineFirstNonWhitespaceColumn(o);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:Range$2.fromPositions(new Position$1(o,a),t.getEndPosition())}),i.push({range:Range$2.fromPositions(new Position$1(o,1),t.getEndPosition())}))}}};En._maxDuration=30,En._maxRounds=2;let BracketSelectionRangeProvider=En;const ds=class ds{static async create(e,t){if(!t.getOption(119).localityBonus||!t.hasModel())return ds.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return ds.None;const[r]=await new BracketSelectionRangeProvider().provideSelectionRanges(i,[s]);if(r.length===0)return ds.None;const o=await e.computeWordRanges(i.uri,r[0].range);if(!o)return ds.None;const a=i.getWordUntilPosition(s);return delete o[a.word],new class extends ds{distance(l,c){if(!s.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,u=o[d];if(isFalsyOrEmpty(u))return 2<<20;const f=binarySearch(u,Range$2.fromPositions(l),Range$2.compareRangesUsingStarts),g=f>=0?u[f]:u[Math.max(0,~f-1)];let m=r.length;for(const _ of r){if(!Range$2.containsRange(_.range,g))break;m-=1}return m}}}};ds.None=new class extends ds{distance(){return 0}};let WordDistance=ds,LineContext$1=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class CompletionModel{constructor(e,t,i,s,r,o,a=FuzzyScoreOptions.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=CompletionModel._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=r,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,o==="top"?this._snippetCompareFn=CompletionModel._compareCompletionItemsSnippetsUp:o==="bottom"&&(this._snippetCompareFn=CompletionModel._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",r="";const o=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||o.length>2e3?fuzzyScore:fuzzyScoreGracefulAggressive;for(let c=0;c=g)d.score=FuzzyScore.Default;else if(typeof d.completion.filterText=="string"){const _=l(s,r,m,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!_)continue;compareIgnoreCase(d.completion.filterText,d.textLabel)===0?d.score=_:(d.score=anyScore(s,r,m,d.textLabel,d.labelLow,0),d.score[0]=_[0])}else{const _=l(s,r,m,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!_)continue;d.score=_}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?quickSelect(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return CompletionModel._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return CompletionModel._compareCompletionItems(e,t)}}var __decorate$T=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$T=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SuggestModel_1;class LineContext{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function canShowQuickSuggest(n,e,t){if(!e.getContextKeyValue(InlineCompletionContextKeys.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(InlineCompletionContextKeys.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function canShowSuggestOnTriggerCharacters(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(InlineCompletionContextKeys.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let SuggestModel=SuggestModel_1=class{constructor(e,t,i,s,r,o,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=r,this._contextKeyService=o,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new DisposableStore,this._triggerCharacterListener=new DisposableStore,this._triggerQuickSuggest=new TimeoutTimer,this._triggerState=void 0,this._completionDisposables=new DisposableStore,this._onDidCancel=new Emitter$1,this._onDidTrigger=new Emitter$1,this._onDidSuggest=new Emitter$1,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Selection$1(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(u=>{d||this._onCursorChange(u)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){dispose(this._triggerCharacterListener),dispose([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(92)||!this._editor.hasModel()||!this._editor.getOption(122))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let r=e.get(s);r||(r=new Set,e.set(s,r)),r.add(i)}const t=i=>{var o;if(!canShowSuggestOnTriggerCharacters(this._editor,this._contextKeyService,this._configurationService)||LineContext.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let s="";isLowSurrogate(i.charCodeAt(i.length-1))?isHighSurrogate(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const r=e.get(s);if(r){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())r.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:(o=this._completionModel)==null?void 0:o.clipboardText,completionOptions:{providerFilter:r,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)==null||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;QuickSuggestionsOptions.isAllOff(this._editor.getOption(90))||this._editor.getOption(119).snippetsPreventQuickSuggestions&&((e=SnippetController2.get(this._editor))!=null&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!LineContext.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=this._editor.getOption(90);if(!QuickSuggestionsOptions.isAllOff(s)){if(!QuickSuggestionsOptions.isAllOn(s)){t.tokenization.tokenizeIfCheap(i.lineNumber);const r=t.tokenization.getLineTokens(i.lineNumber),o=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(QuickSuggestionsOptions.valueFor(s,o)!=="on")return}canShowQuickSuggest(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(91)))}_refilterCompletionItems(){assertType(this._editor.hasModel()),assertType(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new LineContext(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var f,g,m;if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new LineContext(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??0};e.triggerCharacter&&(s={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new CancellationTokenSource$1;const r=this._editor.getOption(113);let o=1;switch(r){case"top":o=0;break;case"bottom":o=2;break}const{itemKind:a,showDeprecated:l}=SuggestModel_1.createSuggestFilter(this._editor),c=new CompletionOptions(o,((f=e.completionOptions)==null?void 0:f.kindFilter)??a,(g=e.completionOptions)==null?void 0:g.providerFilter,(m=e.completionOptions)==null?void 0:m.providerItemsToReuse,l),d=WordDistance.create(this._editorWorkerService,this._editor),u=provideSuggestionItems(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,s,this._requestToken.token);Promise.all([u,d]).then(async([_,v])=>{var I;if((I=this._requestToken)==null||I.dispose(),!this._editor.hasModel())return;let C=e==null?void 0:e.clipboardText;if(!C&&_.needsClipboard&&(C=await this._clipboardService.readText()),this._triggerState===void 0)return;const S=this._editor.getModel(),w=new LineContext(S,this._editor.getPosition(),e),L={...FuzzyScoreOptions.default,firstMatchCanBeWeak:!this._editor.getOption(119).matchOnWordStartOnly};if(this._completionModel=new CompletionModel(_.items,this._context.column,{leadingLineContent:w.leadingLineContent,characterCountDelta:w.column-this._context.column},v,this._editor.getOption(119),this._editor.getOption(113),L,C),this._completionDisposables.add(_.disposable),this._onNewContext(w),this._reportDurationsTelemetry(_.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const N of _.items)N.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${N.provider._debugDisplayName}`,N.completion)}).catch(onUnexpectedError)}_reportDurationsTelemetry(e){this._telemetryGate++%230===0&&setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(113)==="none"&&t.add(27);const s=e.getOption(119);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(27),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(getLeadingWhitespace(e.leadingLineContent)!==getLeadingWhitespace(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(LineContext.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,r]of this._completionModel.getItemsByProvider())r.length>0&&r[0].container.incomplete?i.add(s):t.set(s,r);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=LineContext.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};SuggestModel=SuggestModel_1=__decorate$T([__param$T(1,IEditorWorkerService),__param$T(2,IClipboardService),__param$T(3,ITelemetryService),__param$T(4,ILogService),__param$T(5,IContextKeyService),__param$T(6,IConfigurationService),__param$T(7,ILanguageFeaturesService),__param$T(8,IEnvironmentService)],SuggestModel);const Lg=class Lg{constructor(e,t){this._disposables=new DisposableStore,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let r=!1;for(let a=0;aLg._maxSelectionLength)return;this._lastOvertyped[a]={value:o.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$S=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let SuggestWidgetStatus=class{constructor(e,t,i,s,r){this._menuId=t,this._menuService=s,this._contextKeyService=r,this._menuDisposables=new DisposableStore,this.element=append$1(e,$$e(".suggest-status-bar"));const o=a=>a instanceof MenuItemAction?i.createInstance(TextOnlyMenuEntryActionViewItem,a,{useComma:!0}):void 0;this._leftActions=new ActionBar(this.element,{actionViewItemProvider:o}),this._rightActions=new ActionBar(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[r,o]of e.getActions())r==="left"?i.push(...o):s.push(...o);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};SuggestWidgetStatus=__decorate$S([__param$S(2,IInstantiationService),__param$S(3,IMenuService),__param$S(4,IContextKeyService)],SuggestWidgetStatus);var __decorate$R=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$R=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function canExpandCompletionItem(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let SuggestDetailsWidget=class{constructor(e,t){this._editor=e,this._onDidClose=new Emitter$1,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new Emitter$1,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new DisposableStore,this._renderDisposeable=new DisposableStore,this._borderWidth=1,this._size=new Dimension(330,0),this.domNode=$$e(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(MarkdownRenderer,{editor:e}),this._body=$$e(".body"),this._scrollbar=new DomScrollableElement(this._body,{alwaysConsumeMouseWheel:!0}),append$1(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=append$1(this._body,$$e(".header")),this._close=append$1(this._header,$$e("span"+ThemeIcon.asCSSSelector(Codicon.close))),this._close.title=localize("details.close","Close"),this._type=append$1(this._header,$$e("p.type")),this._docs=append$1(this._body,$$e("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),s=e.get(120)||t.fontSize,r=e.get(121)||t.lineHeight,o=t.fontWeight,a=`${s}px`,l=`${r}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${r/s}`,this.domNode.style.fontWeight=o,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(121)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=localize("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var r;this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let o="";o+=`score: ${e.score[0]} +`,o+=`prefix: ${e.word??"(no prefix)"} +`,o+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} +`,o+=`distance: ${e.distance} (localityBonus-setting) +`,o+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} +`,o+=`commit_chars: ${(r=e.completion.commitCharacters)==null?void 0:r.join("")} +`,s=new MarkdownString().appendCodeblock("empty",o),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!canExpandCompletionItem(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const o=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=o,this._type.title=o,show(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(o))}else clearNode(this._type),this._type.title="",hide(this._type),this.domNode.classList.add("no-type");if(clearNode(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),clearNode(this._docs);const o=this._markdownRenderer.render(s);this._docs.appendChild(o.element),this._renderDisposeable.add(o),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=o=>{o.preventDefault(),o.stopPropagation()},this._close.onclick=o=>{o.preventDefault(),o.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Dimension(e,t);Dimension.equals(i,this._size)||(this._size=i,size(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};SuggestDetailsWidget=__decorate$R([__param$R(1,IInstantiationService)],SuggestDetailsWidget);class SuggestDetailsOverlay{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new DisposableStore,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new ResizableHTMLElement,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,r=0,o=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(o=s.width-a.dimension.width,l=!0),a.north&&(r=s.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+r,left:i.left+o})}a.done&&(i=void 0,s=void 0,r=0,o=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=getClientArea(this.getDomNode().ownerDocument.body),r=this.widget.getLayoutInfo(),o=new Dimension(220,2*r.lineHeight),a=e.top,l=function(){const I=s.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),N=-r.borderWidth+e.left+e.width,R=new Dimension(I,s.height-e.top-r.borderHeight-r.verticalPadding),T=R.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:N,fit:I-t.width,maxSizeTop:R,maxSizeBottom:T,minSize:o.with(Math.min(I,o.width))}}(),c=function(){const I=e.left-r.borderWidth-r.horizontalPadding,N=Math.max(r.horizontalPadding,e.left-t.width-r.borderWidth),R=new Dimension(I,s.height-e.top-r.borderHeight-r.verticalPadding),T=R.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:a,left:N,fit:I-t.width,maxSizeTop:R,maxSizeBottom:T,minSize:o.with(Math.min(I,o.width))}}(),d=function(){const I=e.left,N=-r.borderWidth+e.top+e.height,R=new Dimension(e.width-r.borderHeight,s.height-e.top-e.height-r.verticalPadding);return{top:N,left:I,fit:R.height-t.height,maxSizeBottom:R,maxSizeTop:R,minSize:o.with(R.width)}}(),u=[l,c,d],f=u.find(I=>I.fit>=0)??u.sort((I,N)=>N.fit-I.fit)[0],g=e.top+e.height-r.borderHeight;let m,_=t.height;const v=Math.max(f.maxSizeTop.height,f.maxSizeBottom.height);_>v&&(_=v);let C;i?_<=f.maxSizeTop.height?(m=!0,C=f.maxSizeTop):(m=!1,C=f.maxSizeBottom):_<=f.maxSizeBottom.height?(m=!1,C=f.maxSizeBottom):(m=!0,C=f.maxSizeTop);let{top:S,left:w}=f;!m&&_>e.height&&(S=g-_);const L=this._editor.getDomNode();if(L){const I=L.getBoundingClientRect();S-=I.top,w-=I.left}this._applyTopLeft({left:w,top:S}),this._resizable.enableSashes(!m,f===l,m,f!==l),this._resizable.minSize=f.minSize,this._resizable.maxSize=C,this._resizable.layout(_,Math.min(C.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}var FileKind;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(FileKind||(FileKind={}));const fileIconDirectoryRegex=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function getIconClasses(n,e,t,i,s){if(ThemeIcon.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(URI.isUri(s))return[];const r=i===FileKind.ROOT_FOLDER?["rootfolder-icon"]:i===FileKind.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Schemas.data)o=DataUri.parseMetaData(t).get(DataUri.META_DATA_LABEL);else{const a=t.path.match(fileIconDirectoryRegex);a?(o=cssEscape(a[2].toLowerCase()),a[1]&&r.push(`${cssEscape(a[1].toLowerCase())}-name-dir-icon`)):o=cssEscape(t.authority.toLowerCase())}if(i===FileKind.ROOT_FOLDER)r.push(`${o}-root-name-folder-icon`);else if(i===FileKind.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const l=o.split(".");for(let c=1;c=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$Q=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function getAriaId(n){return`suggest-aria-id:${n}`}const suggestMoreInfoIcon=registerIcon("suggest-more-info",Codicon.chevronRight,localize("suggestMoreInfoIcon","Icon for more information in the suggest widget."));var hs;const _completionItemColor=new(hs=class{extract(e,t){if(e.textLabel.match(hs._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(hs._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,s=hs._regexRelaxed.exec(i);if(s&&(s.index===0||s.index+s[0].length===i.length))return t[0]=s[0],!0}return!1}},hs._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,hs._regexStrict=new RegExp(`^${hs._regexRelaxed.source}$`,"i"),hs);let ItemRenderer=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new Emitter$1,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new DisposableStore,i=e;i.classList.add("show-file-icons");const s=append$1(e,$$e(".icon")),r=append$1(s,$$e("span.colorspan")),o=append$1(e,$$e(".contents")),a=append$1(o,$$e(".main")),l=append$1(a,$$e(".icon-label.codicon")),c=append$1(a,$$e("span.left")),d=append$1(a,$$e("span.right")),u=new IconLabel(c,{supportHighlights:!0,supportIcons:!0});t.add(u);const f=append$1(c,$$e("span.signature-label")),g=append$1(c,$$e("span.qualifier-label")),m=append$1(d,$$e("span.details-label")),_=append$1(d,$$e("span.readMore"+ThemeIcon.asCSSSelector(suggestMoreInfoIcon)));return _.title=localize("readMore","Read More"),{root:i,left:c,right:d,icon:s,colorspan:r,iconLabel:u,iconContainer:l,parametersLabel:f,qualifierLabel:g,detailsLabel:m,readMore:_,disposables:t,configureFont:()=>{const C=this._editor.getOptions(),S=C.get(50),w=S.getMassagedFontFamily(),L=S.fontFeatureSettings,I=C.get(120)||S.fontSize,N=C.get(121)||S.lineHeight,R=S.fontWeight,T=S.letterSpacing,A=`${I}px`,F=`${N}px`,B=`${T}px`;i.style.fontSize=A,i.style.fontWeight=R,i.style.letterSpacing=B,a.style.fontFamily=w,a.style.fontFeatureSettings=L,a.style.lineHeight=F,s.style.height=F,s.style.width=F,_.style.height=F,_.style.width=F}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.root.id=getAriaId(t),i.colorspan.style.backgroundColor="";const r={labelEscapeNewLines:!0,matches:createMatches(e.score)},o=[];if(s.kind===19&&_completionItemColor.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:e.textLabel}),FileKind.FILE),l=getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:s.detail}),FileKind.FILE);r.extraClasses=a.length>l.length?a:l}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",r.extraClasses=[getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:e.textLabel}),FileKind.FOLDER),getIconClasses(this._modelService,this._languageService,URI.from({scheme:"fake",path:s.detail}),FileKind.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...ThemeIcon.asClassNameArray(CompletionItemKinds.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(r.extraClasses=(r.extraClasses||[]).concat(["deprecated"]),r.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,r),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=stripNewLines(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=stripNewLines(s.label.detail||""),i.detailsLabel.textContent=stripNewLines(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(119).showInlineDetails?show(i.detailsLabel):hide(i.detailsLabel),canExpandCompletionItem(e)?(i.right.classList.add("can-expand-details"),show(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),hide(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};ItemRenderer=__decorate$Q([__param$Q(1,IModelService),__param$Q(2,ILanguageService),__param$Q(3,IThemeService)],ItemRenderer);function stripNewLines(n){return n.replace(/\r\n|\r|\n/g,"")}var __decorate$P=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$P=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SuggestWidget_1;registerColor("editorSuggestWidget.background",editorWidgetBackground,localize("editorSuggestWidgetBackground","Background color of the suggest widget."));registerColor("editorSuggestWidget.border",editorWidgetBorder,localize("editorSuggestWidgetBorder","Border color of the suggest widget."));const editorSuggestWidgetForeground=registerColor("editorSuggestWidget.foreground",editorForeground,localize("editorSuggestWidgetForeground","Foreground color of the suggest widget."));registerColor("editorSuggestWidget.selectedForeground",quickInputListFocusForeground,localize("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));registerColor("editorSuggestWidget.selectedIconForeground",quickInputListFocusIconForeground,localize("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const editorSuggestWidgetSelectedBackground=registerColor("editorSuggestWidget.selectedBackground",quickInputListFocusBackground,localize("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));registerColor("editorSuggestWidget.highlightForeground",listHighlightForeground,localize("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));registerColor("editorSuggestWidget.focusHighlightForeground",listFocusHighlightForeground,localize("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));registerColor("editorSuggestWidgetStatus.foreground",transparent(editorSuggestWidgetForeground,.5),localize("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class PersistedWidgetSize{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof EmbeddedCodeEditorWidget}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Dimension.is(t))return Dimension.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var Da;let SuggestWidget=(Da=class{constructor(e,t,i,s,r){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new MutableDisposable,this._pendingShowDetails=new MutableDisposable,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new TimeoutTimer,this._disposables=new DisposableStore,this._onDidSelect=new PauseableEmitter,this._onDidFocus=new PauseableEmitter,this._onDidHide=new Emitter$1,this._onDidShow=new Emitter$1,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new Emitter$1,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new ResizableHTMLElement,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new SuggestContentWidget(this,e),this._persistedSize=new PersistedWidgetSize(t,e);class o{constructor(g,m,_=!1,v=!1){this.persistedSize=g,this.currentSize=m,this.persistHeight=_,this.persistWidth=v}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new o(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(f=>{var g,m;if(this._resize(f.dimension.width,f.dimension.height),a&&(a.persistHeight=a.persistHeight||!!f.north||!!f.south,a.persistWidth=a.persistWidth||!!f.east||!!f.west),!!f.done){if(a){const{itemHeight:_,defaultSize:v}=this.getLayoutInfo(),C=Math.round(_/2);let{width:S,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=C)&&(w=((g=a.persistedSize)==null?void 0:g.height)??v.height),(!a.persistWidth||Math.abs(a.currentSize.width-S)<=C)&&(S=((m=a.persistedSize)==null?void 0:m.width)??v.width),this._persistedSize.store(new Dimension(S,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=append$1(this.element.domNode,$$e(".message")),this._listElement=append$1(this.element.domNode,$$e(".tree"));const l=this._disposables.add(r.createInstance(SuggestDetailsWidget,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new SuggestDetailsOverlay(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(119).showIcons);c();const d=r.createInstance(ItemRenderer,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new List("SuggestWidget",this._listElement,{getHeight:f=>this.getLayoutInfo().itemHeight,getTemplateId:f=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>localize("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:f=>{let g=f.textLabel;if(typeof f.completion.label!="string"){const{detail:C,description:S}=f.completion.label;C&&S?g=localize("label.full","{0} {1}, {2}",g,C,S):C?g=localize("label.detail","{0} {1}",g,C):S&&(g=localize("label.desc","{0}, {1}",g,S))}if(!f.isResolved||!this._isDetailsVisible())return g;const{documentation:m,detail:_}=f.completion,v=format$1("{0}{1}",_||"",m?typeof m=="string"?m:m.value:"");return localize("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",g,v)}}}),this._list.style(getListStyles({listInactiveFocusBackground:editorSuggestWidgetSelectedBackground,listInactiveFocusOutline:activeContrastBorder})),this._status=r.createInstance(SuggestWidgetStatus,this.element.domNode,suggestWidgetStatusbarMenu);const u=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(119).showStatusBar);u(),this._disposables.add(s.onDidColorThemeChange(f=>this._onThemeChange(f))),this._onThemeChange(s.getColorTheme()),this._disposables.add(this._list.onMouseDown(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onTap(f=>this._onListMouseDownOrTap(f))),this._disposables.add(this._list.onDidChangeSelection(f=>this._onListSelection(f))),this._disposables.add(this._list.onDidChangeFocus(f=>this._onListFocus(f))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(f=>{f.hasChanged(119)&&(u(),c()),this._completionModel&&(f.hasChanged(50)||f.hasChanged(120)||f.hasChanged(121))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=Context$1.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=Context$1.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=Context$1.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=Context$1.HasFocusedSuggestion.bindTo(i),this._disposables.add(addStandardDisposableListener(this._details.widget.domNode,"keydown",f=>{this._onDetailsKeydown.fire(f)})),this._disposables.add(this.editor.onMouseDown(f=>this._onEditorMouseDown(f)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=isHighContrast(e.type)?2:1}_onListFocus(e){var s;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((s=this._currentSuggestionDetails)==null||s.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=createCancelablePromise(async r=>{const o=disposableTimeout(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=r.onCancellationRequested(()=>o.dispose());try{return await t.resolve(r)}finally{o.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:getAriaId(i)}))}).catch(onUnexpectedError)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:hide(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=SuggestWidget_1.LOADING_MESSAGE,hide(this._listElement,this._status.element),show(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,status(SuggestWidget_1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=SuggestWidget_1.NO_SUGGESTIONS_MESSAGE,hide(this._listElement,this._status.element),show(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,status(SuggestWidget_1.NO_SUGGESTIONS_MESSAGE);break;case 3:hide(this._messageElement),show(this._listElement,this._status.element),this._show();break;case 4:hide(this._messageElement),show(this._listElement,this._status.element),this._show();break;case 5:hide(this._messageElement),show(this._listElement,this._status.element),this._details.show(),this._show();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=disposableTimeout(()=>this._setState(1),t)))}showSuggestions(e,t,i,s,r){var l,c;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(c=this._currentSuggestionDetails)==null||c.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const o=this._completionModel.items.length,a=o===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(o>1),a){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(r?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(canExpandCompletionItem(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=runAtThisOrScheduleAtNextAnimationFrame(getWindow(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details")),this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightl&&(r=l);const c=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:r,d=i.statusBarHeight+this._list.contentHeight+i.borderHeight,u=i.itemHeight+i.statusBarHeight,f=getDomNodePagePosition(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=f.top+g.top+g.height,_=Math.min(t.height-m-i.verticalPadding,d),v=f.top+g.top-i.verticalPadding,C=Math.min(v,d);let S=Math.min(Math.max(C,_)+i.borderHeight,d);s===((o=this._cappedHeight)==null?void 0:o.capped)&&(s=this._cappedHeight.wanted),sS&&(s=S);const w=150;s>_||this._forceRenderingAbove&&v>w?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),S=C):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),S=_),this.element.preferredSize=new Dimension(c,i.defaultSize.height),this.element.maxSize=new Dimension(l,S),this.element.minSize=new Dimension(220,u),this._cappedHeight=s===d?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:s}:void 0}this._resize(r,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:r}=this.getLayoutInfo();this._list.layout(t-r,e),this._listElement.style.height=`${t-r}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())==null?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=clamp(this.editor.getOption(121)||e.lineHeight,8,1e3),i=!this.editor.getOption(119).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.borderWidth,r=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:r,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Dimension(430,i+12*t+r)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},SuggestWidget_1=Da,Da.LOADING_MESSAGE=localize("suggestWidget.loading","Loading..."),Da.NO_SUGGESTIONS_MESSAGE=localize("suggestWidget.noSuggestions","No suggestions."),Da);SuggestWidget=SuggestWidget_1=__decorate$P([__param$P(1,IStorageService),__param$P(2,IContextKeyService),__param$P(3,IThemeService),__param$P(4,IInstantiationService)],SuggestWidget);class SuggestContentWidget{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Dimension(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var __decorate$O=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$O=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SuggestController_1;class LineSuffix{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=ModelDecorationOptions.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),r=e.getPositionAt(s+1);e.changeDecorations(o=>{this._marker&&o.removeDecoration(this._marker),this._marker=o.addDecoration(Range$2.fromPositions(t,r),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var Yl;let SuggestController=(Yl=class{static get(e){return e.getContribution(SuggestController_1.ID)}constructor(e,t,i,s,r,o,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=r,this._logService=o,this._telemetryService=a,this._lineSuffix=new MutableDisposable,this._toDispose=new DisposableStore,this._selectors=new PriorityRegistry(u=>u.priority),this._onWillInsertSuggestItem=new Emitter$1,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=r.createInstance(SuggestModel,this.editor),this._selectors.register({priority:0,select:(u,f,g)=>this._memoryService.select(u,f,g)});const l=Context$1.InsertMode.bindTo(s);l.set(e.getOption(119).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(119).insertMode))),this.widget=this._toDispose.add(new WindowIdleValue(getWindow(e.getDomNode()),()=>{const u=this._instantiationService.createInstance(SuggestWidget,this.editor);this._toDispose.add(u),this._toDispose.add(u.onDidSelect(v=>this._insertSuggestion(v,0),this));const f=new CommitCharacterController(this.editor,u,this.model,v=>this._insertSuggestion(v,2));this._toDispose.add(f);const g=Context$1.MakesTextEdit.bindTo(this._contextKeyService),m=Context$1.HasInsertAndReplaceRange.bindTo(this._contextKeyService),_=Context$1.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(toDisposable(()=>{g.reset(),m.reset(),_.reset()})),this._toDispose.add(u.onDidFocus(({item:v})=>{const C=this.editor.getPosition(),S=v.editStart.column,w=C.column;let L=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!v.completion.additionalTextEdits&&!(v.completion.insertTextRules&4)&&w-S===v.completion.insertText.length&&(L=this.editor.getModel().getValueInRange({startLineNumber:C.lineNumber,startColumn:S,endLineNumber:C.lineNumber,endColumn:w})!==v.completion.insertText),g.set(L),m.set(!Position$1.equals(v.editInsertEnd,v.editReplaceEnd)),_.set(!!v.provider.resolveCompletionItem||!!v.completion.documentation||v.completion.detail!==v.completion.label)})),this._toDispose.add(u.onDetailsKeyDown(v=>{if(v.toKeyCodeChord().equals(new KeyCodeChord(!0,!1,!1,!1,33))||isMacintosh&&v.toKeyCodeChord().equals(new KeyCodeChord(!1,!1,!1,!0,33))){v.stopPropagation();return}v.toKeyCodeChord().isModifierKey()||this.editor.focus()})),u})),this._overtypingCapturer=this._toDispose.add(new WindowIdleValue(getWindow(e.getDomNode()),()=>this._toDispose.add(new OvertypingCapturer(this.editor,this.model)))),this._alternatives=this._toDispose.add(new WindowIdleValue(getWindow(e.getDomNode()),()=>this._toDispose.add(new SuggestAlternatives(this.editor,this._contextKeyService)))),this._toDispose.add(r.createInstance(WordContextKey,e)),this._toDispose.add(this.model.onDidTrigger(u=>{this.widget.value.showTriggered(u.auto,u.shy?250:50),this._lineSuffix.value=new LineSuffix(this.editor.getModel(),u.position)})),this._toDispose.add(this.model.onDidSuggest(u=>{if(u.triggerOptions.shy)return;let f=-1;for(const m of this._selectors.itemsOrderedByPriorityDesc)if(f=m.select(this.editor.getModel(),this.editor.getPosition(),u.completionModel.items),f!==-1)break;if(f===-1&&(f=0),this.model.state===0)return;let g=!1;if(u.triggerOptions.auto){const m=this.editor.getOption(119);m.selectionMode==="never"||m.selectionMode==="always"?g=m.selectionMode==="never":m.selectionMode==="whenTriggerCharacter"?g=u.triggerOptions.triggerKind!==1:m.selectionMode==="whenQuickSuggestion"&&(g=u.triggerOptions.triggerKind===1&&!u.triggerOptions.refilter)}this.widget.value.showSuggestions(u.completionModel,f,u.isFrozen,u.triggerOptions.auto,g)})),this._toDispose.add(this.model.onDidCancel(u=>{u.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=Context$1.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const u=this.editor.getOption(1);c.set(u==="on"||u==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=SnippetController2.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),r=s.getAlternativeVersionId(),{item:o}=e,a=[],l=new CancellationTokenSource$1;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(o,!!(t&8));this._memoryService.memorize(s,this.editor.getPosition(),o);const d=o.isResolved;let u=-1,f=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const m=StableEditorScrollState.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map(_=>{let v=Range$2.lift(_.range);if(v.startLineNumber===o.position.lineNumber&&v.startColumn>o.position.column){const C=this.editor.getPosition().column-o.position.column,S=C,w=Range$2.spansMultipleLines(v)?0:C;v=new Range$2(v.startLineNumber,v.startColumn+S,v.endLineNumber,v.endColumn+w)}return EditOperation.replaceMove(v,_.text)})),m.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const m=new StopWatch;let _;const v=s.onDidChangeContent(L=>{if(L.isFlush){l.cancel(),v.dispose();return}for(const I of L.changes){const N=Range$2.getEndPosition(I.range);(!_||Position$1.isBefore(N,_))&&(_=N)}}),C=t;t|=2;let S=!1;const w=this.editor.onWillType(()=>{w.dispose(),S=!0,C&2||this.editor.pushUndoStop()});a.push(o.resolve(l.token).then(()=>{if(!o.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(_&&o.completion.additionalTextEdits.some(I=>Position$1.isBefore(_,Range$2.getStartPosition(I.range))))return!1;S&&this.editor.pushUndoStop();const L=StableEditorScrollState.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map(I=>EditOperation.replaceMove(Range$2.lift(I.range),I.text))),L.restoreRelativeVerticalPositionOfCursor(this.editor),(S||!(C&2))&&this.editor.pushUndoStop(),!0}).then(L=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",m.elapsed(),L),f=L===!0?1:L===!1?0:-2}).finally(()=>{v.dispose(),w.dispose()}))}let{insertText:g}=o.completion;if(o.completion.insertTextRules&4||(g=SnippetParser.escape(g)),this.model.cancel(),i.insert(g,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(o.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===TriggerSuggestAction.id)this.model.trigger({auto:!0,retrigger:!0});else{const m=new StopWatch;a.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(_=>{o.completion.extensionId?onUnexpectedExternalError(_):onUnexpectedError(_)}).finally(()=>{u=m.elapsed()}))}t&4&&this._alternatives.value.set(e,m=>{for(l.cancel();s.canUndo();){r!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(m,3|(t&8?8:0));break}}),this._alertCompletionItem(o),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(o,s,d,u,f,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,r,o,a){var f;if(Math.floor(Math.random()*100)===0)return;const l=new Map;for(let g=0;g1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((f=e.extensionId)==null?void 0:f.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:hash(basename$1(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:extname$1(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:r,index:o,firstIndex:u})}getOverwriteInfo(e,t){assertType(this.editor.hasModel());let i=this.editor.getOption(119).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,r=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,o=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+o,overwriteAfter:r+a}}_alertCompletionItem(e){if(isNonEmptyArray(e.completion.additionalTextEdits)){const t=localize("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);alert$1(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=r=>{if(r.completion.insertTextRules&4||r.completion.additionalTextEdits)return!0;const o=this.editor.getPosition(),a=r.editStart.column,l=o.column;return l-a!==r.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:o.lineNumber,startColumn:a,endLineNumber:o.lineNumber,endColumn:l})!==r.completion.insertText};Event$1.once(this.model.onDidTrigger)(r=>{const o=[];Event$1.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{dispose(o),i()},void 0,o),this.model.onDidSuggest(({completionModel:a})=>{if(dispose(o),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!s(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,o)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.value.forceRenderingAbove()}stopForceRenderingAbove(){this.widget.isInitialized&&this.widget.value.stopForceRenderingAbove()}registerSelector(e){return this._selectors.register(e)}},SuggestController_1=Yl,Yl.ID="editor.contrib.suggestController",Yl);SuggestController=SuggestController_1=__decorate$O([__param$O(1,ISuggestMemoryService),__param$O(2,ICommandService),__param$O(3,IContextKeyService),__param$O(4,IInstantiationService),__param$O(5,ILogService),__param$O(6,ITelemetryService)],SuggestController);class PriorityRegistry{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const kg=class kg extends EditorAction{constructor(){super({id:kg.id,label:localize("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasCompletionItemProvider,Context$1.Visible.toNegated()),kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=SuggestController.get(t);if(!s)return;let r;i&&typeof i=="object"&&i.auto===!0&&(r=!0),s.triggerSuggest(void 0,r,void 0)}};kg.id="editor.action.triggerSuggest";let TriggerSuggestAction=kg;registerEditorContribution(SuggestController.ID,SuggestController,2);registerEditorAction(TriggerSuggestAction);const weight$2=100+90,SuggestCommand=EditorCommand.bindToContribution(SuggestController.get);registerEditorCommand(new SuggestCommand({id:"acceptSelectedSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:ContextKeyExpr.and(Context$1.Visible,EditorContextKeys.textInputFocus),weight:weight$2},{primary:3,kbExpr:ContextKeyExpr.and(Context$1.Visible,EditorContextKeys.textInputFocus,Context$1.AcceptSuggestionsOnEnter,Context$1.MakesTextEdit),weight:weight$2}],menuOpts:[{menuId:suggestWidgetStatusbarMenu,title:localize("accept.insert","Insert"),group:"left",order:1,when:Context$1.HasInsertAndReplaceRange.toNegated()},{menuId:suggestWidgetStatusbarMenu,title:localize("accept.insert","Insert"),group:"left",order:1,when:ContextKeyExpr.and(Context$1.HasInsertAndReplaceRange,Context$1.InsertMode.isEqualTo("insert"))},{menuId:suggestWidgetStatusbarMenu,title:localize("accept.replace","Replace"),group:"left",order:1,when:ContextKeyExpr.and(Context$1.HasInsertAndReplaceRange,Context$1.InsertMode.isEqualTo("replace"))}]}));registerEditorCommand(new SuggestCommand({id:"acceptAlternativeSelectedSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,EditorContextKeys.textInputFocus,Context$1.HasFocusedSuggestion),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:suggestWidgetStatusbarMenu,group:"left",order:2,when:ContextKeyExpr.and(Context$1.HasInsertAndReplaceRange,Context$1.InsertMode.isEqualTo("insert")),title:localize("accept.replace","Replace")},{menuId:suggestWidgetStatusbarMenu,group:"left",order:2,when:ContextKeyExpr.and(Context$1.HasInsertAndReplaceRange,Context$1.InsertMode.isEqualTo("replace")),title:localize("accept.insert","Insert")}]}));CommandsRegistry.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");registerEditorCommand(new SuggestCommand({id:"hideSuggestWidget",precondition:Context$1.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:9,secondary:[1033]}}));registerEditorCommand(new SuggestCommand({id:"selectNextSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));registerEditorCommand(new SuggestCommand({id:"selectNextPageSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:12,secondary:[2060]}}));registerEditorCommand(new SuggestCommand({id:"selectLastSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));registerEditorCommand(new SuggestCommand({id:"selectPrevSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));registerEditorCommand(new SuggestCommand({id:"selectPrevPageSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:11,secondary:[2059]}}));registerEditorCommand(new SuggestCommand({id:"selectFirstSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,ContextKeyExpr.or(Context$1.MultipleSuggestions,Context$1.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));registerEditorCommand(new SuggestCommand({id:"focusSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));registerEditorCommand(new SuggestCommand({id:"focusAndAcceptSuggestion",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));registerEditorCommand(new SuggestCommand({id:"toggleSuggestionDetails",precondition:ContextKeyExpr.and(Context$1.Visible,Context$1.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:suggestWidgetStatusbarMenu,group:"right",order:1,when:ContextKeyExpr.and(Context$1.DetailsVisible,Context$1.CanResolve),title:localize("detail.more","Show Less")},{menuId:suggestWidgetStatusbarMenu,group:"right",order:1,when:ContextKeyExpr.and(Context$1.DetailsVisible.toNegated(),Context$1.CanResolve),title:localize("detail.less","Show More")}]}));registerEditorCommand(new SuggestCommand({id:"toggleExplainMode",precondition:Context$1.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));registerEditorCommand(new SuggestCommand({id:"toggleSuggestionFocus",precondition:Context$1.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:2570,mac:{primary:778}}}));registerEditorCommand(new SuggestCommand({id:"insertBestCompletion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),WordContextKey.AtEnd,Context$1.Visible.toNegated(),SuggestAlternatives.OtherSuggestions.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(isObject(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:weight$2,primary:2}}));registerEditorCommand(new SuggestCommand({id:"insertNextSuggestion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),SuggestAlternatives.OtherSuggestions,Context$1.Visible.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:2}}));registerEditorCommand(new SuggestCommand({id:"insertPrevSuggestion",precondition:ContextKeyExpr.and(EditorContextKeys.textInputFocus,ContextKeyExpr.equals("config.editor.tabCompletion","on"),SuggestAlternatives.OtherSuggestions,Context$1.Visible.toNegated(),SnippetController2.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:weight$2,kbExpr:EditorContextKeys.textInputFocus,primary:1026}}));registerEditorAction(class extends EditorAction{constructor(){super({id:"editor.action.resetSuggestSize",label:localize("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=SuggestController.get(e))==null||t.resetWidgetSize()}});class SuggestWidgetAdaptor extends Disposable{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new Emitter$1),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(r=>{r.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(r=>{r.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const s=SuggestController.get(this.editor);if(s){this._register(s.registerSelector({priority:100,select:(a,l,c)=>{const d=this.editor.getModel();if(!d)return-1;const u=this.suggestControllerPreselector(),f=u?singleTextRemoveCommonPrefix(u,d):void 0;if(!f)return-1;const g=Position$1.lift(l),m=c.map((v,C)=>{const S=SuggestItemInfo.fromSuggestion(s,d,g,v,this.isShiftKeyPressed),w=singleTextRemoveCommonPrefix(S.toSingleTextEdit(),d),L=singleTextEditAugments(f,w);return{index:C,valid:L,prefixLength:w.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),_=findFirstMax(m,compareBy(v=>v.prefixLength,numberComparator));return _?_.index:-1}}));let r=!1;const o=()=>{r||(r=!0,this._register(s.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(s.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(s.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Event$1.once(s.model.onDidTrigger)(a=>{o()})),this._register(s.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const d=SuggestItemInfo.fromSuggestion(s,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!suggestItemInfoEquals(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=SuggestController.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return SuggestItemInfo.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=SuggestController.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=SuggestController.get(this.editor);e==null||e.forceRenderingAbove()}}class SuggestItemInfo{static fromSuggestion(e,t,i,s,r){let{insertText:o}=s.completion,a=!1;if(s.completion.insertTextRules&4){const c=new SnippetParser().parse(o);c.children.length<100&&SnippetSession.adjustWhitespace(t,i,!0,c),o=c.toString(),a=!0}const l=e.getOverwriteInfo(s,r);return new SuggestItemInfo(Range$2.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),o,s.completion.kind,a)}constructor(e,t,i,s){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new SelectedSuggestionInfo(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new SingleTextEdit(this.range,this.insertText)}}function suggestItemInfoEquals(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var __decorate$N=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$N=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineCompletionsController_1,Xl;let InlineCompletionsController=(Xl=class extends Disposable{static get(e){return e.getContribution(InlineCompletionsController_1.ID)}constructor(e,t,i,s,r,o,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=r,this._debounceService=o,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=observableCodeEditor(this.editor),this._positions=derived(this,f=>{var g;return((g=this._editorObs.selections.read(f))==null?void 0:g.map(m=>m.getEndPosition()))??[new Position$1(1,1)]}),this._suggestWidgetAdaptor=this._register(new SuggestWidgetAdaptor(this.editor,()=>{var f,g;return this._editorObs.forceUpdate(),(g=(f=this.model.get())==null?void 0:f.selectedInlineCompletion.get())==null?void 0:g.toSingleTextEdit(void 0)},f=>this._editorObs.forceUpdate(g=>{var m;(m=this.model.get())==null||m.handleSuggestAccepted(f)}))),this._suggestWidgetSelectedItem=observableFromEvent(this,f=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(g=>f(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem),this._enabledInConfig=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this._isScreenReaderEnabled=observableFromEvent(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=observableFromEvent(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=derived(this,f=>this._enabledInConfig.read(f)&&(!this._isScreenReaderEnabled.read(f)||!this._editorDictationInProgress.read(f))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this.model=derivedDisposable(this,f=>{if(this._editorObs.isReadonly.read(f))return;const g=this._editorObs.model.read(f);return g?this._instantiationService.createInstance(InlineCompletionsModel,g,this._suggestWidgetSelectedItem,this._editorObs.versionId,this._positions,this._debounceValue,observableFromEvent(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).preview),observableFromEvent(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(119).previewMode),observableFromEvent(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).mode),this._enabled):void 0}).recomputeInitiallyAndOnChange(this._store),this._ghostTexts=derived(this,f=>{const g=this.model.read(f);return(g==null?void 0:g.ghostTexts.read(f))??[]}),this._stablizedGhostTexts=convertItemsToStableObservables(this._ghostTexts,this._store),this._ghostTextWidgets=mapObservableArrayCached(this,this._stablizedGhostTexts,(f,g)=>g.add(this._instantiationService.createInstance(GhostTextView,this.editor,{ghostText:f,minReservedLineCount:constObservable(0),targetTextModel:this.model.map(m=>m==null?void 0:m.textModel)}))).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=observableSignal(this),this._fontFamily=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).fontFamily),this._register(new InlineCompletionContextKeys(this._contextKeyService,this.model)),this._register(reactToChange(this._editorObs.onDidType,(f,g)=>{var m;this._enabled.get()&&((m=this.model.get())==null||m.trigger())})),this._register(this._commandService.onDidExecuteCommand(f=>{new Set([CoreEditingCommands.Tab.id,CoreEditingCommands.DeleteLeft.id,CoreEditingCommands.DeleteRight.id,inlineSuggestCommitId,"acceptSelectedSuggestion"]).has(f.commandId)&&e.hasTextFocus()&&this._enabled.get()&&this._editorObs.forceUpdate(m=>{var _;(_=this.model.get())==null||_.trigger(m)})})),this._register(reactToChange(this._editorObs.selections,(f,g)=>{var m;g.some(_=>_.reason===3||_.source==="api")&&((m=this.model.get())==null||m.stop())})),this._register(this.editor.onDidBlurEditorWidget(()=>{this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||InlineSuggestionHintsContentWidget.dropDownVisible||transaction(f=>{var g;(g=this.model.get())==null||g.stop(f)})})),this._register(autorun(f=>{var m;const g=(m=this.model.read(f))==null?void 0:m.state.read(f);g!=null&&g.suggestItem?g.primaryGhostText.lineCount>=2&&this._suggestWidgetAdaptor.forceRenderingAbove():this._suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(toDisposable(()=>{this._suggestWidgetAdaptor.stopForceRenderingAbove()}));const u=derivedObservableWithCache(this,(f,g)=>{var v;const m=this.model.read(f),_=m==null?void 0:m.state.read(f);return this._suggestWidgetSelectedItem.get()?g:(v=_==null?void 0:_.inlineCompletion)==null?void 0:v.semanticId});this._register(reactToChangeWithStore(derived(f=>(this._playAccessibilitySignal.read(f),u.read(f),{})),async(f,g,m)=>{const _=this.model.get(),v=_==null?void 0:_.state.get();if(!v||!_)return;const C=_.textModel.getLineContent(v.primaryGhostText.lineNumber);await timeout(50,cancelOnDispose(m)),await waitForState(this._suggestWidgetSelectedItem,isUndefined$1,()=>!1,cancelOnDispose(m)),await this._accessibilitySignalService.playSignal(AccessibilitySignal.inlineSuggestion),this.editor.getOption(8)&&this._provideScreenReaderUpdate(v.primaryGhostText.renderForScreenReader(C))})),this._register(new InlineCompletionsHintsWidget(this.editor,this.model,this._instantiationService)),this._register(createStyleSheetFromObservable(derived(f=>{const g=this._fontFamily.read(f);return g===""||g==="default"?"":` +.monaco-editor .ghost-text-decoration, +.monaco-editor .ghost-text-decoration-preview, +.monaco-editor .ghost-text { + font-family: ${g}; +}`}))),this._register(this._configurationService.onDidChangeConfiguration(f=>{f.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(150)&&(s=localize("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),alert$1(s?e+", "+s:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(s=>e.containsPosition(new Position$1(t.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.ownsViewZone(e))??!1}},InlineCompletionsController_1=Xl,Xl.ID="editor.contrib.inlineCompletionsController",Xl);InlineCompletionsController=InlineCompletionsController_1=__decorate$N([__param$N(1,IInstantiationService),__param$N(2,IContextKeyService),__param$N(3,IConfigurationService),__param$N(4,ICommandService),__param$N(5,ILanguageFeatureDebounceService),__param$N(6,ILanguageFeaturesService),__param$N(7,IAccessibilitySignalService),__param$N(8,IKeybindingService),__param$N(9,IAccessibilityService)],InlineCompletionsController);function convertItemsToStableObservables(n,e){const t=observableValue("result",[]),i=[];return e.add(autorun(s=>{const r=n.read(s);transaction(o=>{if(r.length!==i.length){i.length=r.length;for(let a=0;aa.set(r[l],o))})})),t}const Ig=class Ig extends EditorAction{constructor(){super({id:Ig.ID,label:localize("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,InlineCompletionContextKeys.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var s;const i=InlineCompletionsController.get(t);(s=i==null?void 0:i.model.get())==null||s.next()}};Ig.ID=showNextInlineSuggestionActionId;let ShowNextInlineSuggestionAction=Ig;const Tg=class Tg extends EditorAction{constructor(){super({id:Tg.ID,label:localize("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,InlineCompletionContextKeys.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var s;const i=InlineCompletionsController.get(t);(s=i==null?void 0:i.model.get())==null||s.previous()}};Tg.ID=showPreviousInlineSuggestionActionId;let ShowPreviousInlineSuggestionAction=Tg;class TriggerInlineSuggestionAction extends EditorAction{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:localize("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:EditorContextKeys.writable})}async run(e,t){const i=InlineCompletionsController.get(t);await asyncTransaction(async s=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(s)),i==null||i.playAccessibilitySignal(s)})}}class AcceptNextWordOfInlineCompletion extends EditorAction{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:localize("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,InlineCompletionContextKeys.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:ContextKeyExpr.and(EditorContextKeys.writable,InlineCompletionContextKeys.inlineSuggestionVisible)},menuOpts:[{menuId:MenuId.InlineSuggestionToolbar,title:localize("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var s;const i=InlineCompletionsController.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextWord(i.editor))}}class AcceptNextLineOfInlineCompletion extends EditorAction{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:localize("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:ContextKeyExpr.and(EditorContextKeys.writable,InlineCompletionContextKeys.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:MenuId.InlineSuggestionToolbar,title:localize("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var s;const i=InlineCompletionsController.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextLine(i.editor))}}class AcceptInlineCompletion extends EditorAction{constructor(){super({id:inlineSuggestCommitId,label:localize("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:InlineCompletionContextKeys.inlineSuggestionVisible,menuOpts:[{menuId:MenuId.InlineSuggestionToolbar,title:localize("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:ContextKeyExpr.and(InlineCompletionContextKeys.inlineSuggestionVisible,EditorContextKeys.tabMovesFocus.toNegated(),InlineCompletionContextKeys.inlineSuggestionHasIndentationLessThanTabSize,Context$1.Visible.toNegated(),EditorContextKeys.hoverFocused.toNegated())}})}async run(e,t){var s;const i=InlineCompletionsController.get(t);i&&((s=i.model.get())==null||s.accept(i.editor),i.editor.focus())}}const Dg=class Dg extends EditorAction{constructor(){super({id:Dg.ID,label:localize("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:InlineCompletionContextKeys.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=InlineCompletionsController.get(t);transaction(s=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(s)})}};Dg.ID="editor.action.inlineSuggest.hide";let HideInlineCompletion=Dg;const Ng=class Ng extends Action2{constructor(){super({id:Ng.ID,title:localize("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:MenuId.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:ContextKeyExpr.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e,t){const i=e.get(IConfigurationService),r=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",r)}};Ng.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let ToggleAlwaysShowInlineSuggestionToolbar=Ng;var __decorate$M=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$M=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class InlineCompletionsHover{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let InlineCompletionsHoverParticipant=class{constructor(e,t,i,s,r,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=s,this._instantiationService=r,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=InlineCompletionsController.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new HoverForeignElementAnchor(1e3,this,Range$2.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new HoverForeignElementAnchor(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new HoverForeignElementAnchor(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar!=="onHover")return[];const i=InlineCompletionsController.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new InlineCompletionsHover(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new DisposableStore,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&i.add(this.renderScreenReaderText(e,s));const r=s.controller.model.get(),o=this._instantiationService.createInstance(InlineSuggestionHintsContentWidget,this._editor,!1,constObservable(null),r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands),a=o.getDomNode();e.fragment.appendChild(a),r.triggerExplicitly(),i.add(o);const l={hoverPart:s,hoverElement:a,dispose(){i.dispose()}};return new RenderedHoverParts([l])}renderScreenReaderText(e,t){const i=new DisposableStore,s=$$e,r=s("div.hover-row.markdown-hover"),o=append$1(r,s("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new MarkdownRenderer({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()}));const d=localize("inlineSuggestionFollows","Suggestion:"),u=i.add(a.render(new MarkdownString().appendText(d).appendCodeblock("text",c)));o.replaceChildren(u.element)};return i.add(autorun(c=>{var u;const d=(u=t.controller.model.read(c))==null?void 0:u.primaryGhostText.read(c);if(d){const f=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(f))}else reset$1(o)})),e.fragment.appendChild(r),i}};InlineCompletionsHoverParticipant=__decorate$M([__param$M(1,ILanguageService),__param$M(2,IOpenerService),__param$M(3,IAccessibilityService),__param$M(4,IInstantiationService),__param$M(5,ITelemetryService)],InlineCompletionsHoverParticipant);class InlineCompletionsAccessibleView{}const AccessibleViewRegistry=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};registerEditorContribution(InlineCompletionsController.ID,InlineCompletionsController,3);registerEditorAction(TriggerInlineSuggestionAction);registerEditorAction(ShowNextInlineSuggestionAction);registerEditorAction(ShowPreviousInlineSuggestionAction);registerEditorAction(AcceptNextWordOfInlineCompletion);registerEditorAction(AcceptNextLineOfInlineCompletion);registerEditorAction(AcceptInlineCompletion);registerEditorAction(HideInlineCompletion);registerAction2(ToggleAlwaysShowInlineSuggestionToolbar);HoverParticipantRegistry.register(InlineCompletionsHoverParticipant);AccessibleViewRegistry.register(new InlineCompletionsAccessibleView);const goToDefinitionAtPosition="";var __decorate$L=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$L=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GotoDefinitionAtPositionEditorContribution_1,Na;let GotoDefinitionAtPositionEditorContribution=(Na=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new DisposableStore,this.toUnhookForKeyboard=new DisposableStore,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const r=new ClickLinkGesture(e);this.toUnhook.add(r),this.toUnhook.add(r.onMouseMoveOrRelevantKeyDown(([o,a])=>{this.startFindDefinitionFromMouse(o,a??void 0)})),this.toUnhook.add(r.onExecute(o=>{this.isEnabled(o)&&this.gotoDefinition(o.target.position,o.hasSideBySideModifier).catch(a=>{onUnexpectedError(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(r.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(GotoDefinitionAtPositionEditorContribution_1.ID)}async startFindDefinitionFromCursor(e){await 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)}async startFindDefinition(e){var o;this.toUnhookForKeyboard.clear();const t=e?(o=this.editor.getModel())==null?void 0:o.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new EditorState$1(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=createCancelablePromise(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){onUnexpectedError(a);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?Range$2.lift(s[0].originSelectionRange):new Range$2(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=Range$2.plusRange(a,l));this.addDecoration(a,new MarkdownString().appendText(localize("multipleResults","Click to show {0} definitions.",s.length)))}else{const a=s[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const u=this.getPreviewValue(c,d,a),f=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,u?new MarkdownString().appendCodeblock(f||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=GotoDefinitionAtPositionEditorContribution_1.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let r=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(89)&&!this.isInPeekEditor(i);return new DefinitionAction({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(IContextKeyService);return PeekContext.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},GotoDefinitionAtPositionEditorContribution_1=Na,Na.ID="editor.contrib.gotodefinitionatposition",Na.MAX_SOURCE_PREVIEW_LINES=8,Na);GotoDefinitionAtPositionEditorContribution=GotoDefinitionAtPositionEditorContribution_1=__decorate$L([__param$L(1,ITextModelService),__param$L(2,ILanguageService),__param$L(3,ILanguageFeaturesService)],GotoDefinitionAtPositionEditorContribution);registerEditorContribution(GotoDefinitionAtPositionEditorContribution.ID,GotoDefinitionAtPositionEditorContribution,2);var __decorate$K=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$K=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class MarkerCoordinate{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let MarkerList=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new Emitter$1,this.onDidChange=this._onDidChange.event,this._dispoables=new DisposableStore,this._markers=[],this._nextIdx=-1,URI.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),r=(a,l)=>{let c=compare(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=Range$2.compareRangesUsingStarts(a,l)||MarkerSeverity$1.compare(a.severity,l.severity):c=MarkerSeverity$1.compare(a.severity,l.severity)||Range$2.compareRangesUsingStarts(a,l)),c},o=()=>{this._markers=this._markerService.read({resource:URI.isUri(e)?e:void 0,severities:MarkerSeverity$1.Error|MarkerSeverity$1.Warning|MarkerSeverity$1.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(r)};o(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(o(),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 MarkerCoordinate(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,r=this._markers.findIndex(o=>o.resource.toString()===e.uri.toString());r<0&&(r=binarySearch(this._markers,{resource:e.uri},(o,a)=>compare(o.resource.toString(),a.resource.toString())),r<0&&(r=~r));for(let o=r;os.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$J=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MarkerNavigationWidget_1;class MessageWidget{constructor(e,t,i,s,r){this._openerService=s,this._labelService=r,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new DisposableStore,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(addStandardDisposableListener(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new ScrollableElement(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){dispose(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:r}=e;let o=((t==null?void 0:t.length)||0)+2;r&&(typeof r=="string"?o+=r.length:o+=r.value.length);const a=splitLines(i);this._lines=a.length,this._longestLineLength=0;for(const f of a)this._longestLineLength=Math.max(f.length+o,this._longestLineLength);clearNode(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const f of a)l=document.createElement("div"),l.innerText=f,f===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||r){const f=document.createElement("span");if(f.classList.add("details"),l.appendChild(f),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),f.appendChild(g)}if(r)if(typeof r=="string"){const g=document.createElement("span");g.innerText=`(${r})`,g.classList.add("code"),f.appendChild(g)}else{this._codeLink=$$e("a.code-link"),this._codeLink.setAttribute("href",`${r.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(r.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};const g=append$1(this._codeLink,$$e("span"));g.innerText=r.value,f.appendChild(this._codeLink)}}if(clearNode(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),isNonEmptyArray(s)){const f=this._relatedBlock.appendChild(document.createElement("div"));f.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const g of s){const m=document.createElement("div"),_=document.createElement("a");_.classList.add("filename"),_.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,_.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(_,g);const v=document.createElement("span");v.innerText=g.message,m.appendChild(_),m.appendChild(v),this._lines+=1,f.appendChild(m)}}const c=this._editor.getOption(50),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:u})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case MarkerSeverity$1.Error:t=localize("Error","Error");break;case MarkerSeverity$1.Warning:t=localize("Warning","Warning");break;case MarkerSeverity$1.Info:t=localize("Info","Info");break;case MarkerSeverity$1.Hint:t=localize("Hint","Hint");break}let i=localize("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var Ql;let MarkerNavigationWidget=(Ql=class extends PeekViewWidget{constructor(e,t,i,s,r,o,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},r),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=o,this._labelService=a,this._callOnDispose=new DisposableStore,this._onDidSelectRelatedInformation=new Emitter$1,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=MarkerSeverity$1.Warning,this._backgroundColor=Color.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(editorMarkerNavigationBackground);let t=editorMarkerNavigationError,i=editorMarkerNavigationErrorHeader;this._severity===MarkerSeverity$1.Warning?(t=editorMarkerNavigationWarning,i=editorMarkerNavigationWarningHeader):this._severity===MarkerSeverity$1.Info&&(t=editorMarkerNavigationInfo,i=editorMarkerNavigationInfoHeader);const s=e.getColor(t),r=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:r,primaryHeadingColor:e.getColor(peekViewTitleForeground),secondaryHeadingColor:e.getColor(peekViewTitleInfoForeground)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.getMenuActions(MarkerNavigationWidget_1.TitleMenu,this._contextKeyService);createAndFillInActionBarActions(i,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=append$1(e,$$e(""))}_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 MessageWidget(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=Range$2.lift(e),r=this.editor.getPosition(),o=r&&s.containsPosition(r)?r:s.getStartPosition();super.show(o,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?localize("problems","{0} of {1} problems",t,i):localize("change","{0} of {1} problem",t,i);this.setTitle(basename$1(a.uri),l)}this._icon.className=`codicon ${SeverityIcon.className(MarkerSeverity$1.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,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()}},MarkerNavigationWidget_1=Ql,Ql.TitleMenu=new MenuId("gotoErrorTitleMenu"),Ql);MarkerNavigationWidget=MarkerNavigationWidget_1=__decorate$J([__param$J(1,IThemeService),__param$J(2,IOpenerService),__param$J(3,IMenuService),__param$J(4,IInstantiationService),__param$J(5,IContextKeyService),__param$J(6,ILabelService)],MarkerNavigationWidget);const errorDefault=oneOf(editorErrorForeground,editorErrorBorder),warningDefault=oneOf(editorWarningForeground,editorWarningBorder),infoDefault=oneOf(editorInfoForeground,editorInfoBorder),editorMarkerNavigationError=registerColor("editorMarkerNavigationError.background",{dark:errorDefault,light:errorDefault,hcDark:contrastBorder,hcLight:contrastBorder},localize("editorMarkerNavigationError","Editor marker navigation widget error color.")),editorMarkerNavigationErrorHeader=registerColor("editorMarkerNavigationError.headerBackground",{dark:transparent(editorMarkerNavigationError,.1),light:transparent(editorMarkerNavigationError,.1),hcDark:null,hcLight:null},localize("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),editorMarkerNavigationWarning=registerColor("editorMarkerNavigationWarning.background",{dark:warningDefault,light:warningDefault,hcDark:contrastBorder,hcLight:contrastBorder},localize("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),editorMarkerNavigationWarningHeader=registerColor("editorMarkerNavigationWarning.headerBackground",{dark:transparent(editorMarkerNavigationWarning,.1),light:transparent(editorMarkerNavigationWarning,.1),hcDark:"#0C141F",hcLight:transparent(editorMarkerNavigationWarning,.2)},localize("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),editorMarkerNavigationInfo=registerColor("editorMarkerNavigationInfo.background",{dark:infoDefault,light:infoDefault,hcDark:contrastBorder,hcLight:contrastBorder},localize("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),editorMarkerNavigationInfoHeader=registerColor("editorMarkerNavigationInfo.headerBackground",{dark:transparent(editorMarkerNavigationInfo,.1),light:transparent(editorMarkerNavigationInfo,.1),hcDark:null,hcLight:null},localize("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),editorMarkerNavigationBackground=registerColor("editorMarkerNavigation.background",editorBackground,localize("editorMarkerNavigationBackground","Editor marker navigation widget background."));var __decorate$I=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$I=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MarkerController_1,Zl;let MarkerController=(Zl=class{static get(e){return e.getContribution(MarkerController_1.ID)}constructor(e,t,i,s,r){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=r,this._sessionDispoables=new DisposableStore,this._editor=e,this._widgetVisible=CONTEXT_MARKERS_NAVIGATION_VISIBLE.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(MarkerNavigationWidget,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,r,o;(!((s=this._model)!=null&&s.selected)||!Range$2.containsPosition((r=this._model)==null?void 0:r.selected.marker,i.position))&&((o=this._model)==null||o.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:Range$2.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 Position$1(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,s;if(this._editor.hasModel()){const r=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(r.move(e,this._editor.getModel(),this._editor.getPosition()),!r.selected)return;if(r.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=await this._editorService.openCodeEditor({resource:r.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:r.selected.marker}},this._editor);o&&((i=MarkerController_1.get(o))==null||i.close(),(s=MarkerController_1.get(o))==null||s.nagivate(e,t))}else this._widget.showAtMarker(r.selected.marker,r.selected.index,r.selected.total)}}},MarkerController_1=Zl,Zl.ID="editor.contrib.markerController",Zl);MarkerController=MarkerController_1=__decorate$I([__param$I(1,IMarkerNavigationService),__param$I(2,IContextKeyService),__param$I(3,ICodeEditorService),__param$I(4,IInstantiationService)],MarkerController);class MarkerNavigationAction extends EditorAction{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=MarkerController.get(t))==null||i.nagivate(this._next,this._multiFile))}}const ra=class ra extends MarkerNavigationAction{constructor(){super(!0,!1,{id:ra.ID,label:ra.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:578,weight:100},menuOpts:{menuId:MarkerNavigationWidget.TitleMenu,title:ra.LABEL,icon:registerIcon("marker-navigation-next",Codicon.arrowDown,localize("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};ra.ID="editor.action.marker.next",ra.LABEL=localize("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");let NextMarkerAction=ra;const oa=class oa extends MarkerNavigationAction{constructor(){super(!1,!1,{id:oa.ID,label:oa.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:1602,weight:100},menuOpts:{menuId:MarkerNavigationWidget.TitleMenu,title:oa.LABEL,icon:registerIcon("marker-navigation-previous",Codicon.arrowUp,localize("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};oa.ID="editor.action.marker.prev",oa.LABEL=localize("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");let PrevMarkerAction=oa;class NextMarkerInFilesAction extends MarkerNavigationAction{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:localize("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:EditorContextKeys.focus,primary:66,weight:100},menuOpts:{menuId:MenuId.MenubarGoMenu,title:localize({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class PrevMarkerInFilesAction extends MarkerNavigationAction{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:localize("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:EditorContextKeys.focus,primary:1090,weight:100},menuOpts:{menuId:MenuId.MenubarGoMenu,title:localize({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}registerEditorContribution(MarkerController.ID,MarkerController,4);registerEditorAction(NextMarkerAction);registerEditorAction(PrevMarkerAction);registerEditorAction(NextMarkerInFilesAction);registerEditorAction(PrevMarkerInFilesAction);const CONTEXT_MARKERS_NAVIGATION_VISIBLE=new RawContextKey("markersNavigationVisible",!1),MarkerCommand=EditorCommand.bindToContribution(MarkerController.get);registerEditorCommand(new MarkerCommand({id:"closeMarkersNavigation",precondition:CONTEXT_MARKERS_NAVIGATION_VISIBLE,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}}));var HoverFocusBehavior;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(HoverFocusBehavior||(HoverFocusBehavior={}));class ShowOrFocusHoverAction extends EditorAction{constructor(){super({id:SHOW_OR_FOCUS_HOVER_ACTION_ID,label:localize({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."]},"Show or Focus Hover"),metadata:{description:localize2("showOrFocusHoverDescription","Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[HoverFocusBehavior.NoAutoFocus,HoverFocusBehavior.FocusIfVisible,HoverFocusBehavior.AutoFocusImmediately],enumDescriptions:[localize("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),localize("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),localize("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:HoverFocusBehavior.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:KeyChord(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=ContentHoverController.get(t);if(!s)return;const r=i==null?void 0:i.focus;let o=HoverFocusBehavior.FocusIfVisible;Object.values(HoverFocusBehavior).includes(r)?o=r:typeof r=="boolean"&&r&&(o=HoverFocusBehavior.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),u=new Range$2(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(u,1,1,c)},l=t.getOption(2)===2;s.isHoverVisible?o!==HoverFocusBehavior.NoAutoFocus?s.focus():a(l):a(l||o===HoverFocusBehavior.AutoFocusImmediately)}}class ShowDefinitionPreviewHoverAction extends EditorAction{constructor(){super({id:SHOW_DEFINITION_PREVIEW_HOVER_ACTION_ID,label:localize({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,metadata:{description:localize2("showDefinitionPreviewHoverDescription","Show the definition preview hover in the editor.")}})}run(e,t){const i=ContentHoverController.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const r=new Range$2(s.lineNumber,s.column,s.lineNumber,s.column),o=GotoDefinitionAtPositionEditorContribution.get(t);if(!o)return;o.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(r,1,1,!0)})}}class ScrollUpHoverAction extends EditorAction{constructor(){super({id:SCROLL_UP_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:16,weight:100},metadata:{description:localize2("scrollUpHoverDescription","Scroll up the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.scrollUp()}}class ScrollDownHoverAction extends EditorAction{constructor(){super({id:SCROLL_DOWN_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:18,weight:100},metadata:{description:localize2("scrollDownHoverDescription","Scroll down the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.scrollDown()}}class ScrollLeftHoverAction extends EditorAction{constructor(){super({id:SCROLL_LEFT_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:15,weight:100},metadata:{description:localize2("scrollLeftHoverDescription","Scroll left the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.scrollLeft()}}class ScrollRightHoverAction extends EditorAction{constructor(){super({id:SCROLL_RIGHT_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:17,weight:100},metadata:{description:localize2("scrollRightHoverDescription","Scroll right the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.scrollRight()}}class PageUpHoverAction extends EditorAction{constructor(){super({id:PAGE_UP_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:localize2("pageUpHoverDescription","Page up the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.pageUp()}}class PageDownHoverAction extends EditorAction{constructor(){super({id:PAGE_DOWN_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:localize2("pageDownHoverDescription","Page down the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.pageDown()}}class GoToTopHoverAction extends EditorAction{constructor(){super({id:GO_TO_TOP_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:localize2("goToTopHoverDescription","Go to the top of the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.goToTop()}}class GoToBottomHoverAction extends EditorAction{constructor(){super({id:GO_TO_BOTTOM_HOVER_ACTION_ID,label:localize({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:EditorContextKeys.hoverFocused,kbOpts:{kbExpr:EditorContextKeys.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:localize2("goToBottomHoverDescription","Go to the bottom of the editor hover.")}})}run(e,t){const i=ContentHoverController.get(t);i&&i.goToBottom()}}class IncreaseHoverVerbosityLevel extends EditorAction{constructor(){super({id:INCREASE_HOVER_VERBOSITY_ACTION_ID,label:INCREASE_HOVER_VERBOSITY_ACTION_LABEL,alias:"Increase Hover Verbosity Level",precondition:EditorContextKeys.hoverVisible})}run(e,t,i){const s=ContentHoverController.get(t);if(!s)return;const r=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();s.updateHoverVerbosityLevel(HoverVerbosityAction$1.Increase,r,i==null?void 0:i.focus)}}class DecreaseHoverVerbosityLevel extends EditorAction{constructor(){super({id:DECREASE_HOVER_VERBOSITY_ACTION_ID,label:DECREASE_HOVER_VERBOSITY_ACTION_LABEL,alias:"Decrease Hover Verbosity Level",precondition:EditorContextKeys.hoverVisible})}run(e,t,i){var o;const s=ContentHoverController.get(t);if(!s)return;const r=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();(o=ContentHoverController.get(t))==null||o.updateHoverVerbosityLevel(HoverVerbosityAction$1.Decrease,r,i==null?void 0:i.focus)}}var __decorate$H=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$H=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $$2=$$e;class MarkerHover{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 markerCodeActionTrigger={type:1,filter:{include:CodeActionKind.QuickFix},triggerAction:CodeActionTriggerSource.QuickFixHover};let MarkerHoverParticipant=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,r=i.getLineMaxColumn(s),o=[];for(const a of t){const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:r,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new Range$2(e.range.startLineNumber,l,e.range.startLineNumber,c);o.push(new MarkerHover(this,u,d))}return o}renderHoverParts(e,t){if(!t.length)return new RenderedHoverParts([]);const i=new DisposableStore,s=[];t.forEach(o=>{const a=this._renderMarkerHover(o);e.fragment.appendChild(a.hoverElement),s.push(a)});const r=t.length===1?t[0]:t.sort((o,a)=>MarkerSeverity$1.compare(o.marker.severity,a.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),new RenderedHoverParts(s)}_renderMarkerHover(e){const t=new DisposableStore,i=$$2("div.hover-row"),s=append$1(i,$$2("div.marker.hover-contents")),{source:r,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=append$1(s,$$2("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=o,r||a)if(a&&typeof a!="string"){const u=$$2("span");if(r){const _=append$1(u,$$2("span"));_.innerText=r}const f=append$1(u,$$2("a.code-link"));f.setAttribute("href",a.target.toString()),t.add(addDisposableListener(f,"click",_=>{this._openerService.open(a.target,{allowCommands:!0}),_.preventDefault(),_.stopPropagation()}));const g=append$1(f,$$2("span"));g.innerText=a.value;const m=append$1(s,u);m.style.opacity="0.6",m.style.paddingLeft="6px"}else{const u=append$1(s,$$2("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=r&&a?`${r}(${a})`:r||`(${a})`}if(isNonEmptyArray(l))for(const{message:u,resource:f,startLineNumber:g,startColumn:m}of l){const _=append$1(s,$$2("div"));_.style.marginTop="8px";const v=append$1(_,$$2("a"));v.innerText=`${basename$1(f)}(${g}, ${m}): `,v.style.cursor="pointer",t.add(addDisposableListener(v,"click",S=>{if(S.stopPropagation(),S.preventDefault(),this._openerService){const w={selection:{startLineNumber:g,startColumn:m}};this._openerService.open(f,{fromUserGesture:!0,editorOptions:w}).catch(onUnexpectedError)}}));const C=append$1(_,$$2("span"));C.innerText=u,this._editor.applyFontInfo(C)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}renderMarkerStatusbar(e,t,i){if(t.marker.severity===MarkerSeverity$1.Error||t.marker.severity===MarkerSeverity$1.Warning||t.marker.severity===MarkerSeverity$1.Info){const s=MarkerController.get(this._editor);s&&e.statusBar.addAction({label:localize("view problem","View Problem"),commandId:NextMarkerAction.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(92)){const s=e.statusBar.append($$2("div"));this.recentMarkerCodeActionsInfo&&(IMarkerData.makeKey(this.recentMarkerCodeActionsInfo.marker)===IMarkerData.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=localize("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const r=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Disposable.None:disposableTimeout(()=>s.textContent=localize("checkingForQuickFixes","Checking for quick fixes..."),200,i);s.textContent||(s.textContent=String.fromCharCode(160));const o=this.getCodeActions(t.marker);i.add(toDisposable(()=>o.cancel())),o.then(a=>{if(r.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=localize("noQuickFixes","No quick fixes available");return}s.style.display="none";let l=!1;i.add(toDisposable(()=>{l||a.dispose()})),e.statusBar.addAction({label:localize("quick fixes","Quick Fix..."),commandId:quickFixCommandId,run:c=>{l=!0;const d=CodeActionController.get(this._editor),u=getDomNodePagePosition(c);e.hide(),d==null||d.showCodeActions(markerCodeActionTrigger,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},onUnexpectedError)}}getCodeActions(e){return createCancelablePromise(t=>getCodeActions(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new Range$2(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),markerCodeActionTrigger,Progress.None,t))}};MarkerHoverParticipant=__decorate$H([__param$H(1,IMarkerDecorationsService),__param$H(2,IOpenerService),__param$H(3,ILanguageFeaturesService)],MarkerHoverParticipant);class MarginHoverComputer{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=GlyphMarginLane.Center}computeSync(){var r;const e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[],s=this._laneOrLine==="lineNo";if(!t)return i;for(const o of t){const a=((r=o.options.glyphMargin)==null?void 0:r.position)??GlyphMarginLane.Center;if(!s&&a!==this._laneOrLine)continue;const l=s?o.options.lineNumberHoverMessage:o.options.glyphMarginHoverMessage;!l||isEmptyMarkdownString(l)||i.push(...asArray(l).map(e))}return i}}var __decorate$G=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$G=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},MarginHoverWidget_1;const $$1=$$e;var Jl;let MarginHoverWidget=(Jl=class extends Disposable{constructor(e,t,i){super(),this._renderDisposeables=this._register(new DisposableStore),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new HoverWidget$1),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new MarkdownRenderer({editor:this._editor},t,i)),this._computer=new MarginHoverComputer(this._editor),this._hoverOperation=this._register(new HoverOperation(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._register(addStandardDisposableListener(this._hover.containerDomNode,"mouseleave",s=>{this._onMouseLeave(s)})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return MarginHoverWidget_1.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))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const s of t){const r=$$1("div.hover-row.markdown-hover"),o=append$1(r,$$1("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));o.appendChild(a.element),i.appendChild(r)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),s=this._editor.getScrollTop(),r=this._editor.getOption(67),o=this._hover.containerDomNode.clientHeight,a=i-s-(o-r)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!isMousePositionWithinElement(t,e.x,e.y))&&this.hide()}},MarginHoverWidget_1=Jl,Jl.ID="editor.contrib.modesGlyphHoverWidget",Jl);MarginHoverWidget=MarginHoverWidget_1=__decorate$G([__param$G(1,ILanguageService),__param$G(2,IOpenerService)],MarginHoverWidget);var __decorate$F=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$F=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pu;let MarginHoverController=(pu=class extends Disposable{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new DisposableStore,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new RunOnceScheduler(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnMarginHoverWidget(e)&&this._hideWidgets()}_isMouseOnMarginHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?isMousePositionWithinElement(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnMarginHoverWidget(e))||this._hideWidgets()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnMarginHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this._hideWidgets()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this._hideWidgets())}_hideWidgets(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(MarginHoverWidget,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},pu.ID="editor.contrib.marginHover",pu);MarginHoverController=__decorate$F([__param$F(1,IInstantiationService)],MarginHoverController);class HoverAccessibleView{}class HoverAccessibilityHelp{}class ExtHoverAccessibleView{}registerEditorContribution(ContentHoverController.ID,ContentHoverController,2);registerEditorContribution(MarginHoverController.ID,MarginHoverController,2);registerEditorAction(ShowOrFocusHoverAction);registerEditorAction(ShowDefinitionPreviewHoverAction);registerEditorAction(ScrollUpHoverAction);registerEditorAction(ScrollDownHoverAction);registerEditorAction(ScrollLeftHoverAction);registerEditorAction(ScrollRightHoverAction);registerEditorAction(PageUpHoverAction);registerEditorAction(PageDownHoverAction);registerEditorAction(GoToTopHoverAction);registerEditorAction(GoToBottomHoverAction);registerEditorAction(IncreaseHoverVerbosityLevel);registerEditorAction(DecreaseHoverVerbosityLevel);HoverParticipantRegistry.register(MarkdownHoverParticipant);HoverParticipantRegistry.register(MarkerHoverParticipant);registerThemingParticipant((n,e)=>{const t=n.getColor(editorHoverBorder);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)}; }`))});AccessibleViewRegistry.register(new HoverAccessibleView);AccessibleViewRegistry.register(new HoverAccessibilityHelp);AccessibleViewRegistry.register(new ExtHoverAccessibleView);function getSpaceCnt(n,e){let t=0;for(let i=0;ii-1)return[];const{tabSize:o,indentSize:a,insertSpaces:l}=n.getOptions(),c=(_,v)=>(v=v||1,ShiftCommand.shiftIndent(_,_.length+v,o,a,l)),d=(_,v)=>(v=v||1,ShiftCommand.unshiftIndent(_,_.length+v,o,a,l)),u=[],f=n.getLineContent(t);let g=getLeadingWhitespace(f),m=g;r.shouldIncrease(t)?(m=c(m),g=c(g)):r.shouldIndentNextLine(t)&&(m=c(m)),t++;for(let _=t;_<=i;_++){if(doesLineStartWithString(n,_))continue;const v=n.getLineContent(_),C=getLeadingWhitespace(v),S=m;r.shouldDecrease(_,S)&&(m=d(m),g=d(g)),C!==m&&u.push(EditOperation.replaceMove(new Selection$1(_,1,_,C.length+1),normalizeIndentation(m,a,l))),!r.shouldIgnore(_)&&(r.shouldIncrease(_,S)?(g=c(g),m=g):r.shouldIndentNextLine(_,S)?m=c(m):m=g)}return u}function doesLineStartWithString(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var __decorate$E=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$E=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Ag=class Ag extends EditorAction{constructor(){super({id:Ag.ID,label:localize("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:EditorContextKeys.writable,metadata:{description:localize2("indentationToSpacesDescription","Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),r=t.getSelection();if(!r)return;const o=new IndentationToSpacesCommand(r,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};Ag.ID="editor.action.indentationToSpaces";let IndentationToSpacesAction=Ag;const Rg=class Rg extends EditorAction{constructor(){super({id:Rg.ID,label:localize("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:EditorContextKeys.writable,metadata:{description:localize2("indentationToTabsDescription","Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),r=t.getSelection();if(!r)return;const o=new IndentationToTabsCommand(r,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};Rg.ID="editor.action.indentationToTabs";let IndentationToTabsAction=Rg;class ChangeIndentationSizeAction extends EditorAction{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(IQuickInputService),s=e.get(IModelService),r=t.getModel();if(!r)return;const o=s.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget),a=r.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===o.tabSize&&d===a.tabSize?localize("configuredTabSize","Configured Tab Size"):d===o.tabSize?localize("defaultTabSize","Default Tab Size"):d===a.tabSize?localize("currentTabSize","Current Tab Size"):void 0})),c=Math.min(r.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:localize({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&r&&!r.isDisposed()){const u=parseInt(d.label,10);this.displaySizeOnly?r.updateOptions({tabSize:u}):r.updateOptions({tabSize:u,indentSize:u,insertSpaces:this.insertSpaces})}})},50)}}const Pg=class Pg extends ChangeIndentationSizeAction{constructor(){super(!1,!1,{id:Pg.ID,label:localize("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0,metadata:{description:localize2("indentUsingTabsDescription","Use indentation with tabs.")}})}};Pg.ID="editor.action.indentUsingTabs";let IndentUsingTabs=Pg;const Mg=class Mg extends ChangeIndentationSizeAction{constructor(){super(!0,!1,{id:Mg.ID,label:localize("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0,metadata:{description:localize2("indentUsingSpacesDescription","Use indentation with spaces.")}})}};Mg.ID="editor.action.indentUsingSpaces";let IndentUsingSpaces=Mg;const Og=class Og extends ChangeIndentationSizeAction{constructor(){super(!0,!0,{id:Og.ID,label:localize("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0,metadata:{description:localize2("changeTabDisplaySizeDescription","Change the space size equivalent of the tab.")}})}};Og.ID="editor.action.changeTabDisplaySize";let ChangeTabDisplaySize=Og;const $g=class $g extends EditorAction{constructor(){super({id:$g.ID,label:localize("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0,metadata:{description:localize2("detectIndentationDescription","Detect the indentation from content.")}})}run(e,t){const i=e.get(IModelService),s=t.getModel();if(!s)return;const r=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(r.insertSpaces,r.tabSize)}};$g.ID="editor.action.detectIndentation";let DetectIndentation=$g;class ReindentLinesAction extends EditorAction{constructor(){super({id:"editor.action.reindentlines",label:localize("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:EditorContextKeys.writable,metadata:{description:localize2("editor.reindentlinesDescription","Reindent the lines of the editor.")}})}run(e,t){const i=e.get(ILanguageConfigurationService),s=t.getModel();if(!s)return;const r=getReindentEditOperations(s,i,1,s.getLineCount());r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class ReindentSelectedLinesAction extends EditorAction{constructor(){super({id:"editor.action.reindentselectedlines",label:localize("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:EditorContextKeys.writable,metadata:{description:localize2("editor.reindentselectedlinesDescription","Reindent the selected lines of the editor.")}})}run(e,t){const i=e.get(ILanguageConfigurationService),s=t.getModel();if(!s)return;const r=t.getSelections();if(r===null)return;const o=[];for(const a of r){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=getReindentEditOperations(s,i,l,c);o.push(...d)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class AutoIndentOnPasteCommand{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(Range$2.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var mu;let AutoIndentOnPaste=(mu=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new DisposableStore,this.callOnModel=new DisposableStore,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(this.editor.getOption(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||isStartOrEndInString(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],d={shiftIndent:m=>ShiftCommand.shiftIndent(m,m.length+1,o,a,l),unshiftIndent:m=>ShiftCommand.unshiftIndent(m,m.length+1,o,a,l)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(i,u)){u++;continue}break}if(u>e.endLineNumber)return;let f=i.getLineContent(u);if(!/\S/.test(f.substring(0,e.startColumn-1))){const m=getGoodIndentForLine(r,i,i.getLanguageId(),u,d,this._languageConfigurationService);if(m!==null){const _=getLeadingWhitespace(f),v=getSpaceCnt(m,o),C=getSpaceCnt(_,o);if(v!==C){const S=generateIndent(v,o,l);c.push({range:new Range$2(u,1,u,_.length+1),text:S}),f=S+f.substring(_.length)}else{const S=getIndentMetadata(i,u,this._languageConfigurationService);if(S===0||S===8)return}}}const g=u;for(;ui.tokenization.getLineTokens(v),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(v,C)=>i.getLanguageIdAtPosition(v,C)},getLineContent:v=>v===g?f:i.getLineContent(v)},i.getLanguageId(),u+1,d,this._languageConfigurationService);if(_!==null){const v=getSpaceCnt(_,o),C=getSpaceCnt(getLeadingWhitespace(i.getLineContent(u+1)),o);if(v!==C){const S=v-C;for(let w=u+1;w<=e.endLineNumber;w++){const L=i.getLineContent(w),I=getLeadingWhitespace(L),R=getSpaceCnt(I,o)+S,T=generateIndent(R,o,l);T!==I&&c.push({range:new Range$2(w,1,w,I.length+1),text:T})}}}}if(c.length>0){this.editor.pushUndoStop();const m=new AutoIndentOnPasteCommand(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",m),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=r=>r.trim().length===0;let s=!0;if(t.startLineNumber===t.endLineNumber){const o=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);s=i(o)}else for(let r=t.startLineNumber;r<=t.endLineNumber;r++){const o=e.getLineContent(r);if(r===t.startLineNumber){const a=o.substring(t.startColumn-1);s=i(a)}else if(r===t.endLineNumber){const a=o.substring(0,t.endColumn-1);s=i(a)}else s=e.getLineFirstNonWhitespaceColumn(r)===0;if(!s)break}return s}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const s=e.tokenization.getLineTokens(t);if(s.getCount()>0){const r=s.findTokenIndexAtOffset(i);if(r>=0&&s.getStandardTokenType(r)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},mu.ID="editor.contrib.autoIndentOnPaste",mu);AutoIndentOnPaste=__decorate$E([__param$E(1,ILanguageConfigurationService)],AutoIndentOnPaste);function isStartOrEndInString(n,e){const t=i=>getStandardTokenTypeAtPosition(n,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function getIndentationEditOperations(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let o=0;o=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$D=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InPlaceReplaceController_1,Aa;let InPlaceReplaceController=(Aa=class{static get(e){return e.getContribution(InPlaceReplaceController_1.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),s=this.editor.getModel();if(!s||!i)return;let r=i;if(r.startLineNumber!==r.endLineNumber)return;const o=new EditorState$1(this.editor,5),a=s.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=createCancelablePromise(c=>this.editorWorkerService.navigateValueSet(a,r,t)),this.currentRequest.then(c=>{var m;if(!c||!c.range||!c.value||!o.validate(this.editor))return;const d=Range$2.lift(c.range);let u=c.range;const f=c.value.length-(r.endColumn-r.startColumn);u={startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.startColumn+c.value.length},f>1&&(r=new Selection$1(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+f-1));const g=new InPlaceReplaceCommand(d,r,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,g),this.editor.pushUndoStop(),this.decorations.set([{range:u,options:InPlaceReplaceController_1.DECORATION}]),(m=this.decorationRemover)==null||m.cancel(),this.decorationRemover=timeout(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(onUnexpectedError)}).catch(onUnexpectedError)):Promise.resolve(void 0)}},InPlaceReplaceController_1=Aa,Aa.ID="editor.contrib.inPlaceReplaceController",Aa.DECORATION=ModelDecorationOptions.register({description:"in-place-replace",className:"valueSetReplacement"}),Aa);InPlaceReplaceController=InPlaceReplaceController_1=__decorate$D([__param$D(1,IEditorWorkerService)],InPlaceReplaceController);class InPlaceReplaceUp extends EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.up",label:localize("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=InPlaceReplaceController.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class InPlaceReplaceDown extends EditorAction{constructor(){super({id:"editor.action.inPlaceReplace.down",label:localize("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=InPlaceReplaceController.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}registerEditorContribution(InPlaceReplaceController.ID,InPlaceReplaceController,4);registerEditorAction(InPlaceReplaceUp);registerEditorAction(InPlaceReplaceDown);class ExpandLineSelectionAction extends EditorAction{constructor(){super({id:"expandLineSelection",label:localize("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:EditorContextKeys.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,3,CursorMoveCommands.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}registerEditorAction(ExpandLineSelectionAction);class TrimTrailingWhitespaceCommand{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=trimTrailingWhitespace(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,r=i.length;sa.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,r=0;const o=e.length;for(let a=1,l=n.getLineCount();a<=l;a++){const c=n.getLineContent(a),d=c.length+1;let u=0;if(r=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$C=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let MoveLinesCommand=class{constructor(e,t,i,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),s=(u,f)=>e.getLanguageIdAtPosition(u,f),r=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===r){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let o=this._selection;o.startLineNumberS===o.startLineNumber?e.tokenization.getLineTokens(u):e.tokenization.getLineTokens(S),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:S=>S===o.startLineNumber?e.getLineContent(u):e.getLineContent(S)},C=getGoodIndentForLine(this._autoIndent,v,e.getLanguageIdAtPosition(u,1),o.startLineNumber,d,this._languageConfigurationService);if(C!==null){const S=getLeadingWhitespace(e.getLineContent(u)),w=getSpaceCnt(C,a),L=getSpaceCnt(S,a);w!==L&&(g=generateIndent(w,a,c)+this.trimStart(f))}}t.addEditOperation(new Range$2(o.startLineNumber,1,o.startLineNumber,1),g+` +`);const _=this.matchEnterRuleMovingDown(e,d,a,o.startLineNumber,u,g);if(_!==null)_!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,c,_);else{const v={tokenization:{getLineTokens:S=>S===o.startLineNumber?e.tokenization.getLineTokens(u):S>=o.startLineNumber+1&&S<=o.endLineNumber+1?e.tokenization.getLineTokens(S-1):e.tokenization.getLineTokens(S),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:S=>S===o.startLineNumber?g:S>=o.startLineNumber+1&&S<=o.endLineNumber+1?e.getLineContent(S-1):e.getLineContent(S)},C=getGoodIndentForLine(this._autoIndent,v,e.getLanguageIdAtPosition(u,1),o.startLineNumber+1,d,this._languageConfigurationService);if(C!==null){const S=getLeadingWhitespace(e.getLineContent(o.startLineNumber)),w=getSpaceCnt(C,a),L=getSpaceCnt(S,a);if(w!==L){const I=w-L;this.getIndentEditsOfMovingBlock(e,t,o,a,c,I)}}}}else t.addEditOperation(new Range$2(o.startLineNumber,1,o.startLineNumber,1),g+` +`)}else if(u=o.startLineNumber-1,f=e.getLineContent(u),t.addEditOperation(new Range$2(u,1,u+1,1),null),t.addEditOperation(new Range$2(o.endLineNumber,e.getLineMaxColumn(o.endLineNumber),o.endLineNumber,e.getLineMaxColumn(o.endLineNumber)),` +`+f),this.shouldAutoIndent(e,o)){const g={tokenization:{getLineTokens:_=>_===u?e.tokenization.getLineTokens(o.startLineNumber):e.tokenization.getLineTokens(_),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:_=>_===u?e.getLineContent(o.startLineNumber):e.getLineContent(_)},m=this.matchEnterRule(e,d,a,o.startLineNumber,o.startLineNumber-2);if(m!==null)m!==0&&this.getIndentEditsOfMovingBlock(e,t,o,a,c,m);else{const _=getGoodIndentForLine(this._autoIndent,g,e.getLanguageIdAtPosition(o.startLineNumber,1),u,d,this._languageConfigurationService);if(_!==null){const v=getLeadingWhitespace(e.getLineContent(o.startLineNumber)),C=getSpaceCnt(_,a),S=getSpaceCnt(v,a);if(C!==S){const w=C-S;this.getIndentEditsOfMovingBlock(e,t,o,a,c,w)}}}}}this._selectionId=t.trackSelection(o)}buildIndentConverter(e,t,i){return{shiftIndent:s=>ShiftCommand.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>ShiftCommand.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,r){if(r){let o=r.indentation;r.indentAction===IndentAction.None||r.indentAction===IndentAction.Indent?o=r.indentation+r.appendText:r.indentAction===IndentAction.IndentOutdent?o=r.indentation:r.indentAction===IndentAction.Outdent&&(o=t.unshiftIndent(r.indentation)+r.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(o))>=0){const l=getLeadingWhitespace(e.getLineContent(s));let c=getLeadingWhitespace(o);const d=getIndentMetadata(e,s,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const u=getSpaceCnt(c,i),f=getSpaceCnt(l,i);return u-f}}return null}matchEnterRuleMovingDown(e,t,i,s,r,o){if(lastNonWhitespaceIndex(o)>=0){const a=e.getLineMaxColumn(r),l=getEnterAction(this._autoIndent,e,new Range$2(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(lastNonWhitespaceIndex(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=getEnterAction(this._autoIndent,e,new Range$2(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}}matchEnterRule(e,t,i,s,r,o){let a=r;for(;a>=1;){let d;if(a===r&&o!==void 0?d=o:d=e.getLineContent(a),lastNonWhitespaceIndex(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=getEnterAction(this._autoIndent,e,new Range$2(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,s,r,o){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=getLeadingWhitespace(l),u=getSpaceCnt(c,s)+o,f=generateIndent(u,s,r);f!==c&&(t.addEditOperation(new Range$2(a,1,a,c.length+1),f),a===i.endLineNumber&&i.endColumn<=c.length+1&&f===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const r=[];for(let a=i;a<=s;a++)r.push(n.getLineContent(a));let o=r.slice(0);return o.sort(SortLinesCommand.getCollator().compare),t===!0&&(o=o.reverse()),{startLineNumber:i,endLineNumber:s,before:r,after:o}}function sortLines(n,e,t){const i=getSortData(n,e,t);return i?EditOperation.replace(new Range$2(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` +`)):null}class AbstractCopyLinesAction extends EditorAction{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((o,a)=>({selection:o,index:a,ignore:!1}));i.sort((o,a)=>Range$2.compareRangesUsingStarts(o.selection,a.selection));let s=i[0];for(let o=1;onew Position$1(d.positionLineNumber,d.positionColumn)));const r=t.getSelection();if(r===null)return;const o=e.get(IConfigurationService),a=t.getModel(),l=o.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),c=new TrimTrailingWhitespaceCommand(r,s,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};Fg.ID="editor.action.trimTrailingWhitespace";let TrimTrailingWhitespaceAction=Fg;class DeleteLinesAction extends EditorAction{constructor(){super({id:"editor.action.deleteLines",label:localize("lines.delete","Delete Line"),alias:"Delete Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let r=0;const o=[],a=[];for(let l=0,c=i.length;l1&&(u-=1,g=s.getLineMaxColumn(u)),o.push(EditOperation.replace(new Selection$1(u,g,f,m),"")),a.push(new Selection$1(u-r,d.positionColumn,u-r,d.positionColumn)),r+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(r=>{let o=r.endLineNumber;return r.startLineNumberr.startLineNumber===o.startLineNumber?r.endLineNumber-o.endLineNumber:r.startLineNumber-o.startLineNumber);const i=[];let s=t[0];for(let r=1;r=t[r].startLineNumber?s.endLineNumber=t[r].endLineNumber:(i.push(s),s=t[r]);return i.push(s),i}}class IndentLinesAction extends EditorAction{constructor(){super({id:"editor.action.indentLines",label:localize("lines.indent","Indent Line"),alias:"Indent Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,TypeOperations.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class OutdentLinesAction extends EditorAction{constructor(){super({id:"editor.action.outdentLines",label:localize("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2140,weight:100}})}run(e,t){CoreEditingCommands.Outdent.runEditorCommand(e,t,null)}}class InsertLineBeforeAction extends EditorAction{constructor(){super({id:"editor.action.insertLineBefore",label:localize("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,EnterOperation.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class InsertLineAfterAction extends EditorAction{constructor(){super({id:"editor.action.insertLineAfter",label:localize("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,EnterOperation.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class AbstractDeleteAllToBoundaryAction extends EditorAction{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),r=[];for(let l=0,c=s.length-1;lEditOperation.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class DeleteAllLeftAction extends AbstractDeleteAllToBoundaryAction{constructor(){super({id:"deleteAllLeft",label:localize("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];let r=0;return t.forEach(o=>{let a;if(o.endColumn===1&&r>0){const l=o.startLineNumber-r;a=new Selection$1(l,o.startColumn,l,o.startColumn)}else a=new Selection$1(o.startLineNumber,o.startColumn,o.startLineNumber,o.startColumn);r+=o.endLineNumber-o.startLineNumber,o.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(Range$2.compareRangesUsingStarts),i=i.map(r=>{if(r.isEmpty())if(r.startColumn===1){const o=Math.max(1,r.startLineNumber-1),a=r.startLineNumber===1?1:s.getLineLength(o)+1;return new Range$2(o,a,r.startLineNumber,1)}else return new Range$2(r.startLineNumber,1,r.startLineNumber,r.startColumn);else return new Range$2(r.startLineNumber,1,r.endLineNumber,r.endColumn)}),i)}}class DeleteAllRightAction extends AbstractDeleteAllToBoundaryAction{constructor(){super({id:"deleteAllRight",label:localize("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const s=[];for(let r=0,o=t.length,a=0;r{if(r.isEmpty()){const o=t.getLineMaxColumn(r.startLineNumber);return r.startColumn===o?new Range$2(r.startLineNumber,r.startColumn,r.startLineNumber+1,1):new Range$2(r.startLineNumber,r.startColumn,r.startLineNumber,o)}return r});return s.sort(Range$2.compareRangesUsingStarts),s}}class JoinLinesAction extends EditorAction{constructor(){super({id:"editor.action.joinLines",label:localize("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(Range$2.compareRangesUsingStarts);const r=[],o=i.reduce((f,g)=>f.isEmpty()?f.endLineNumber===g.startLineNumber?(s.equalsSelection(f)&&(s=g),g):g.startLineNumber>f.endLineNumber+1?(r.push(f),g):new Selection$1(f.startLineNumber,f.startColumn,g.endLineNumber,g.endColumn):g.startLineNumber>f.endLineNumber?(r.push(f),g):new Selection$1(f.startLineNumber,f.startColumn,g.endLineNumber,g.endColumn));r.push(o);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=s,u=0;for(let f=0,g=r.length;f=1){let F=!0;I===""&&(F=!1),F&&(I.charAt(I.length-1)===" "||I.charAt(I.length-1)===" ")&&(F=!1,I=I.replace(/[\s\uFEFF\xA0]+$/g," "));const B=T.substr(A-1);I+=(F?" ":"")+B,F?C=B.length+1:C=B.length}else C=0}const N=new Range$2(_,v,S,w);if(!N.isEmpty()){let R;m.isEmpty()?(l.push(EditOperation.replace(N,I)),R=new Selection$1(N.startLineNumber-u,I.length-C+1,_-u,I.length-C+1)):m.startLineNumber===m.endLineNumber?(l.push(EditOperation.replace(N,I)),R=new Selection$1(m.startLineNumber-u,m.startColumn,m.endLineNumber-u,m.endColumn)):(l.push(EditOperation.replace(N,I)),R=new Selection$1(m.startLineNumber-u,m.startColumn,m.startLineNumber-u,I.length-L)),Range$2.intersectRanges(N,s)!==null?d=R:c.push(R)}u+=N.endLineNumber-N.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class TransposeAction extends EditorAction{constructor(){super({id:"editor.action.transpose",label:localize("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:EditorContextKeys.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const r=[];for(let o=0,a=i.length;o=d){if(c.lineNumber===s.getLineCount())continue;const u=new Range$2(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),f=s.getValueInRange(u).split("").reverse().join("");r.push(new ReplaceCommand(new Selection$1(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),f))}else{const u=new Range$2(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),f=s.getValueInRange(u).split("").reverse().join("");r.push(new ReplaceCommandThatPreservesSelection(u,f,new Selection$1(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class AbstractCaseAction extends EditorAction{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const r=t.getOption(132),o=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new Range$2(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),u=s.getValueInRange(d);o.push(EditOperation.replace(d,this._modifyText(u,r)))}else{const l=s.getValueInRange(a);o.push(EditOperation.replace(a,this._modifyText(l,r)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class UpperCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToUppercase",label:localize("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:EditorContextKeys.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class LowerCaseAction extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToLowercase",label:localize("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:EditorContextKeys.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class BackwardsCompatibleRegExp{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const Bg=class Bg extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToTitlecase",label:localize("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const i=Bg.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};Bg.titleBoundary=new BackwardsCompatibleRegExp("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let TitleCaseAction=Bg;const _l=class _l extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToSnakecase",label:localize("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const i=_l.caseBoundary.get(),s=_l.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};_l.caseBoundary=new BackwardsCompatibleRegExp("(\\p{Ll})(\\p{Lu})","gmu"),_l.singleLetters=new BackwardsCompatibleRegExp("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let SnakeCaseAction=_l;const Vg=class Vg extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToCamelcase",label:localize("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const i=Vg.wordBoundary.get();if(!i)return e;const s=e.split(i);return s.shift()+s.map(o=>o.substring(0,1).toLocaleUpperCase()+o.substring(1)).join("")}};Vg.wordBoundary=new BackwardsCompatibleRegExp("[_\\s-]","gm");let CamelCaseAction=Vg;const bl=class bl extends AbstractCaseAction{constructor(){super({id:"editor.action.transformToPascalcase",label:localize("editor.transformToPascalcase","Transform to Pascal Case"),alias:"Transform to Pascal Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const i=bl.wordBoundary.get(),s=bl.wordBoundaryToMaintain.get();return!i||!s?e:e.split(s).map(a=>a.split(i)).flat().map(a=>a.substring(0,1).toLocaleUpperCase()+a.substring(1)).join("")}};bl.wordBoundary=new BackwardsCompatibleRegExp("[_\\s-]","gm"),bl.wordBoundaryToMaintain=new BackwardsCompatibleRegExp("(?<=\\.)","gm");let PascalCaseAction=bl;const fo=class fo extends AbstractCaseAction{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:localize("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:EditorContextKeys.writable})}_modifyText(e,t){const i=fo.caseBoundary.get(),s=fo.singleLetters.get(),r=fo.underscoreBoundary.get();return!i||!s||!r?e:e.replace(r,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};fo.caseBoundary=new BackwardsCompatibleRegExp("(\\p{Ll})(\\p{Lu})","gmu"),fo.singleLetters=new BackwardsCompatibleRegExp("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),fo.underscoreBoundary=new BackwardsCompatibleRegExp("(\\S)(_)(\\S)","gm");let KebabCaseAction=fo;registerEditorAction(CopyLinesUpAction);registerEditorAction(CopyLinesDownAction);registerEditorAction(DuplicateSelectionAction);registerEditorAction(MoveLinesUpAction);registerEditorAction(MoveLinesDownAction);registerEditorAction(SortLinesAscendingAction);registerEditorAction(SortLinesDescendingAction);registerEditorAction(DeleteDuplicateLinesAction);registerEditorAction(TrimTrailingWhitespaceAction);registerEditorAction(DeleteLinesAction);registerEditorAction(IndentLinesAction);registerEditorAction(OutdentLinesAction);registerEditorAction(InsertLineBeforeAction);registerEditorAction(InsertLineAfterAction);registerEditorAction(DeleteAllLeftAction);registerEditorAction(DeleteAllRightAction);registerEditorAction(JoinLinesAction);registerEditorAction(TransposeAction);registerEditorAction(UpperCaseAction);registerEditorAction(LowerCaseAction);SnakeCaseAction.caseBoundary.isSupported()&&SnakeCaseAction.singleLetters.isSupported()&®isterEditorAction(SnakeCaseAction);CamelCaseAction.wordBoundary.isSupported()&®isterEditorAction(CamelCaseAction);PascalCaseAction.wordBoundary.isSupported()&®isterEditorAction(PascalCaseAction);TitleCaseAction.titleBoundary.isSupported()&®isterEditorAction(TitleCaseAction);KebabCaseAction.isSupported()&®isterEditorAction(KebabCaseAction);const linkedEditing="";var __decorate$B=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$B=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},LinkedEditingContribution_1;const CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE=new RawContextKey("LinkedEditingInputVisible",!1),DECORATION_CLASS_NAME="linked-editing-decoration";var Ra;let LinkedEditingContribution=(Ra=class extends Disposable{static get(e){return e.getContribution(LinkedEditingContribution_1.ID)}constructor(e,t,i,s,r){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new DisposableStore),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE.bindTo(t),this._debounceInformation=r.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new DisposableStore),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(o=>{(o.hasChanged(70)||o.hasChanged(94))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(70)||this._editor.getOption(94))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(Event$1.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new Delayer(this._debounceInformation.get(t)),r=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},o=new Delayer(0),a=l=>{this._rangeSyncTriggerPromise=o.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{r()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}r()})),this._localToDispose.add({dispose:()=>{s.dispose(),o.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const o=s.match(this._currentWordPattern);if((o?o[0].length:0)!==s.length)return this.clearRanges()}const r=[];for(let o=1,a=this._currentDecorations.length;o1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const o=this._currentDecorations.getRange(0);if(o&&o.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=s;const r=this._currentRequestCts=new CancellationTokenSource$1;try{const o=new StopWatch(!1),a=await getLinkedEditingRanges(this._providers,i,t,r.token);if(this._debounceInformation.update(i,o.elapsed()),r!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let l=[];a!=null&&a.ranges&&(l=a.ranges),this._currentWordPattern=(a==null?void 0:a.wordPattern)||this._languageWordPattern;let c=!1;for(let u=0,f=l.length;u({range:u,options:LinkedEditingContribution_1.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(o){isCancellationError(o)||onUnexpectedError(o),(this._currentRequestCts===r||!this._currentRequestCts)&&this.clearRanges()}}},LinkedEditingContribution_1=Ra,Ra.ID="editor.contrib.linkedEditing",Ra.DECORATION=ModelDecorationOptions.register({description:"linked-editing",stickiness:0,className:DECORATION_CLASS_NAME}),Ra);LinkedEditingContribution=LinkedEditingContribution_1=__decorate$B([__param$B(1,IContextKeyService),__param$B(2,ILanguageFeaturesService),__param$B(3,ILanguageConfigurationService),__param$B(4,ILanguageFeatureDebounceService)],LinkedEditingContribution);class LinkedEditingAction extends EditorAction{constructor(){super({id:"editor.action.linkedEditing",label:localize("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(ICodeEditorService),[s,r]=Array.isArray(t)&&t||[void 0,void 0];return URI.isUri(s)&&Position$1.isIPosition(r)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},onUnexpectedError):super.runCommand(e,t)}run(e,t){const i=LinkedEditingContribution.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const LinkedEditingCommand=EditorCommand.bindToContribution(LinkedEditingContribution.get);registerEditorCommand(new LinkedEditingCommand({id:"cancelLinkedEditingInput",precondition:CONTEXT_ONTYPE_RENAME_INPUT_VISIBLE,handler:n=>n.clearRanges(),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function getLinkedEditingRanges(n,e,t,i){const s=n.ordered(e);return first(s.map(r=>async()=>{try{return await r.provideLinkedEditingRanges(e,t,i)}catch(o){onUnexpectedExternalError(o);return}}),r=>!!r&&isNonEmptyArray(r==null?void 0:r.ranges))}registerColor("editor.linkedEditingBackground",{dark:Color.fromHex("#f00").transparent(.3),light:Color.fromHex("#f00").transparent(.3),hcDark:Color.fromHex("#f00").transparent(.3),hcLight:Color.white},localize("editorLinkedEditingBackground","Background color when the editor auto renames on type."));registerModelAndPositionCommand("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(ILanguageFeaturesService);return getLinkedEditingRanges(i,e,t,CancellationToken.None)});registerEditorContribution(LinkedEditingContribution.ID,LinkedEditingContribution,1);registerEditorAction(LinkedEditingAction);const links="";let Link$1=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};class LinksList{constructor(e){this._disposables=new DisposableStore;let t=[];for(const[i,s]of e){const r=i.links.map(o=>new Link$1(o,s));t=LinksList._union(t,r),isDisposable(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,r,o,a;for(s=0,o=0,r=e.length,a=t.length;sPromise.resolve(r.provideLinks(e,t)).then(a=>{a&&(i[o]=[a,r])},onUnexpectedExternalError));return Promise.all(s).then(()=>{const r=new LinksList(coalesce(i));return t.isCancellationRequested?(r.dispose(),new LinksList([])):r})}CommandsRegistry.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;assertType(t instanceof URI),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(ILanguageFeaturesService),r=n.get(IModelService).getModel(t);if(!r)return[];const o=await getLinks(s,r,CancellationToken.None);if(!o)return[];for(let l=0;l=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$A=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},LinkDetector_1,gc;let LinkDetector=(gc=class extends Disposable{static get(e){return e.getContribution(LinkDetector_1.ID)}constructor(e,t,i,s,r){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=r.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new RunOnceScheduler(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new ClickLinkGesture(e));this._register(o.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(o.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(o.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(71)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(71))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=createCancelablePromise(t=>getLinks(this.providers,e,t));try{const t=new StopWatch(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){onUnexpectedError(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(78)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const o of s){const a=this.currentOccurrences[o];i.push(a.decorationId)}const r=[];if(e)for(const o of e)r.push(LinkOccurrence.decoration(o,t));this.editor.changeDecorations(o=>{const a=o.deltaDecorations(i,r);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{s.activate(r,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(78)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(CancellationToken.None).then(r=>{if(typeof r=="string"&&this.editor.hasModel()){const o=this.editor.getModel().uri;if(o.scheme===Schemas.file&&r.startsWith(`${Schemas.file}:`)){const a=URI.parse(r);if(a.scheme===Schemas.file){const l=originalFSPath(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(r=joinPath(o,c))}}}return this.openerService.open(r,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},r=>{const o=r instanceof Error?r.message:r;o==="invalid"?this.notificationService.warn(localize("invalid.url","Failed to open this link because it is not well-formed: {0}",s.url.toString())):o==="missing"?this.notificationService.warn(localize("missing.url","Failed to open this link because its target is missing.")):onUnexpectedError(r)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)==null||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},LinkDetector_1=gc,gc.ID="editor.linkDetector",gc);LinkDetector=LinkDetector_1=__decorate$A([__param$A(1,IOpenerService),__param$A(2,INotificationService),__param$A(3,ILanguageFeaturesService),__param$A(4,ILanguageFeatureDebounceService)],LinkDetector);const decoration$1={general:ModelDecorationOptions.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:ModelDecorationOptions.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class LinkOccurrence{static decoration(e,t){return{range:e.range,options:LinkOccurrence._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?decoration$1.active:decoration$1.general};return s.hoverMessage=getHoverMessage(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,LinkOccurrence._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,LinkOccurrence._getOptions(this.link,t,!1))}}function getHoverMessage(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?localize("links.navigate.executeCmd","Execute command"):localize("links.navigate.follow","Follow link"),s=e?isMacintosh?localize("links.navigate.kb.meta.mac","cmd + click"):localize("links.navigate.kb.meta","ctrl + click"):isMacintosh?localize("links.navigate.kb.alt.mac","option + click"):localize("links.navigate.kb.alt","alt + click");if(n.url){let r="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];r=localize("tooltip.explanation","Execute command {0}",l)}}return new MarkdownString("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,r).appendMarkdown(` (${s})`)}else return new MarkdownString().appendText(`${i} (${s})`)}class OpenLinkAction extends EditorAction{constructor(){super({id:"editor.action.openLink",label:localize("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=LinkDetector.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const r of s){const o=i.getLinkOccurrence(r.getEndPosition());o&&i.openLinkOccurrence(o,!1)}}}registerEditorContribution(LinkDetector.ID,LinkDetector,1);registerEditorAction(OpenLinkAction);const wm=class wm extends Disposable{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(118);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};wm.ID="editor.contrib.longLinesHelper";let LongLinesHelper=wm;registerEditorContribution(LongLinesHelper.ID,LongLinesHelper,2);const highlightDecorations="",wordHighlightBackground=registerColor("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},localize("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},localize("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);registerColor("editor.wordHighlightTextBackground",wordHighlightBackground,localize("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const wordHighlightBorder=registerColor("editor.wordHighlightBorder",{light:null,dark:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));registerColor("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:activeContrastBorder,hcLight:activeContrastBorder},localize("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));registerColor("editor.wordHighlightTextBorder",wordHighlightBorder,localize("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const overviewRulerWordHighlightForeground=registerColor("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",localize("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerWordHighlightStrongForeground=registerColor("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",localize("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),overviewRulerWordHighlightTextForeground=registerColor("editorOverviewRuler.wordHighlightTextForeground",overviewRulerSelectionHighlightForeground,localize("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),_WRITE_OPTIONS=ModelDecorationOptions.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:themeColorFromId(overviewRulerWordHighlightStrongForeground),position:OverviewRulerLane.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:1}}),_TEXT_OPTIONS=ModelDecorationOptions.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:themeColorFromId(overviewRulerWordHighlightTextForeground),position:OverviewRulerLane.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:1}}),_SELECTION_HIGHLIGHT_OPTIONS=ModelDecorationOptions.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:themeColorFromId(overviewRulerSelectionHighlightForeground),position:OverviewRulerLane.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:1}}),_SELECTION_HIGHLIGHT_OPTIONS_NO_OVERVIEW=ModelDecorationOptions.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),_REGULAR_OPTIONS=ModelDecorationOptions.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:themeColorFromId(overviewRulerWordHighlightForeground),position:OverviewRulerLane.Center},minimap:{color:themeColorFromId(minimapSelectionOccurrenceHighlight),position:1}});function getHighlightDecorationOptions(n){return n===DocumentHighlightKind$1.Write?_WRITE_OPTIONS:n===DocumentHighlightKind$1.Text?_TEXT_OPTIONS:_REGULAR_OPTIONS}function getSelectionHighlightDecorationOptions(n){return n?_SELECTION_HIGHLIGHT_OPTIONS_NO_OVERVIEW:_SELECTION_HIGHLIGHT_OPTIONS}registerThemingParticipant((n,e)=>{const t=n.getColor(editorSelectionHighlight);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var __decorate$z=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$z=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SelectionHighlighter_1;function announceCursorChange(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(r=>`line ${r.viewState.position.lineNumber} column ${r.viewState.position.column}`).join(", "),s=t.length===1?localize("cursorAdded","Cursor added: {0}",i):localize("cursorsAdded","Cursors added: {0}",i);status(s)}}class InsertCursorAbove extends EditorAction{constructor(){super({id:"editor.action.insertCursorAbove",label:localize("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,3,CursorMoveCommands.addCursorUp(r,o,s)),r.revealTopMostCursor(i.source),announceCursorChange(o,r.getCursorStates())}}class InsertCursorBelow extends EditorAction{constructor(){super({id:"editor.action.insertCursorBelow",label:localize("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=r.getCursorStates();r.setCursorStates(i.source,3,CursorMoveCommands.addCursorDown(r,o,s)),r.revealBottomMostCursor(i.source),announceCursorChange(o,r.getCursorStates())}}class InsertCursorAtEndOfEachLineSelected extends EditorAction{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:localize("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new Selection$1(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),r=t._getViewModel(),o=r.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),announceCursorChange(o,r.getCursorStates())}}class InsertCursorAtEndOfLineSelected extends EditorAction{constructor(){super({id:"editor.action.addCursorsToBottom",label:localize("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),r=[];for(let l=i[0].startLineNumber;l<=s;l++)r.push(new Selection$1(l,i[0].startColumn,l,i[0].endColumn));const o=t._getViewModel(),a=o.getCursorStates();r.length>0&&t.setSelections(r),announceCursorChange(a,o.getCursorStates())}}class InsertCursorAtTopOfLineSelected extends EditorAction{constructor(){super({id:"editor.action.addCursorsToTop",label:localize("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new Selection$1(a,i[0].startColumn,a,i[0].endColumn));const r=t._getViewModel(),o=r.getCursorStates();s.length>0&&t.setSelections(s),announceCursorChange(o,r.getCursorStates())}}class MultiCursorSessionResult{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class MultiCursorSession{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new MultiCursorSession(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,r,o;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,r=!0,o=!0):(r=i.wholeWord,o=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const u=e.getConfiguredWordAtPosition(l.getStartPosition());if(!u)return null;c=u.word,d=new Selection$1(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new MultiCursorSession(e,t,s,c,r,o,d)}constructor(e,t,i,s,r,o,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=r,this.matchCase=o,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1);return i?new Selection$1(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new MultiCursorSessionResult(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1);return i?new Selection$1(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824)}}const Wg=class Wg extends Disposable{static get(e){return e.getContribution(Wg.ID)}constructor(e){super(),this._sessionDispose=this._register(new DisposableStore),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=MultiCursorSession.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new Selection$1(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!modelRangesContainSameText(this._editor.getModel(),t,s)){const o=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(132):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(132):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let r=0,o=t.length;rnew Selection$1(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn)))}}};Wg.ID="editor.contrib.multiCursorController";let MultiCursorSelectionController=Wg;class MultiCursorSelectionControllerAction extends EditorAction{run(e,t){const i=MultiCursorSelectionController.get(t);if(!i)return;const s=t._getViewModel();if(s){const r=s.getCursorStates(),o=CommonFindController.get(t);if(o)this._run(i,o);else{const a=e.get(IInstantiationService).createInstance(CommonFindController,t);this._run(i,a),a.dispose()}announceCursorChange(r,s.getCursorStates())}}}class AddSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:localize("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:2082,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:localize("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:localize("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:KeyChord(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:localize("moveSelectionToPreviousFindMatch","Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class SelectHighlightsAction extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.selectHighlights",label:localize("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:3114,weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"3_multi",title:localize({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class CompatChangeAll extends MultiCursorSelectionControllerAction{constructor(){super({id:"editor.action.changeAll",label:localize("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.editorTextFocus),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class SelectionHighlighterState{constructor(e,t,i,s,r){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,r&&this._model===r._model&&this._searchText===r._searchText&&this._matchCase===r._matchCase&&this._wordSeparators===r._wordSeparators&&this._modelVersionId===r._modelVersionId&&(this._cachedFindMatches=r._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(Range$2.compareRangesUsingStarts)),this._cachedFindMatches}}var bc;let SelectionHighlighter=(bc=class extends Disposable{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(109),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new RunOnceScheduler(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(109)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=CommonFindController.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(SelectionHighlighter_1._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const r=MultiCursorSelectionController.get(i);if(!r)return null;const o=CommonFindController.get(i);if(!o)return null;let a=r.getSession(o);if(!a){const d=i.getSelections();if(d.length>1){const f=o.getState().matchCase;if(!modelRangesContainSameText(i.getModel(),d,f))return null}a=MultiCursorSession.create(i,o)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=o.getState(),c=l.matchCase;if(l.isRevealed){let d=l.searchString;c||(d=d.toLowerCase());let u=a.searchText;if(c||(u=u.toLowerCase()),d===u&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new SelectionHighlighterState(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(132):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(Range$2.compareRangesUsingStarts);const r=[];for(let c=0,d=0,u=i.length,f=s.length;c=f)r.push(g),c++;else{const m=Range$2.compareRangesUsingStarts(g,s[d]);m<0?((s[d].isEmpty()||!Range$2.areIntersecting(g,s[d]))&&r.push(g),c++):(m>0||c++,d++)}}const o=this.editor.getOption(81)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&o,l=r.map(c=>({range:c,options:getSelectionHighlightDecorationOptions(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}},SelectionHighlighter_1=bc,bc.ID="editor.contrib.selectionHighlighter",bc);SelectionHighlighter=SelectionHighlighter_1=__decorate$z([__param$z(1,ILanguageFeaturesService)],SelectionHighlighter);function modelRangesContainSameText(n,e,t){const i=getValueInRange(n,e[0],!t);for(let s=1,r=e.length;s=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$y=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const INLINE_EDIT_DESCRIPTION="inline-edit";let GhostTextWidget=class extends Disposable{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=observableValue(this,!1),this.currentTextModel=observableFromEvent(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=derived(this,s=>{var S;if(this.isDisposed.read(s))return;const r=this.currentTextModel.read(s);if(r!==this.model.targetTextModel.read(s))return;const o=this.model.ghostText.read(s);if(!o)return;let a=(S=this.model.range)==null?void 0:S.read(s);a&&a.startLineNumber===a.endLineNumber&&a.startColumn===a.endColumn&&(a=void 0);const l=(a?a.startLineNumber===a.endLineNumber:!0)&&o.parts.length===1&&o.parts[0].lines.length===1,c=o.parts.length===1&&o.parts[0].lines.every(w=>w.length===0),d=[],u=[];function f(w,L){if(u.length>0){const I=u[u.length-1];L&&I.decorations.push(new LineDecoration(I.content.length+1,I.content.length+1+w[0].length,L,0)),I.content+=w[0],w=w.slice(1)}for(const I of w)u.push({content:I,decorations:L?[new LineDecoration(1,I.length+1,L,0)]:[]})}const g=r.getLineContent(o.lineNumber);let m,_=0;if(!c&&(l||!a)){for(const w of o.parts){let L=w.lines;a&&!l&&(f(L,INLINE_EDIT_DESCRIPTION),L=[]),m===void 0?(d.push({column:w.column,text:L[0],preview:w.preview}),L=L.slice(1)):f([g.substring(_,w.column-1)],void 0),L.length>0&&(f(L,INLINE_EDIT_DESCRIPTION),m===void 0&&w.column<=g.length&&(m=w.column)),_=w.column-1}m!==void 0&&f([g.substring(_)],void 0)}const v=m!==void 0?new ColumnRange(m,g.length+1):void 0,C=l||!a?o.lineNumber:a.endLineNumber-1;return{inlineTexts:d,additionalLines:u,hiddenRange:v,lineNumber:C,additionalReservedLineCount:this.model.minReservedLineCount.read(s),targetTextModel:r,range:a,isSingleLine:l,isPureRemove:c}}),this.decorations=derived(this,s=>{const r=this.uiState.read(s);if(!r)return[];const o=[];if(r.hiddenRange&&o.push({range:r.hiddenRange.toRange(r.lineNumber),options:{inlineClassName:"inline-edit-hidden",description:"inline-edit-hidden"}}),r.range){const a=[];if(r.isSingleLine)a.push(r.range);else if(!r.isPureRemove){const l=r.range.endLineNumber-r.range.startLineNumber;for(let c=0;c{this.isDisposed.set(!0,void 0)})),this._register(applyObservableDecorations(this.editor,this.decorations))}};GhostTextWidget=__decorate$y([__param$y(2,ILanguageService)],GhostTextWidget);const inlineEditHintsWidget="";var __decorate$x=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$x=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineEditHintsContentWidget_1;let InlineEditHintsWidget=class extends Disposable{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).showToolbar==="always"),this.sessionPosition=void 0,this.position=derived(this,s=>{var l,c;const r=(l=this.model.read(s))==null?void 0:l.model.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!r||r.parts.length===0)return this.sessionPosition=void 0,null;const o=r.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==r.lineNumber&&(this.sessionPosition=void 0);const a=new Position$1(r.lineNumber,Math.min(o,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(autorunWithStore((s,r)=>{if(!this.model.read(s)||!this.alwaysShowToolbar.read(s))return;const a=r.add(this.instantiationService.createInstance(InlineEditHintsContentWidget,this.editor,!0,this.position));e.addContentWidget(a),r.add(toDisposable(()=>e.removeContentWidget(a)))}))}};InlineEditHintsWidget=__decorate$x([__param$x(2,IInstantiationService)],InlineEditHintsWidget);var Pa;let InlineEditHintsContentWidget=(Pa=class extends Disposable{constructor(e,t,i,s,r,o){super(),this.editor=e,this.withBorder=t,this._position=i,this._contextKeyService=r,this._menuService=o,this.id=`InlineEditHintsContentWidget${InlineEditHintsContentWidget_1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=h("div.inlineEditHints",{className:this.withBorder?".withBorder":""},[h("div@toolBar")]),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(MenuId.InlineEditActions,this._contextKeyService)),this.toolBar=this._register(s.createInstance(CustomizedMenuWorkbenchToolBar,this.nodes.toolBar,this.editor,MenuId.InlineEditToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:a=>a.startsWith("primary")},actionViewItemProvider:(a,l)=>{if(a instanceof MenuItemAction)return s.createInstance(StatusBarViewItem,a,void 0)},telemetrySource:"InlineEditToolbar"})),this._register(this.toolBar.onDidChangeDropdownVisibility(a=>{InlineEditHintsContentWidget_1._dropDownVisible=a})),this._register(autorun(a=>{this._position.read(a),this.editor.layoutContentWidget(this)})),this._register(autorun(a=>{const l=[];for(const[c,d]of this.inlineCompletionsActionsMenus.getActions())for(const u of d)u instanceof MenuItemAction&&l.push(u);l.length>0&&l.unshift(new Separator),this.toolBar.setAdditionalSecondaryActions(l)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},InlineEditHintsContentWidget_1=Pa,Pa._dropDownVisible=!1,Pa.id=0,Pa);InlineEditHintsContentWidget=InlineEditHintsContentWidget_1=__decorate$x([__param$x(3,IInstantiationService),__param$x(4,IContextKeyService),__param$x(5,IMenuService)],InlineEditHintsContentWidget);class StatusBarViewItem extends MenuEntryActionViewItem{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=h("div.keybinding").root;this._register(new KeybindingLabel(t,OS$1,{disableTitle:!0,...unthemedKeybindingLabelOptions})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineEditStatusBarItemLabel")}}updateTooltip(){}}let CustomizedMenuWorkbenchToolBar=class extends WorkbenchToolBar{constructor(e,t,i,s,r,o,a,l,c,d){super(e,{resetMenu:i,...s},r,o,a,l,c,d),this.editor=t,this.menuId=i,this.options2=s,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this._store.add(this.editor.onDidChangeCursorPosition(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,s,r,o,a,l,c;const e=[],t=[];createAndFillInActionBarActions(this.menu,(i=this.options2)==null?void 0:i.menuOptions,{primary:e,secondary:t},(r=(s=this.options2)==null?void 0:s.toolbarOptions)==null?void 0:r.primaryGroup,(a=(o=this.options2)==null?void 0:o.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions),t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),this.setActions(e,t)}setAdditionalSecondaryActions(e){equals$1(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};CustomizedMenuWorkbenchToolBar=__decorate$x([__param$x(4,IMenuService),__param$x(5,IContextKeyService),__param$x(6,IContextMenuService),__param$x(7,IKeybindingService),__param$x(8,ICommandService),__param$x(9,ITelemetryService)],CustomizedMenuWorkbenchToolBar);const inlineEditSideBySideWidget="";var __decorate$w=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$w=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineEditSideBySideWidget_1,InlineEditSideBySideContentWidget_1;function*range$1(n,e,t=1){e===void 0&&([e,n]=[n,0]);for(let i=n;is.replace(new RegExp("^"+e),"")),shift:t}}var yc;let InlineEditSideBySideWidget=(yc=class extends Disposable{static _createUniqueUri(){return URI.from({scheme:"inline-edit-widget",path:new Date().toString()+String(InlineEditSideBySideWidget_1._modelId++)})}constructor(e,t,i,s,r){super(),this._editor=e,this._model=t,this._instantiationService=i,this._diffProviderFactoryService=s,this._modelService=r,this._position=derived(this,o=>{const a=this._model.read(o);if(!a||a.text.length===0||a.range.startLineNumber===a.range.endLineNumber&&!(a.range.startColumn===a.range.endColumn&&a.range.startColumn===1))return null;const l=this._editor.getModel();if(!l)return null;const c=Array.from(range$1(a.range.startLineNumber,a.range.endLineNumber+1)),d=c.map(_=>l.getLineLastNonWhitespaceColumn(_)),u=Math.max(...d),f=c[d.indexOf(u)],g=new Position$1(f,u);return{top:a.range.startLineNumber,left:g}}),this._text=derived(this,o=>{const a=this._model.read(o);if(!a)return{text:"",shift:0};const l=removeIndentation(a.text.split(` +`));return{text:l.text.join(` +`),shift:l.shift}}),this._originalModel=derivedDisposable(()=>this._modelService.createModel("",null,InlineEditSideBySideWidget_1._createUniqueUri())).keepObserved(this._store),this._modifiedModel=derivedDisposable(()=>this._modelService.createModel("",null,InlineEditSideBySideWidget_1._createUniqueUri())).keepObserved(this._store),this._diff=derived(this,o=>{var a,l;return(l=(a=this._diffPromise.read(o))==null?void 0:a.promiseResult.read(o))==null?void 0:l.data}),this._diffPromise=derived(this,o=>{const a=this._model.read(o);if(!a)return;const l=this._editor.getModel();if(!l)return;const c=removeIndentation(l.getValueInRange(a.range).split(` +`)).text.join(` +`),d=removeIndentation(a.text.split(` +`)).text.join(` +`);this._originalModel.get().setValue(c),this._modifiedModel.get().setValue(d);const u=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return ObservablePromise.fromFn(async()=>{const f=await u.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},CancellationToken.None);if(!f.identical)return f.changes})}),this._register(autorunWithStore((o,a)=>{if(!this._model.read(o)||this._position.get()===null)return;const c=a.add(this._instantiationService.createInstance(InlineEditSideBySideContentWidget,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(c),a.add(toDisposable(()=>e.removeOverlayWidget(c)))}))}},InlineEditSideBySideWidget_1=yc,yc._modelId=0,yc);InlineEditSideBySideWidget=InlineEditSideBySideWidget_1=__decorate$w([__param$w(2,IInstantiationService),__param$w(3,IDiffProviderFactoryService),__param$w(4,IModelService)],InlineEditSideBySideWidget);var ed;let InlineEditSideBySideContentWidget=(ed=class extends Disposable{constructor(e,t,i,s,r,o){var a;super(),this._editor=e,this._position=t,this._text=i,this._shift=s,this._diff=r,this._instantiationService=o,this.id=`InlineEditSideBySideContentWidget${InlineEditSideBySideContentWidget_1.id++}`,this.allowEditorOverflow=!1,this._nodes=$$e("div.inlineEditSideBySide",void 0),this._scrollChanged=observableSignalFromEvent("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(EmbeddedCodeEditorWidget,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=observableCodeEditor(this._previewEditor),this._editorObs=observableCodeEditor(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(TextModel,"",((a=this._editor.getModel())==null?void 0:a.getLanguageId())??PLAINTEXT_LANGUAGE_ID,TextModel.DEFAULT_CREATION_OPTIONS,null)),this._setText=derived(l=>{const c=this._text.read(l);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=derived(this,l=>{this._setText.read(l);const c=this._position.read(l);if(!c)return{org:[],mod:[]};const d=this._diff.read(l);if(!d)return{org:[],mod:[]};const u=[],f=[];if(d.length===1&&d[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const g=this._shift.get(),m=_=>new Range$2(_.startLineNumber+c.top-1,_.startColumn+g,_.endLineNumber+c.top-1,_.endColumn+g);for(const _ of d)if(_.original.isEmpty||u.push({range:m(_.original.toInclusiveRange()),options:diffLineDeleteDecorationBackgroundWithIndicator}),_.modified.isEmpty||f.push({range:_.modified.toInclusiveRange(),options:diffLineAddDecorationBackgroundWithIndicator}),_.modified.isEmpty||_.original.isEmpty)_.original.isEmpty||u.push({range:m(_.original.toInclusiveRange()),options:diffWholeLineDeleteDecoration}),_.modified.isEmpty||f.push({range:_.modified.toInclusiveRange(),options:diffWholeLineAddDecoration});else for(const v of _.innerChanges||[])_.original.contains(v.originalRange.startLineNumber)&&u.push({range:m(v.originalRange),options:v.originalRange.isEmpty()?diffDeleteDecorationEmpty:diffDeleteDecoration}),_.modified.contains(v.modifiedRange.startLineNumber)&&f.push({range:v.modifiedRange,options:v.modifiedRange.isEmpty()?diffAddDecorationEmpty:diffAddDecoration});return{org:u,mod:f}}),this._originalDecorations=derived(this,l=>this._decorations.read(l).org),this._modifiedDecorations=derived(this,l=>this._decorations.read(l).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(autorun(l=>{const c=this._previewEditorObs.contentWidth.read(l),d=this._text.read(l).split(` +`).length-1,u=this._editor.getOption(67)*d;c<=0||this._previewEditor.layout({height:u,width:c})})),this._register(autorun(l=>{this._position.read(l),this._editor.layoutOverlayWidget(this)})),this._register(autorun(l=>{this._scrollChanged.read(l),this._position.read(l)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new Position$1(e.top,1));if(!i)return null;const s=i.top-1,r=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+r+10,top:s}}}},InlineEditSideBySideContentWidget_1=ed,ed.id=0,ed);InlineEditSideBySideContentWidget=InlineEditSideBySideContentWidget_1=__decorate$w([__param$w(5,IInstantiationService)],InlineEditSideBySideContentWidget);var __decorate$v=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$v=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineEditController_1,Wn;let InlineEditController=(Wn=class extends Disposable{static get(e){return e.getContribution(InlineEditController_1.ID)}constructor(e,t,i,s,r,o,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=s,this._commandService=r,this._configurationService=o,this._diffProviderFactoryService=a,this._modelService=l,this._isVisibleContext=InlineEditController_1.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=InlineEditController_1.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=observableValue(this,void 0),this._currentWidget=derivedDisposable(this._currentEdit,m=>{const _=this._currentEdit.read(m);if(!_)return;const v=_.range.endLineNumber,C=_.range.endColumn,S=_.text.endsWith(` +`)&&!(_.range.startLineNumber===_.range.endLineNumber&&_.range.startColumn===_.range.endColumn)?_.text.slice(0,-1):_.text,w=new GhostText(v,[new GhostTextPart(C,S,!1)]),L=_.range.startLineNumber===_.range.endLineNumber&&w.parts.length===1&&w.parts[0].lines.length===1,I=_.text==="";return!L&&!I?void 0:this.instantiationService.createInstance(GhostTextWidget,this.editor,{ghostText:constObservable(w),minReservedLineCount:constObservable(0),targetTextModel:constObservable(this.editor.getModel()??void 0),range:constObservable(_.range)})}),this._isAccepting=observableValue(this,!1),this._enabled=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=observableFromEvent(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily);const c=observableSignalFromEvent("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(autorun(m=>{this._enabled.read(m)&&(c.read(m),!this._isAccepting.read(m)&&this.getInlineEdit(e,!0))}));const d=observableFromEvent(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(autorun(m=>{if(!this._enabled.read(m))return;const _=d.read(m);_&&this.checkCursorPosition(_)})),this._register(autorun(m=>{const _=this._currentEdit.read(m);if(this._isCursorAtInlineEditContext.set(!1),!_){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const v=e.getPosition();v&&this.checkCursorPosition(v)}));const u=observableSignalFromEvent("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(autorun(async m=>{var _;this._enabled.read(m)&&(u.read(m),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((_=this._currentRequestCts)==null||_.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const f=observableSignalFromEvent("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(autorun(m=>{this._enabled.read(m)&&(f.read(m),this.getInlineEdit(e,!0))}));const g=this._register(createStyleSheet2());this._register(autorun(m=>{const _=this._fontFamily.read(m);g.setStyle(_===""||_==="default"?"":` +.monaco-editor .inline-edit-decoration, +.monaco-editor .inline-edit-decoration-preview, +.monaco-editor .inline-edit { + font-family: ${_}; +}`)})),this._register(new InlineEditHintsWidget(this.editor,this._currentWidget,this.instantiationService)),this._register(new InlineEditSideBySideWidget(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(Range$2.containsPosition(t.range,e))}validateInlineEdit(e,t){var i;if(t.text.includes(` +`)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const r=t.range.endLineNumber,o=t.range.endColumn,a=((i=e.getModel())==null?void 0:i.getLineLength(r))??0;if(o!==a+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const s=i.getVersionId(),r=this.languageFeaturesService.inlineEditProvider.all(i);if(r.length===0)return;const o=r[0];this._currentRequestCts=new CancellationTokenSource$1;const a=this._currentRequestCts.token,l=t?InlineEditTriggerKind$1.Automatic:InlineEditTriggerKind$1.Invoke;if(t&&await wait(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)return;const d=await o.provideInlineEdit(i,{triggerKind:l},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==s)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(i,void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get();if(!e)return;let t=e.text;e.text.startsWith(` +`)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[EditOperation.replace(Range$2.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,onUnexpectedExternalError),this.freeEdit(e),transaction(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){var i;this._jumpBackPosition=(i=this.editor.getSelection())==null?void 0:i.getStartPosition();const e=this._currentEdit.get();if(!e)return;const t=Position$1.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get();t&&(t!=null&&t.rejected)&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,onUnexpectedExternalError),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}},InlineEditController_1=Wn,Wn.ID="editor.contrib.inlineEditController",Wn.inlineEditVisibleKey="inlineEditVisible",Wn.inlineEditVisibleContext=new RawContextKey(Wn.inlineEditVisibleKey,!1),Wn.cursorAtInlineEditKey="cursorAtInlineEdit",Wn.cursorAtInlineEditContext=new RawContextKey(Wn.cursorAtInlineEditKey,!1),Wn);InlineEditController=InlineEditController_1=__decorate$v([__param$v(1,IInstantiationService),__param$v(2,IContextKeyService),__param$v(3,ILanguageFeaturesService),__param$v(4,ICommandService),__param$v(5,IConfigurationService),__param$v(6,IDiffProviderFactoryService),__param$v(7,IModelService)],InlineEditController);function wait(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}let AcceptInlineEdit$1=class extends EditorAction{constructor(){super({id:inlineEditAcceptId$1,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:ContextKeyExpr.and(EditorContextKeys.writable,InlineEditController.inlineEditVisibleContext),kbOpts:[{weight:100+1,primary:2,kbExpr:ContextKeyExpr.and(EditorContextKeys.writable,InlineEditController.inlineEditVisibleContext,InlineEditController.cursorAtInlineEditContext)}],menuOpts:[{menuId:MenuId.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const i=InlineEditController.get(t);await(i==null?void 0:i.accept())}};class TriggerInlineEdit extends EditorAction{constructor(){const e=ContextKeyExpr.and(EditorContextKeys.writable,ContextKeyExpr.not(InlineEditController.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e}})}async run(e,t){const i=InlineEditController.get(t);i==null||i.trigger()}}class JumpToInlineEdit extends EditorAction{constructor(){const e=ContextKeyExpr.and(EditorContextKeys.writable,InlineEditController.inlineEditVisibleContext,ContextKeyExpr.not(InlineEditController.cursorAtInlineEditKey));super({id:inlineEditJumpToId,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:100+1,primary:2646,kbExpr:e},menuOpts:[{menuId:MenuId.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const i=InlineEditController.get(t);i==null||i.jumpToCurrent()}}class JumpBackInlineEdit extends EditorAction{constructor(){const e=ContextKeyExpr.and(EditorContextKeys.writable,InlineEditController.cursorAtInlineEditContext);super({id:inlineEditJumpBackId,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:100+10,primary:2646,kbExpr:e},menuOpts:[{menuId:MenuId.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const i=InlineEditController.get(t);i==null||i.jumpBack()}}class RejectInlineEdit extends EditorAction{constructor(){const e=ContextKeyExpr.and(EditorContextKeys.writable,InlineEditController.inlineEditVisibleContext);super({id:inlineEditRejectId,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:MenuId.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const i=InlineEditController.get(t);await(i==null?void 0:i.clear())}}registerEditorAction(AcceptInlineEdit$1);registerEditorAction(RejectInlineEdit);registerEditorAction(JumpToInlineEdit);registerEditorAction(JumpBackInlineEdit);registerEditorAction(TriggerInlineEdit);registerEditorContribution(InlineEditController.ID,InlineEditController,3);const inlineEditAcceptId="editor.action.inlineEdits.accept",showPreviousInlineEditActionId="editor.action.inlineEdits.showPrevious",showNextInlineEditActionId="editor.action.inlineEdits.showNext",inlineEditVisible=new RawContextKey("inlineEditsVisible",!1,localize("inlineEditsVisible","Whether an inline edit is visible")),isPinnedContextKey=new RawContextKey("inlineEditsIsPinned",!1,localize("isPinned","Whether an inline edit is visible")),inlineEditsWidget="",xm=class xm extends Disposable{constructor(e){super(),this._editor=e,this._editorObs=observableCodeEditor(this._editor),this._placeholderText=this._editorObs.getOption(88),this._state=derivedOpts({owner:this,equalsFn:structuralEquals},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=isOrWasTrue(this,t=>{var i;return((i=this._state.read(t))==null?void 0:i.placeholder)!==void 0}),this._view=derivedWithStore((t,i)=>{if(!this._shouldViewBeAlive.read(t))return;const s=h("div.editorPlaceholder");i.add(autorun(r=>{const o=this._state.read(r),a=(o==null?void 0:o.placeholder)!==void 0;s.root.style.display=a?"block":"none",s.root.innerText=(o==null?void 0:o.placeholder)??""})),i.add(autorun(r=>{const o=this._editorObs.layoutInfo.read(r);s.root.style.left=`${o.contentLeft}px`,s.root.style.width=o.contentWidth-o.verticalScrollbarWidth+"px",s.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),i.add(autorun(r=>{s.root.style.fontFamily=this._editorObs.getOption(49).read(r),s.root.style.fontSize=this._editorObs.getOption(52).read(r)+"px",s.root.style.lineHeight=this._editorObs.getOption(67).read(r)+"px"})),i.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:constObservable(0),position:constObservable(null),domNode:s.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};xm.ID="editor.contrib.placeholderText";let PlaceholderTextContribution=xm;function isOrWasTrue(n,e){return derivedObservableWithCache(n,(t,i)=>i===!0?!0:e(t))}var __decorate$u=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$u=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class InlineEdit{constructor(e,t,i){this.range=e,this.newLines=t,this.changes=i}}let InlineEditsWidget=class extends Disposable{constructor(e,t,i,s){super(),this._editor=e,this._edit=t,this._userPrompt=i,this._instantiationService=s,this._editorObs=observableCodeEditor(this._editor),this._elements=h("div.inline-edits-widget",{style:{position:"absolute",overflow:"visible",top:"0px",left:"0px"}},[h("div@editorContainer",{style:{position:"absolute",top:"0px",left:"0px",width:"500px",height:"500px"}},[h("div.toolbar@toolbar",{style:{position:"absolute",top:"-25px",left:"0px"}}),h("div.promptEditor@promptEditor",{style:{position:"absolute",top:"-25px",left:"80px",width:"300px",height:"22px"}}),h("div.preview@editor",{style:{position:"absolute",top:"0px",left:"0px"}})]),svgElem("svg",{style:{overflow:"visible",pointerEvents:"none"}},[svgElem("defs",[svgElem("linearGradient",{id:"Gradient2",x1:"0",y1:"0",x2:"1",y2:"0"},[svgElem("stop",{offset:"0%",class:"gradient-stop"}),svgElem("stop",{offset:"100%",class:"gradient-stop"})])]),svgElem("path@path",{d:"",fill:"url(#Gradient2)"})])]),this._previewTextModel=this._register(this._instantiationService.createInstance(TextModel,"",PLAINTEXT_LANGUAGE_ID,TextModel.DEFAULT_CREATION_OPTIONS,null)),this._setText=derived(o=>{const a=this._edit.read(o);a&&this._previewTextModel.setValue(a.newLines.join(` +`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(TextModel,"",PLAINTEXT_LANGUAGE_ID,TextModel.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(EmbeddedCodeEditorWidget,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:DEFAULT_FONT_FAMILY},{contributions:EditorExtensionsRegistry.getSomeEditorContributions([SuggestController.ID,PlaceholderTextContribution.ID,ContextMenuController.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(EmbeddedCodeEditorWidget,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=observableCodeEditor(this._previewEditor),this._decorations=derived(this,o=>{var d;this._setText.read(o);const a=(d=this._edit.read(o))==null?void 0:d.changes;if(!a)return[];const l=[],c=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const u of a)if(u.original.isEmpty||l.push({range:u.original.toInclusiveRange(),options:diffLineDeleteDecorationBackgroundWithIndicator}),u.modified.isEmpty||c.push({range:u.modified.toInclusiveRange(),options:diffLineAddDecorationBackgroundWithIndicator}),u.modified.isEmpty||u.original.isEmpty)u.original.isEmpty||l.push({range:u.original.toInclusiveRange(),options:diffWholeLineDeleteDecoration}),u.modified.isEmpty||c.push({range:u.modified.toInclusiveRange(),options:diffWholeLineAddDecoration});else for(const f of u.innerChanges||[])u.original.contains(f.originalRange.startLineNumber)&&l.push({range:f.originalRange,options:f.originalRange.isEmpty()?diffDeleteDecorationEmpty:diffDeleteDecoration}),u.modified.contains(f.modifiedRange.startLineNumber)&&c.push({range:f.modifiedRange,options:f.modifiedRange.isEmpty()?diffAddDecorationEmpty:diffAddDecoration});return c}),this._layout1=derived(this,o=>{const a=this._editor.getModel(),l=this._edit.read(o);if(!l)return null;const c=l.range;let d=0;for(let g=c.startLineNumber;g{const a=this._edit.read(o);if(!a)return null;const l=a.range,c=this._editorObs.scrollLeft.read(o),d=this._layout1.read(o).left+20-c,u=this._editor.getTopForLineNumber(l.startLineNumber)-this._editorObs.scrollTop.read(o),f=this._editor.getTopForLineNumber(l.endLineNumberExclusive)-this._editorObs.scrollTop.read(o),g=new Point(d,u),m=new Point(d,f),_=f-u,v=50,C=this._editor.getOption(67)*a.newLines.length,S=_-C,w=new Point(d+v,u+S/2),L=new Point(d+v,f-S/2);return{topCode:g,bottomCode:m,codeHeight:_,topEdit:w,bottomEdit:L,editHeight:C}});const r=derived(this,o=>this._edit.read(o)!==void 0||this._userPrompt.read(o)!==void 0);this._register(applyStyle(this._elements.root,{display:derived(this,o=>r.read(o)?"block":"none")})),this._register(appendRemoveOnDispose(this._editor.getDomNode(),this._elements.root)),this._register(observableCodeEditor(e).createOverlayWidget({domNode:this._elements.root,position:constObservable(null),allowEditorOverflow:!1,minContentWidthInPx:derived(o=>{var c;const a=(c=this._layout1.read(o))==null?void 0:c.left;if(a===void 0)return 0;const l=this._previewEditorObs.contentWidth.read(o);return a+l})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(autorun(o=>{const a=this._layout.read(o);if(!a)return;const{topCode:l,bottomCode:c,topEdit:d,bottomEdit:u,editHeight:f}=a,g=10,m=0,_=40,v=new PathBuilder().moveTo(l).lineTo(l.deltaX(g)).curveTo(l.deltaX(g+_),d.deltaX(-_-m),d.deltaX(-m)).lineTo(d).lineTo(u).lineTo(u.deltaX(-m)).curveTo(u.deltaX(-_-m),c.deltaX(g+_),c.deltaX(g)).lineTo(c).build();this._elements.path.setAttribute("d",v),this._elements.editorContainer.style.top=`${d.y}px`,this._elements.editorContainer.style.left=`${d.x}px`,this._elements.editorContainer.style.height=`${f}px`;const C=this._previewEditorObs.contentWidth.read(o);this._previewEditor.layout({height:f,width:C})})),this._promptEditor.setModel(this._promptTextModel),this._promptEditor.layout(),this._register(createTwoWaySync(mapSettableObservable(this._userPrompt,o=>o??"",o=>o),observableCodeEditor(this._promptEditor).value)),this._register(autorun(o=>{const a=observableCodeEditor(this._promptEditor).isFocused.read(o);this._elements.root.classList.toggle("focused",a)}))}};InlineEditsWidget=__decorate$u([__param$u(3,IInstantiationService)],InlineEditsWidget);function mapSettableObservable(n,e,t){return derivedWithSetter(void 0,i=>e(n.read(i)),(i,s)=>n.set(t(i),s))}class Point{constructor(e,t){this.x=e,this.y=t}deltaX(e){return new Point(this.x+e,this.y)}}class PathBuilder{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}curveTo(e,t,i){return this._data+=`C ${e.x} ${e.y} ${t.x} ${t.y} ${i.x} ${i.y} `,this}build(){return this._data}}function createTwoWaySync(n,e){const t=new DisposableStore;return t.add(autorun(i=>{const s=n.read(i);e.set(s,void 0)})),t.add(autorun(i=>{const s=e.read(i);n.set(s,void 0)})),t}var __decorate$t=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$t=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineEditsModel_1,td;let InlineEditsModel=(td=class extends Disposable{static _createUniqueUri(){return URI.from({scheme:"inline-edits",path:new Date().toString()+String(InlineEditsModel_1._modelId++)})}constructor(e,t,i,s,r,o,a){super(),this.textModel=e,this._textModelVersionId=t,this._selection=i,this._debounceValue=s,this.languageFeaturesService=r,this._diffProviderFactoryService=o,this._modelService=a,this._forceUpdateExplicitlySignal=observableSignal(this),this._selectedInlineCompletionId=observableValue(this,void 0),this._isActive=observableValue(this,!1),this._originalModel=derivedDisposable(()=>this._modelService.createModel("",null,InlineEditsModel_1._createUniqueUri())).keepObserved(this._store),this._modifiedModel=derivedDisposable(()=>this._modelService.createModel("",null,InlineEditsModel_1._createUniqueUri())).keepObserved(this._store),this._pinnedRange=new TrackedRange(this.textModel,this._textModelVersionId),this.isPinned=this._pinnedRange.range.map(l=>!!l),this.userPrompt=observableValue(this,void 0),this.inlineEdit=derived(this,l=>{var c,d;return(d=(c=this._inlineEdit.read(l))==null?void 0:c.promiseResult.read(l))==null?void 0:d.data}),this._inlineEdit=derived(this,l=>{const c=this.selectedInlineEdit.read(l);if(!c)return;const d=c.inlineCompletion.range;if(c.inlineCompletion.insertText.trim()==="")return;let u=c.inlineCompletion.insertText.split(/\r\n|\r|\n/);function f(v){var S;const C=((S=v[0].match(/^\s*/))==null?void 0:S[0])??"";return v.map(w=>w.replace(new RegExp("^"+C),""))}u=f(u);let m=this.textModel.getValueInRange(d).split(/\r\n|\r|\n/);m=f(m),this._originalModel.get().setValue(m.join(` +`)),this._modifiedModel.get().setValue(u.join(` +`));const _=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return ObservablePromise.fromFn(async()=>{const v=await _.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},CancellationToken.None);if(!v.identical)return new InlineEdit(LineRange$1.fromRangeInclusive(d),f(u),v.changes)})}),this._fetchStore=this._register(new DisposableStore),this._inlineEditsFetchResult=disposableObservableValue(this,void 0),this._inlineEdits=derivedOpts({owner:this,equalsFn:structuralEquals},l=>{var c;return((c=this._inlineEditsFetchResult.read(l))==null?void 0:c.completions.map(d=>new InlineEditData(d)))??[]}),this._fetchInlineEditsPromise=derivedHandleChanges({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:InlineCompletionTriggerKind$1.Automatic}),handleChange:(l,c)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(c.inlineCompletionTriggerKind=InlineCompletionTriggerKind$1.Explicit),!0)},async(l,c)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function d(_,v){return v(_)}const u=this._pinnedRange.range.read(l)??d(this._selection.read(l),_=>_.isEmpty()?void 0:_);if(!u){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const f={triggerKind:c.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},g=cancelOnDispose(this._fetchStore);await timeout(200,g);const m=await provideInlineCompletions(this.languageFeaturesService.inlineCompletionsProvider,u,this.textModel,f,g);g.isCancellationRequested||this._inlineEditsFetchResult.set(m,void 0)}),this._filteredInlineEditItems=derivedOpts({owner:this,equalsFn:itemsEquals()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=derived(this,l=>{const c=this._selectedInlineCompletionId.read(l),d=this._filteredInlineEditItems.read(l),u=this._selectedInlineCompletionId===void 0?-1:d.findIndex(f=>f.semanticId===c);return u===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):u}),this.selectedInlineEdit=derived(this,l=>{const c=this._filteredInlineEditItems.read(l),d=this.selectedInlineCompletionIndex.read(l);return c[d]}),this._register(recomputeInitiallyAndOnChange(this._fetchInlineEditsPromise))}async triggerExplicitly(e){subtransaction(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){subtransaction(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new BugIndicatingError;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},InlineEditsModel_1=td,td._modelId=0,td);InlineEditsModel=InlineEditsModel_1=__decorate$t([__param$t(4,ILanguageFeaturesService),__param$t(5,IDiffProviderFactoryService),__param$t(6,IModelService)],InlineEditsModel);class InlineEditData{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class TrackedRange extends Disposable{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=observableValue(this,[]),this.range=derived(this,i=>{this._versionId.read(i);const s=this._decorations.read(i)[0];return s?this._textModel.getDecorationRange(s)??null:null}),this._register(toDisposable(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var __decorate$s=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$s=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InlineEditsController_1,id;let InlineEditsController=(id=class extends Disposable{static get(e){return e.getContribution(InlineEditsController_1.ID)}constructor(e,t,i,s,r,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=s,this._languageFeaturesService=r,this._configurationService=o,this._enabled=observableConfigValue("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=observableCodeEditor(this.editor),this._selection=derived(this,a=>this._editorObs.cursorSelection.read(a)??new Selection$1(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=derivedDisposable(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const l=this._editorObs.model.read(a);return l?this._instantiationService.createInstance(readHotReloadableExport(InlineEditsModel,a),l,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=derivedObservableWithCache(this,(a,l)=>{var c;return l||((c=this.model.read(a))==null?void 0:c.inlineEdit.read(a))!==void 0}),this._widget=derivedDisposable(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(readHotReloadableExport(InlineEditsWidget,a),this.editor,this.model.map((l,c)=>l==null?void 0:l.inlineEdit.read(c)),flattenSettableObservable(l=>{var c;return((c=this.model.read(l))==null?void 0:c.userPrompt)??observableValue("empty","")}))}),this._register(bindContextKey(inlineEditVisible,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.inlineEdit.read(a))})),this._register(bindContextKey(isPinnedContextKey,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.isPinned.read(a))})),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},InlineEditsController_1=id,id.ID="editor.contrib.inlineEditsController",id);InlineEditsController=InlineEditsController_1=__decorate$s([__param$s(1,IInstantiationService),__param$s(2,IContextKeyService),__param$s(3,ILanguageFeatureDebounceService),__param$s(4,ILanguageFeaturesService),__param$s(5,IConfigurationService)],InlineEditsController);function flattenSettableObservable(n){return derivedWithSetter(void 0,e=>n(e).read(e),(e,t)=>{n(void 0).set(e,t)})}function labelAndAlias(n){return{label:n.value,alias:n.original}}const Hg=class Hg extends EditorAction{constructor(){super({id:Hg.ID,...labelAndAlias(localize2("action.inlineEdits.showNext","Show Next Inline Edit")),precondition:ContextKeyExpr.and(EditorContextKeys.writable,inlineEditVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var s;const i=InlineEditsController.get(t);(s=i==null?void 0:i.model.get())==null||s.next()}};Hg.ID=showNextInlineEditActionId;let ShowNextInlineEditAction=Hg;const zg=class zg extends EditorAction{constructor(){super({id:zg.ID,...labelAndAlias(localize2("action.inlineEdits.showPrevious","Show Previous Inline Edit")),precondition:ContextKeyExpr.and(EditorContextKeys.writable,inlineEditVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var s;const i=InlineEditsController.get(t);(s=i==null?void 0:i.model.get())==null||s.previous()}};zg.ID=showPreviousInlineEditActionId;let ShowPreviousInlineEditAction=zg;class TriggerInlineEditAction extends EditorAction{constructor(){super({id:"editor.action.inlineEdits.trigger",...labelAndAlias(localize2("action.inlineEdits.trigger","Trigger Inline Edit")),precondition:EditorContextKeys.writable})}async run(e,t){const i=InlineEditsController.get(t);await asyncTransaction(async s=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(s))})}}class AcceptInlineEdit extends EditorAction{constructor(){super({id:inlineEditAcceptId,...labelAndAlias(localize2("action.inlineEdits.accept","Accept Inline Edit")),precondition:inlineEditVisible,menuOpts:{menuId:MenuId.InlineEditsActions,title:localize("inlineEditsActions","Accept Inline Edit"),group:"primary",order:1,icon:Codicon.check},kbOpts:{primary:2058,weight:2e4,kbExpr:inlineEditVisible}})}async run(e,t){var s;t instanceof EmbeddedCodeEditorWidget&&(t=t.getParentEditor());const i=InlineEditsController.get(t);i&&((s=i.model.get())==null||s.accept(i.editor),i.editor.focus())}}const Ug=class Ug extends EditorAction{constructor(){super({id:Ug.ID,...labelAndAlias(localize2("action.inlineEdits.hide","Hide Inline Edit")),precondition:inlineEditVisible,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=InlineEditsController.get(t);transaction(s=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(s)})}};Ug.ID="editor.action.inlineEdits.hide";let HideInlineEdit=Ug;registerEditorContribution(InlineEditsController.ID,InlineEditsController,3);registerEditorAction(TriggerInlineEditAction);registerEditorAction(ShowNextInlineEditAction);registerEditorAction(ShowPreviousInlineEditAction);registerEditorAction(AcceptInlineEdit);registerEditorAction(HideInlineEdit);const Context={Visible:new RawContextKey("parameterHintsVisible",!1),MultipleSignatures:new RawContextKey("parameterHintsMultipleSignatures",!1)};async function provideSignatureHelp(n,e,t,i,s){const r=n.ordered(e);for(const o of r)try{const a=await o.provideSignatureHelp(e,t,s,i);if(a)return a}catch(a){onUnexpectedExternalError(a)}}CommandsRegistry.registerCommand("_executeSignatureHelpProvider",async(n,...e)=>{const[t,i,s]=e;assertType(URI.isUri(t)),assertType(Position$1.isIPosition(i)),assertType(typeof s=="string"||!s);const r=n.get(ILanguageFeaturesService),o=await n.get(ITextModelService).createModelReference(t);try{const a=await provideSignatureHelp(r.signatureHelpProvider,o.object.textEditorModel,Position$1.lift(i),{triggerKind:SignatureHelpTriggerKind$1.Invoke,isRetrigger:!1,triggerCharacter:s},CancellationToken.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var ParameterHintState;(function(n){n.Default={type:0};class e{constructor(s,r){this.request=s,this.previouslyActiveHints=r,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(ParameterHintState||(ParameterHintState={}));const Kg=class Kg extends Disposable{constructor(e,t,i=Kg.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new Emitter$1),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=ParameterHintState.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new MutableDisposable),this.triggerChars=new CharacterSet,this.retriggerChars=new CharacterSet,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Delayer(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=ParameterHintState.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(onUnexpectedError)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(86).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(86).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new ParameterHintState.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(mergeTriggerContexts);this._pendingTriggers=[];const r={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new ParameterHintState.Pending(createCancelablePromise(l=>provideSignatureHelp(this.providers,o,a,r,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new ParameterHintState.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=ParameterHintState.Default),onUnexpectedError(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:SignatureHelpTriggerKind$1.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};Kg.DEFAULT_DELAY=120;let ParameterHintsModel=Kg;function mergeTriggerContexts(n,e){switch(e.triggerKind){case SignatureHelpTriggerKind$1.Invoke:return e;case SignatureHelpTriggerKind$1.ContentChange:return n;case SignatureHelpTriggerKind$1.TriggerCharacter:default:return e}}const parameterHints="";var __decorate$r=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$r=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ParameterHintsWidget_1;const $=$$e,parameterHintsNextIcon=registerIcon("parameter-hints-next",Codicon.chevronDown,localize("parameterHintsNextIcon","Icon for show next parameter hint.")),parameterHintsPreviousIcon=registerIcon("parameter-hints-previous",Codicon.chevronUp,localize("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var nd;let ParameterHintsWidget=(nd=class extends Disposable{constructor(e,t,i,s,r,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new DisposableStore),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new MarkdownRenderer({editor:e},r,s)),this.keyVisible=Context.Visible.bindTo(i),this.keyMultipleSignatures=Context.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=$(".editor-widget.parameter-hints-widget"),t=append$1(e,$(".phwrapper"));t.tabIndex=-1;const i=append$1(t,$(".controls")),s=append$1(i,$(".button"+ThemeIcon.asCSSSelector(parameterHintsPreviousIcon))),r=append$1(i,$(".overloads")),o=append$1(i,$(".button"+ThemeIcon.asCSSSelector(parameterHintsNextIcon)));this._register(addDisposableListener(s,"click",f=>{EventHelper.stop(f),this.previous()})),this._register(addDisposableListener(o,"click",f=>{EventHelper.stop(f),this.next()}));const a=$(".body"),l=new DomScrollableElement(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=append$1(a,$(".signature")),d=append$1(a,$(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:r,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(f=>{this.visible&&this.editor.layoutContentWidget(this)}));const u=()=>{if(!this.domNodes)return;const f=this.editor.getOption(50),g=this.domNodes.element;g.style.fontSize=`${f.fontSize}px`,g.style.lineHeight=`${f.lineHeight/f.fontSize}`,g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",f.fontFamily),g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",EDITOR_FONT_DEFAULTS.fontFamily)};u(),this._register(Event$1.chain(this.editor.onDidChangeConfiguration.bind(this.editor),f=>f.filter(g=>g.hasChanged(50)))(u)),this._register(this.editor.onDidLayoutChange(f=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)==null||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)==null||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=append$1(this.domNodes.signature,$(".code")),r=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(r)this.renderParameters(s,i,o);else{const c=append$1(s,$("span"));c.textContent=i.label}const a=i.parameters[o];if(a!=null&&a.documentation){const c=$("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);c.appendChild(d.element)}append$1(this.domNodes.docs,$("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")append$1(this.domNodes.docs,$("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);append$1(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const d=i.parameters[o];Array.isArray(d.label)?c=i.label.substring(d.label[0],d.label[1]):c=d.label,d.documentation&&(c+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(alert$1(localize("hint","{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new StopWatch,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var r;(r=this.domNodes)==null||r.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const s=t.elapsed();return s>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:s}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&assertIsDefined(t.documentation).length>0||t&&typeof t.documentation=="object"&&assertIsDefined(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&assertIsDefined(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&assertIsDefined(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,r]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),append$1(e,o,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${escapeRegExpCharacters(i.label)}(?=\\W|$)`,"g");s.test(e.label);const r=s.lastIndex-i.label.length;return r>=0?[r,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return ParameterHintsWidget_1.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},ParameterHintsWidget_1=nd,nd.ID="editor.widget.parameterHintsWidget",nd);ParameterHintsWidget=ParameterHintsWidget_1=__decorate$r([__param$r(2,IContextKeyService),__param$r(3,IOpenerService),__param$r(4,ILanguageService),__param$r(5,ITelemetryService)],ParameterHintsWidget);registerColor("editorHoverWidget.highlightForeground",listHighlightForeground,localize("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var __decorate$q=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$q=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ParameterHintsController_1,sd;let ParameterHintsController=(sd=class extends Disposable{static get(e){return e.getContribution(ParameterHintsController_1.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new ParameterHintsModel(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var r;s?(this.widget.value.show(),this.widget.value.render(s)):(r=this.widget.rawValue)==null||r.hide()})),this.widget=new Lazy(()=>this._register(t.createInstance(ParameterHintsWidget,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},ParameterHintsController_1=sd,sd.ID="editor.controller.parameterHints",sd);ParameterHintsController=ParameterHintsController_1=__decorate$q([__param$q(1,IInstantiationService),__param$q(2,ILanguageFeaturesService)],ParameterHintsController);class TriggerParameterHintsAction extends EditorAction{constructor(){super({id:"editor.action.triggerParameterHints",label:localize("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:EditorContextKeys.hasSignatureHelpProvider,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=ParameterHintsController.get(t);i==null||i.trigger({triggerKind:SignatureHelpTriggerKind$1.Invoke})}}registerEditorContribution(ParameterHintsController.ID,ParameterHintsController,2);registerEditorAction(TriggerParameterHintsAction);const weight$1=100+75,ParameterHintsCommand=EditorCommand.bindToContribution(ParameterHintsController.get);registerEditorCommand(new ParameterHintsCommand({id:"closeParameterHints",precondition:Context.Visible,handler:n=>n.cancel(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}}));registerEditorCommand(new ParameterHintsCommand({id:"showPrevParameterHint",precondition:ContextKeyExpr.and(Context.Visible,Context.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));registerEditorCommand(new ParameterHintsCommand({id:"showNextParameterHint",precondition:ContextKeyExpr.and(Context.Visible,Context.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:weight$1,kbExpr:EditorContextKeys.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));const placeholderText="";var __decorate$p=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$p=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class BaseClass{constructor(e){this.instantiationService=e}init(...e){}}function createWrapper(n,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=autorunWithStore((s,r)=>{const o=readHotReloadableExport(n(),s);r.add(this.instantiationService.createInstance(o,...i))})}dispose(){var i;(i=this._autorun)==null||i.dispose()}}}function wrapInReloadableClass1(n){return isHotReloadEnabled()?createWrapper(n,BaseClass1):n()}let BaseClass1=class extends BaseClass{constructor(e,t){super(t),this.init(e)}};BaseClass1=__decorate$p([__param$p(1,IInstantiationService)],BaseClass1);registerEditorContribution(PlaceholderTextContribution.ID,wrapInReloadableClass1(()=>PlaceholderTextContribution),0);registerColor("editor.placeholder.foreground",ghostTextForeground,localize("placeholderForeground","Foreground color of the placeholder text in the editor."));const renameWidget="";var __decorate$o=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$o=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const CONTEXT_RENAME_INPUT_VISIBLE=new RawContextKey("renameInputVisible",!1,localize("renameInputVisible","Whether the rename input widget is visible"));new RawContextKey("renameInputFocused",!1,localize("renameInputFocused","Whether the rename input widget is focused"));let RenameWidget=class{constructor(e,t,i,s,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new DisposableStore,this._visibleContextKey=CONTEXT_RENAME_INPUT_VISIBLE.bindTo(r),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new StopWatch,this._inputWithButton=new InputWithButton,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new RenameCandidateListView(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(widgetShadow),i=e.getColor(widgetBorder);this._domNode.style.backgroundColor=String(e.getColor(editorWidgetBackground)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(inputForeground)??"");const s=e.getColor(inputBorder);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(inputBackground)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(inputBackground)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=(s==null?void 0:s.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;assertType(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(50);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=getClientArea(this.getDomNode().ownerDocument.body),t=getDomNodePagePosition(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(67),{totalHeight:r}=RenameCandidateView.getLayoutInfo({lineHeight:s}),o=this._nPxAvailableBelow>r*6?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){var i,s;const[e,t]=this._acceptKeybindings;return this._label.innerText=localize({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(s=this._keybindingService.lookupKeybinding(t))==null?void 0:s.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;assertType(this._renameCandidateListView),assertType(this._nPxAvailableAbove!==void 0),assertType(this._nPxAvailableBelow!==void 0);const t=getTotalHeight(this._inputWithButton.domNode),i=getTotalHeight(this._label);let s;e===2?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:getTotalWidth(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,r){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=r;const l=new DisposableStore;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),l.add(addDisposableListener(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(addDisposableListener(this._inputWithButton.button,EventType$1.KEY_DOWN,d=>{const u=new StandardKeyboardEvent(d);(u.equals(3)||u.equals(10))&&(u.stopPropagation(),u.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new Position$1(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(toDisposable(()=>{this._renameCts=void 0,r.dispose(!0)})),l.add(toDisposable(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(toDisposable(()=>this._candidates.clear()));const c=new DeferredPromise;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=d=>{var u;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(u=this._renameCandidateListView)==null||u.clearCandidates(),c.complete(d),!0},this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),assertType(this._renameCandidateListView!==void 0);const u=this._renameCandidateListView.nCandidates;let f,g;const m=this._renameCandidateListView.focusedCandidate;if(m!==void 0?(this._trace("using new name from renameSuggestion"),f=m,g={k:"renameSuggestion"}):(this._trace("using new name from inputField"),f=this._inputWithButton.input.value,g=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),f===t||f.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:f,wantsPreview:i&&d,stats:{source:g,nRenameSuggestions:u,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(r.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var d;return this.cancelInput(!((d=this._domNode)!=null&&d.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),assertType(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new CancellationTokenSource$1;const i=t?NewSymbolNameTriggerKind$1.Invoke:NewSymbolNameTriggerKind$1.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){assertType(this._editor.hasModel());const i=this._editor.getSelection();let s=0,r=t.length;return!Range$2.isEmpty(i)&&!Range$2.spansMultipleLines(i)&&Range$2.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),r=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:r}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...c)=>this._trace("_updateRenameCandidates",...c);s("start");const r=await raceCancellation(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),r===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const o=r.flatMap(c=>c.status==="fulfilled"&&isDefined(c.value)?c.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=distinct(o,c=>c.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(s(`valid distinct candidates - ${o.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(l),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};RenameWidget=__decorate$o([__param$o(2,IThemeService),__param$o(3,IKeybindingService),__param$o(4,IContextKeyService),__param$o(5,ILogService)],RenameWidget);class RenameCandidateListView{constructor(e,t){this._disposables=new DisposableStore,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=RenameCandidateListView._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(getListStyles({listInactiveFocusForeground:quickInputListFocusForeground,listInactiveFocusBackground:quickInputListFocusBackground}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,status(localize("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=RenameCandidateView.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e,i=7;return Math.min(t,this._availableHeight,this._candidateViewHeight*i)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,4+16+5+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(o){return"candidate"}getHeight(o){return t}},r=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new RenameCandidateView(o,i)}renderElement(o,a,l){l.populate(o)}disposeTemplate(o){o.dispose()}};return new List("NewSymbolNameCandidates",e,s,[r],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class InputWithButton{constructor(){this._onDidInputChange=new Emitter$1,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new DisposableStore}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",localize("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=localize("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=localize("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(addDisposableListener(this.input,EventType$1.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(addDisposableListener(this.input,EventType$1.KEY_DOWN,e=>{const t=new StandardKeyboardEvent(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(addDisposableListener(this.input,EventType$1.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(addDisposableListener(this.input,EventType$1.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(addDisposableListener(this.input,EventType$1.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return assertType(this._inputNode),this._inputNode}get button(){return assertType(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e;this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=renderIcon(Codicon.sparkle)),clearNode(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e;this._buttonState="stop",this._stopIcon??(this._stopIcon=renderIcon(Codicon.primitiveSquare)),clearNode(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const lu=class lu{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${lu._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=renderIcon(Codicon.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),applyFontInfo(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(NewSymbolNameTag$1.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+lu._PADDING*2}}dispose(){}};lu._PADDING=2;let RenameCandidateView=lu;var __decorate$n=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$n=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},RenameController_1;class RenameSkeleton{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`):void 0}:{range:Range$2.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` +`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,s){const r=this._providers[t];if(!r)return{edits:[],rejectReason:i.join(` +`)};const o=await r.provideRenameEdits(this.model,this.position,e,s);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(localize("no result","No result.")),s);return o}}async function rename(n,e,t,i){const s=new RenameSkeleton(e,t,n),r=await s.resolveRenameLocation(CancellationToken.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:s.provideRenameEdits(i,CancellationToken.None)}var rd;let RenameController=(rd=class{static get(e){return e.getContribution(RenameController_1.ID)}constructor(e,t,i,s,r,o,a,l,c){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new DisposableStore,this._cts=new CancellationTokenSource$1,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(RenameWidget,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var m,_;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new CancellationTokenSource$1,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new RenameSkeleton(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new EditorStateCancellationTokenSource(this.editor,5,void 0,this._cts.token);let r;try{e("resolving rename location");const v=i.resolveRenameLocation(s.token);this._progressService.showWhile(v,250),r=await v,e("resolved rename location")}catch(v){v instanceof CancellationError?e("resolve rename location cancelled",JSON.stringify(v,null," ")):(e("resolve rename location failed",v instanceof Error?v:JSON.stringify(v,null," ")),(typeof v=="string"||isMarkdownString(v))&&((m=MessageController.get(this.editor))==null||m.showMessage(v||localize("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{s.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),(_=MessageController.get(this.editor))==null||_.showMessage(r.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new EditorStateCancellationTokenSource(this.editor,5,r.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async v=>[v,await v.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(v,C)=>{let S=c.slice();return v===NewSymbolNameTriggerKind$1.Automatic&&(S=S.filter(([w,L])=>L)),S.map(([w])=>w.provideNewSymbolNames(a,r.range,v,C))};e("creating rename input field and awaiting its result");const u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),f=await this._renameWidget.getInput(r.range,r.text,u,l.length>0?d:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),f),typeof f=="boolean"){e(`returning early - rename input field response - ${f}`),f&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const g=raceCancellation(i.provideRenameEdits(f.newName,o.token),o.token).then(async v=>{if(!v){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(v.rejectReason){e(`returning early - rejected with reason: ${v.rejectReason}`),this._notificationService.info(v.rejectReason);return}this.editor.setSelection(Range$2.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(v,{editor:this.editor,showPreview:f.wantsPreview,label:localize("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,f.newName),code:"undoredo.rename",quotableLabel:localize("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,f.newName),respectAutoSaveConfig:!0}).then(C=>{e("edits applied"),C.ariaSummary&&alert$1(localize("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,f.newName,C.ariaSummary))}).catch(C=>{e(`error when applying edits ${JSON.stringify(C,null," ")}`),this._notificationService.error(localize("rename.failedApply","Rename failed to apply edits")),this._logService.error(C)})},v=>{e("error when providing rename edits",JSON.stringify(v,null," ")),this._notificationService.error(localize("rename.failed","Rename failed to compute edits")),this._logService.error(v)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(g,250),g}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const s=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",s)}},RenameController_1=rd,rd.ID="editor.contrib.renameController",rd);RenameController=RenameController_1=__decorate$n([__param$n(1,IInstantiationService),__param$n(2,INotificationService),__param$n(3,IBulkEditService),__param$n(4,IEditorProgressService),__param$n(5,ILogService),__param$n(6,ITextResourceConfigurationService),__param$n(7,ILanguageFeaturesService),__param$n(8,ITelemetryService)],RenameController);class RenameAction extends EditorAction{constructor(){super({id:"editor.action.rename",label:localize("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ContextKeyExpr.and(EditorContextKeys.writable,EditorContextKeys.hasRenameProvider),kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(ICodeEditorService),[s,r]=Array.isArray(t)&&t||[void 0,void 0];return URI.isUri(s)&&Position$1.isIPosition(r)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},onUnexpectedError):super.runCommand(e,t)}run(e,t){const i=e.get(ILogService),s=RenameController.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}registerEditorContribution(RenameController.ID,RenameController,4);registerEditorAction(RenameAction);const RenameCommand=EditorCommand.bindToContribution(RenameController.get);registerEditorCommand(new RenameCommand({id:"acceptRenameInput",precondition:CONTEXT_RENAME_INPUT_VISIBLE,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,ContextKeyExpr.not("isComposing")),primary:3}}));registerEditorCommand(new RenameCommand({id:"acceptRenameInputWithPreview",precondition:ContextKeyExpr.and(CONTEXT_RENAME_INPUT_VISIBLE,ContextKeyExpr.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:ContextKeyExpr.and(EditorContextKeys.focus,ContextKeyExpr.not("isComposing")),primary:2048+3}}));registerEditorCommand(new RenameCommand({id:"cancelRenameInput",precondition:CONTEXT_RENAME_INPUT_VISIBLE,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:EditorContextKeys.focus,primary:9,secondary:[1033]}}));registerAction2(class extends Action2{constructor(){super({id:"focusNextRenameSuggestion",title:{...localize2("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:CONTEXT_RENAME_INPUT_VISIBLE,keybinding:[{primary:18,weight:100+99}]})}run(e){const t=e.get(ICodeEditorService).getFocusedCodeEditor();if(!t)return;const i=RenameController.get(t);i&&i.focusNextRenameSuggestion()}});registerAction2(class extends Action2{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...localize2("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:CONTEXT_RENAME_INPUT_VISIBLE,keybinding:[{primary:16,weight:100+99}]})}run(e){const t=e.get(ICodeEditorService).getFocusedCodeEditor();if(!t)return;const i=RenameController.get(t);i&&i.focusPreviousRenameSuggestion()}});registerModelAndPositionCommand("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;assertType(typeof s=="string");const{renameProvider:r}=n.get(ILanguageFeaturesService);return rename(r,e,t,s)});registerModelAndPositionCommand("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(ILanguageFeaturesService),r=await new RenameSkeleton(e,t,i).resolveRenameLocation(CancellationToken.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r});Registry.as(Extensions$6.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:localize("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var __decorate$m=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$m=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_u;let SectionHeaderDetector=(_u=class extends Disposable{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{var o;const r=(o=this.editor.getModel())==null?void 0:o.getLanguageId();r&&s.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new RunOnceScheduler(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(s!=null&&s.markers)))return{foldingRules:s,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,s;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((s=this.options)!=null&&s.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(r=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(r)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),s=e.map(r=>decoration(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,l=o.length;a0?t[0]:[]}async function getDocumentSemanticTokens(n,e,t,i,s){const r=getDocumentSemanticTokensProviders(n,e),o=await Promise.all(r.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){c=d,l=null}return(!l||!isSemanticTokens(l)&&!isSemanticTokensEdits(l))&&(l=null),new DocumentSemanticTokensResult(a,l,c)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function _getDocumentSemanticTokensProviderHighestGroup(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class DocumentRangeSemanticTokensResult{constructor(e,t){this.provider=e,this.tokens=t}}function hasDocumentRangeSemanticTokensProvider(n,e){return n.has(e)}function getDocumentRangeSemanticTokensProviders(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function getDocumentRangeSemanticTokens(n,e,t,i){const s=getDocumentRangeSemanticTokensProviders(n,e),r=await Promise.all(s.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){onUnexpectedExternalError(l),a=null}return(!a||!isSemanticTokens(a))&&(a=null),new DocumentRangeSemanticTokensResult(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}CommandsRegistry.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;assertType(t instanceof URI);const i=n.get(IModelService).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ILanguageFeaturesService),r=_getDocumentSemanticTokensProviderHighestGroup(s,i);return r?r[0].getLegend():n.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});CommandsRegistry.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;assertType(t instanceof URI);const i=n.get(IModelService).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(ILanguageFeaturesService);if(!hasDocumentSemanticTokensProvider(s,i))return n.get(ICommandService).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await getDocumentSemanticTokens(s,i,null,null,CancellationToken.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!isSemanticTokens(a))return;const l=encodeSemanticTokensDto({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;assertType(t instanceof URI);const s=n.get(IModelService).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:r}=n.get(ILanguageFeaturesService),o=getDocumentRangeSemanticTokensProviders(r,s);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!Range$2.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await getDocumentRangeSemanticTokens(r,s,Range$2.lift(i),CancellationToken.None);if(a)return a.provider.getLegend()});CommandsRegistry.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;assertType(t instanceof URI),assertType(Range$2.isIRange(i));const s=n.get(IModelService).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:r}=n.get(ILanguageFeaturesService),o=await getDocumentRangeSemanticTokens(r,s,Range$2.lift(i),CancellationToken.None);if(!(!o||!o.tokens))return encodeSemanticTokensDto({id:0,type:"full",data:o.tokens.data})});const SEMANTIC_HIGHLIGHTING_SETTING_ID="editor.semanticHighlighting";function isSemanticColoringEnabled(n,e,t){var s;const i=(s=t.getValue(SEMANTIC_HIGHLIGHTING_SETTING_ID,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))==null?void 0:s.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var __decorate$l=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$l=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ModelSemanticColoring_1;let DocumentSemanticTokensFeature=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._watchers=Object.create(null);const a=d=>{this._watchers[d.uri.toString()]=new ModelSemanticColoring(d,e,i,r,o)},l=(d,u)=>{u.dispose(),delete this._watchers[d.uri.toString()]},c=()=>{for(const d of t.getModels()){const u=this._watchers[d.uri.toString()];isSemanticColoringEnabled(d,i,s)?u||a(d):u&&l(d,u)}};t.getModels().forEach(d=>{isSemanticColoringEnabled(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{isSemanticColoringEnabled(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const u=this._watchers[d.uri.toString()];u&&l(d,u)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};DocumentSemanticTokensFeature=__decorate$l([__param$l(0,ISemanticTokensStylingService),__param$l(1,IModelService),__param$l(2,IThemeService),__param$l(3,IConfigurationService),__param$l(4,ILanguageFeatureDebounceService),__param$l(5,ILanguageFeaturesService)],DocumentSemanticTokensFeature);var Ma;let ModelSemanticColoring=(Ma=class extends Disposable{constructor(e,t,i,s,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:ModelSemanticColoring_1.REQUEST_MIN_DELAY,max:ModelSemanticColoring_1.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new RunOnceScheduler(()=>this._fetchDocumentSemanticTokensNow(),ModelSemanticColoring_1.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const o=()=>{dispose(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),dispose(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!hasDocumentSemanticTokensProvider(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new CancellationTokenSource$1,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=getDocumentSemanticTokens(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(l=>{r.push(l)}),a=new StopWatch(!1);s.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:c,tokens:d}=l,u=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,u,r)}},l=>{l&&(isCancellationError(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||onUnexpectedError(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,r){r=Math.min(r,i.length-s,e.length-t);for(let o=0;o{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(isSemanticTokensEdits(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const f of t.edits)a+=(f.data?f.data.length:0)-f.deleteCount;const l=r.data,c=new Uint32Array(l.length+a);let d=l.length,u=c.length;for(let f=t.edits.length-1;f>=0;f--){const g=t.edits[f];if(g.start>l.length){i.warnInvalidEditStart(r.resultId,t.resultId,f,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const m=d-(g.start+g.deleteCount);m>0&&(ModelSemanticColoring_1._copy(l,d-m,c,u-m,m),u-=m),g.data&&(ModelSemanticColoring_1._copy(g.data,0,c,u-g.data.length,g.data.length),u-=g.data.length),d=g.start}d>0&&ModelSemanticColoring_1._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(isSemanticTokens(t)){this._currentDocumentResponse=new SemanticTokensResponse(e,t.resultId,t.data);const a=toMultilineTokens2(t,i,this._model.getLanguageId());if(s.length>0)for(const l of s)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},ModelSemanticColoring_1=Ma,Ma.REQUEST_MIN_DELAY=300,Ma.REQUEST_MAX_DELAY=2e3,Ma);ModelSemanticColoring=ModelSemanticColoring_1=__decorate$l([__param$l(1,ISemanticTokensStylingService),__param$l(2,IThemeService),__param$l(3,ILanguageFeatureDebounceService),__param$l(4,ILanguageFeaturesService)],ModelSemanticColoring);class SemanticTokensResponse{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}registerEditorFeature(DocumentSemanticTokensFeature);var __decorate$k=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$k=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},bu;let ViewportSemanticTokensContribution=(bu=class extends Disposable{constructor(e,t,i,s,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new RunOnceScheduler(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(SEMANTIC_HIGHLIGHTING_SETTING_ID)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=createCancelablePromise(o=>Promise.resolve(getDocumentRangeSemanticTokens(this._provider,e,t,o))),r=new StopWatch(!1);return s.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,toMultilineTokens2(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},bu.ID="editor.contrib.viewportSemanticTokens",bu);ViewportSemanticTokensContribution=__decorate$k([__param$k(1,ISemanticTokensStylingService),__param$k(2,IThemeService),__param$k(3,IConfigurationService),__param$k(4,ILanguageFeatureDebounceService),__param$k(5,ILanguageFeaturesService)],ViewportSemanticTokensContribution);registerEditorContribution(ViewportSemanticTokensContribution.ID,ViewportSemanticTokensContribution,1);class WordSelectionRangeProvider{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,s),this._addWordRanges(r,e,s),this._addWhitespaceLine(r,e,s),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:r,startColumn:o}=s,a=i.column-o;let l=a,c=a,d=0;for(;l>=0;l--){const u=r.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(isLowerAsciiLetter(u)&&isUpperAsciiLetter(d))break;d=u}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new Range$2(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var __decorate$j=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$j=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},SmartSelectController_1;class SelectionRanges{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new SelectionRanges(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var od;let SmartSelectController=(od=class{static get(e){return e.getContribution(SmartSelectController_1.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await provideSelectionRanges(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(114),CancellationToken.None).then(r=>{var o;if(!(!isNonEmptyArray(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!equals$1(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new SelectionRanges(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(r=>r.mov(e));const s=this._state.map(r=>Selection$1.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},SmartSelectController_1=od,od.ID="editor.contrib.smartSelectController",od);SmartSelectController=SmartSelectController_1=__decorate$j([__param$j(1,ILanguageFeaturesService)],SmartSelectController);class AbstractSmartSelect extends EditorAction{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=SmartSelectController.get(t);i&&await i.run(this._forward)}}class GrowSelectionAction extends AbstractSmartSelect{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:localize("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}CommandsRegistry.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class ShrinkSelectionAction extends AbstractSmartSelect{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:localize("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:MenuId.MenubarSelectionMenu,group:"1_basic",title:localize({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}registerEditorContribution(SmartSelectController.ID,SmartSelectController,4);registerEditorAction(GrowSelectionAction);registerEditorAction(ShrinkSelectionAction);async function provideSelectionRanges(n,e,t,i,s){const r=n.all(e).concat(new WordSelectionRangeProvider(i.selectSubwords));r.length===1&&r.unshift(new BracketSelectionRangeProvider);const o=[],a=[];for(const l of r)o.push(Promise.resolve(l.provideSelectionRanges(e,t,s)).then(c=>{if(isNonEmptyArray(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((f,g)=>Position$1.isBefore(f.getStartPosition(),g.getStartPosition())?1:Position$1.isBefore(g.getStartPosition(),f.getStartPosition())||Position$1.isBefore(f.getEndPosition(),g.getEndPosition())?-1:Position$1.isBefore(g.getEndPosition(),f.getEndPosition())?1:0);const c=[];let d;for(const f of l)(!d||Range$2.containsRange(f,d)&&!Range$2.equalsRange(f,d))&&(c.push(f),d=f);if(!i.selectLeadingAndTrailingWhitespace)return c;const u=[c[0]];for(let f=1;fn}),STICKY_INDEX_ATTR="data-sticky-line-index",STICKY_IS_LINE_ATTR="data-sticky-is-line",STICKY_IS_LINE_NUMBER_ATTR="data-sticky-is-line-number",STICKY_IS_FOLDING_ICON_ATTR="data-sticky-is-folding-icon";class StickyScrollWidget extends Disposable{constructor(e){super(),this._editor=e,this._foldingIconStore=new DisposableStore,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof EmbeddedCodeEditorWidget),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const s=this._isWidgetHeightZero(e),r=s?void 0:e,o=s?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,s=e.startLineNumbers.findIndex(r=>!i.startLineNumbers.includes(r));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;ta.scrollWidth))+s.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(addDisposableListener(this._lineNumbersDomNode,EventType$1.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(addDisposableListener(this._lineNumbersDomNode,EventType$1.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s){const r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new Position$1(t,1)).lineNumber,a=r.getViewLineRenderingData(o),l=this._editor.getOption(68);let c;try{c=LineDecoration.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{c=[]}const d=new RenderLineInput(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),u=new StringBuilder(2e3),f=renderViewLine(d,u);let g;_ttPolicy?g=_ttPolicy.createHTML(u.build()):g=u.build();const m=document.createElement("span");m.setAttribute(STICKY_INDEX_ATTR,String(e)),m.setAttribute(STICKY_IS_LINE_ATTR,""),m.setAttribute("role","listitem"),m.tabIndex=0,m.className="sticky-line-content",m.classList.add(`stickyLine${t}`),m.style.lineHeight=`${this._lineHeight}px`,m.innerHTML=g;const _=document.createElement("span");_.setAttribute(STICKY_INDEX_ATTR,String(e)),_.setAttribute(STICKY_IS_LINE_NUMBER_ATTR,""),_.className="sticky-line-number",_.style.lineHeight=`${this._lineHeight}px`;const v=s.contentLeft;_.style.width=`${v}px`;const C=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?C.innerText=t.toString():l.renderType===2&&(C.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),C.className="sticky-line-number-inner",C.style.lineHeight=`${this._lineHeight}px`,C.style.width=`${s.lineNumbersWidth}px`,C.style.paddingLeft=`${s.lineNumbersLeft}px`,_.appendChild(C);const S=this._renderFoldingIconForLine(i,t);S&&_.appendChild(S.domNode),this._editor.applyFontInfo(m),this._editor.applyFontInfo(C),_.style.lineHeight=`${this._lineHeight}px`,m.style.lineHeight=`${this._lineHeight}px`,_.style.height=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`;const w=new RenderedStickyLine(e,t,m,_,S,f.characterMapping,m.scrollWidth);return this._updateTopAndZIndexOfStickyLine(w)}_updateTopAndZIndexOfStickyLine(e){var d;const t=e.index,i=e.lineDomNode,s=e.lineNumberDomNode,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,s.style.zIndex=r?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((d=e.foldingIcon)!=null&&d.isCollapsed?1:0)}px`,c=`${t*this._lineHeight}px`;return i.style.top=r?l:c,s.style.top=r?l:c,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const s=e.regions,r=s.findRange(t),o=s.getStartLineNumber(r);if(!(t===o))return;const l=s.isCollapsed(r),c=new StickyFoldingIcon(l,o,s.getEndLineNumber(r),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(STICKY_IS_FOLDING_ICON_ATTR,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=getColumnOfNodeOffset(t.characterMapping,e,0);return new Position$1(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,STICKY_INDEX_ATTR);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,STICKY_IS_LINE_ATTR)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,STICKY_IS_FOLDING_ICON_ATTR)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class RenderedStickyLine{constructor(e,t,i,s,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class StickyFoldingIcon{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width=`${s}px`,this.domNode.style.height=`${s}px`,this.domNode.className=ThemeIcon.asClassName(e?foldingCollapsedIcon:foldingExpandedIcon)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class StickyRange{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class StickyElement{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class StickyModel{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var __decorate$i=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ModelProvider;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(ModelProvider||(ModelProvider={}));var Status;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(Status||(Status={}));let StickyModelProvider=class extends Disposable{constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Delayer(300)),this._updateOperation=this._register(new DisposableStore),this._editor.getOption(116).defaultModel){case ModelProvider.OUTLINE_MODEL:this._modelProviders.push(new StickyModelFromCandidateOutlineProvider(this._editor,s));case ModelProvider.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new StickyModelFromCandidateSyntaxFoldingProvider(this._editor,t,s));case ModelProvider.INDENTATION_MODEL:this._modelProviders.push(new StickyModelFromCandidateIndentationFoldingProvider(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const r=await i;if(this._modelPromise!==s)return null;switch(r){case Status.CANCELED:return this._updateOperation.clear(),null;case Status.VALID:return t.stickyModel}}return null}).catch(t=>(onUnexpectedError(t),null))}};StickyModelProvider=__decorate$i([__param$i(2,IInstantiationService),__param$i(3,ILanguageFeaturesService)],StickyModelProvider);class StickyModelCandidateProvider extends Disposable{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,Status.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=createCancelablePromise(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?Status.CANCELED:(this._stickyModel=this.createStickyModel(e,i),Status.VALID):this._invalid()).then(void 0,i=>(onUnexpectedError(i),Status.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let StickyModelFromCandidateOutlineProvider=class extends StickyModelCandidateProvider{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return OutlineModel.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),r=this._editor.getModel();return new StickyModel(r.uri,r.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Iterable.first(e.children.values())instanceof OutlineGroup){const a=Iterable.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[u,f]of e.children.entries()){const g=this._findSumOfRangesOfGroup(f);g>c&&(d=f,c=g,l=f.id)}t=l,i=d.children}}else i=e.children;const s=[],r=Array.from(i.values()).sort((a,l)=>{const c=new StickyRange(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new StickyRange(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of r)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new StickyElement(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const s=new StickyRange(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new StickyElement(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof OutlineElement?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};StickyModelFromCandidateOutlineProvider=__decorate$i([__param$i(1,ILanguageFeaturesService)],StickyModelFromCandidateOutlineProvider);class StickyModelFromCandidateFoldingProvider extends StickyModelCandidateProvider{constructor(e){super(e),this._foldingLimitReporter=new RangesLimitReporter(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new StickyModel(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new StickyElement(void 0,[],void 0);for(let r=0;r0&&(this.provider=this._register(new SyntaxRangeProvider(e.getModel(),s,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};StickyModelFromCandidateSyntaxFoldingProvider=__decorate$i([__param$i(2,ILanguageFeaturesService)],StickyModelFromCandidateSyntaxFoldingProvider);var __decorate$h=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$h=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class StickyLineCandidate{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let StickyLineCandidateProvider=class extends Disposable{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new Emitter$1),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new DisposableStore),this._updateSoon=this._register(new RunOnceScheduler(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(toDisposable(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new StickyModelProvider(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new CancellationTokenSource$1,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,r){if(t.children.length===0)return;let o=r;const a=[];for(let d=0;dd-u)),c=this.updateIndex(binarySearch(a,e.startLineNumber+s,(d,u)=>d-u));for(let d=l;d<=c;d++){const u=t.children[d];if(!u)return;if(u.range){const f=u.range.startLineNumber,g=u.range.endLineNumber;e.startLineNumber<=g+1&&f-1<=e.endLineNumber&&f!==o&&(o=f,i.push(new StickyLineCandidate(f,g-1,s+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s+1,f))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,s,r)}}getCandidateStickyLinesIntersecting(e){var s,r;if(!((s=this._model)!=null&&s.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};StickyLineCandidateProvider=__decorate$h([__param$h(1,ILanguageFeaturesService),__param$h(2,ILanguageConfigurationService)],StickyLineCandidateProvider);var __decorate$g=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$g=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},StickyScrollController_1,ad;let StickyScrollController=(ad=class extends Disposable{constructor(e,t,i,s,r,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new DisposableStore,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new StickyScrollWidget(this._editor),this._stickyLineCandidateProvider=new StickyLineCandidateProvider(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=StickyScrollWidgetState.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(addDisposableListener(l,EventType$1.CONTEXT_MENU,async d=>{this._onContextMenu(getWindow(l),d)})),this._stickyScrollFocusedContextKey=EditorContextKeys.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=EditorContextKeys.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(trackFocus(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(addDisposableListener(l,EventType$1.MOUSE_DOWN,d=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(StickyScrollController_1.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new DisposableStore,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(Range$2.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new DisposableStore),t=this._register(new ClickLinkGesture(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new Range$2(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},s=this._stickyScrollWidget.getDomNode();this._register(addStandardDisposableListener(s,EventType$1.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(c===null)return;const d=new Position$1(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(c===null)return;l=new Position$1(c,1)}this._revealPosition(l)})),this._register(addStandardDisposableListener(s,EventType$1.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(addDisposableListener(s,EventType$1.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new CancellationTokenSource$1;e.add(toDisposable(()=>d.dispose(!0)));let u;getDefinitionsAtPosition(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Position$1(l.startLineNumber,l.startColumn+1),!1,d.token).then(f=>{if(!d.token.isCancellationRequested)if(f.length!==0){this._candidateDefinitionsLength=f.length;const g=c;u!==g?(e.clear(),u=g,u.style.textDecoration="underline",e.add(toDisposable(()=>{u.style.textDecoration="none"}))):u||(u=g,u.style.textDecoration="underline",e.add(toDisposable(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async r=>{if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(goToDefinitionWithLocation,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new StandardMouseEvent(e,t);this._contextMenuService.showContextMenu({menuId:MenuId.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;toggleCollapseState(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),s=this._stickyLineCandidateProvider.getVersionId();if(s===void 0||s===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=FoldingController.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=StickyScrollWidgetState.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let s=0;const r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new StickyRange(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const d of c){const u=d.startLineNumber,f=d.endLineNumber,g=d.nestingDepth;if(f-u>0){const m=(g-1)*e,_=g*e,v=this._editor.getBottomForLineNumber(u)-i,C=this._editor.getTopForLineNumber(f)-i,S=this._editor.getBottomForLineNumber(f)-i;if(m>C&&m<=S){r.push(u),o.push(f+1),s=S-_;break}else _>v&&_<=S&&(r.push(u),o.push(f+1));if(r.length===t)break}}}return this._endLineNumbers=o,new StickyScrollWidgetState(r,o,s,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},StickyScrollController_1=ad,ad.ID="store.contrib.stickyScrollController",ad);StickyScrollController=StickyScrollController_1=__decorate$g([__param$g(1,IContextMenuService),__param$g(2,ILanguageFeaturesService),__param$g(3,IInstantiationService),__param$g(4,ILanguageConfigurationService),__param$g(5,ILanguageFeatureDebounceService),__param$g(6,IContextKeyService)],StickyScrollController);class ToggleStickyScroll extends Action2{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...localize2("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:localize({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:localize2("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Categories.View,toggled:{condition:ContextKeyExpr.equals("config.editor.stickyScroll.enabled",!0),title:localize("stickyScroll","Sticky Scroll"),mnemonicTitle:localize({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:MenuId.CommandPalette},{id:MenuId.MenubarAppearanceMenu,group:"4_editor",order:3},{id:MenuId.StickyScrollContext}]})}async run(e){const t=e.get(IConfigurationService),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const weight=100;class FocusStickyScroll extends EditorAction2{constructor(){super({id:"editor.action.focusStickyScroll",title:{...localize2("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:localize({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ContextKeyExpr.and(ContextKeyExpr.has("config.editor.stickyScroll.enabled"),EditorContextKeys.stickyScrollVisible),menu:[{id:MenuId.CommandPalette}]})}runEditorCommand(e,t){var i;(i=StickyScrollController.get(t))==null||i.focus()}}class SelectNextStickyScrollLine extends EditorAction2{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:localize2("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:EditorContextKeys.stickyScrollFocused.isEqualTo(!0),keybinding:{weight,primary:18}})}runEditorCommand(e,t){var i;(i=StickyScrollController.get(t))==null||i.focusNext()}}class SelectPreviousStickyScrollLine extends EditorAction2{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:localize2("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:EditorContextKeys.stickyScrollFocused.isEqualTo(!0),keybinding:{weight,primary:16}})}runEditorCommand(e,t){var i;(i=StickyScrollController.get(t))==null||i.focusPrevious()}}class GoToStickyScrollLine extends EditorAction2{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:localize2("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:EditorContextKeys.stickyScrollFocused.isEqualTo(!0),keybinding:{weight,primary:3}})}runEditorCommand(e,t){var i;(i=StickyScrollController.get(t))==null||i.goToFocused()}}class SelectEditor extends EditorAction2{constructor(){super({id:"editor.action.selectEditor",title:localize2("selectEditor.title","Select Editor"),precondition:EditorContextKeys.stickyScrollFocused.isEqualTo(!0),keybinding:{weight,primary:9}})}runEditorCommand(e,t){var i;(i=StickyScrollController.get(t))==null||i.selectEditor()}}registerEditorContribution(StickyScrollController.ID,StickyScrollController,1);registerAction2(ToggleStickyScroll);registerAction2(FocusStickyScroll);registerAction2(SelectPreviousStickyScrollLine);registerAction2(SelectNextStickyScrollLine);registerAction2(GoToStickyScrollLine);registerAction2(SelectEditor);var __decorate$f=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$f=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class SuggestInlineCompletion{constructor(e,t,i,s,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=r,this.completion=o}}let InlineCompletionResults=class extends RefCountedDisposable{constructor(e,t,i,s,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=o}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(CancellationToken.None)}return e}};InlineCompletionResults=__decorate$f([__param$f(5,ISuggestMemoryService)],InlineCompletionResults);let SuggestInlineCompletions=class extends Disposable{constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){var g;if(i.selectedSuggestionInfo)return;let r;for(const m of this._editorService.listCodeEditors())if(m.getModel()===e){r=m;break}if(!r)return;const o=r.getOption(90);if(QuickSuggestionsOptions.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(QuickSuggestionsOptions.valueFor(o,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let u;const f=e.getValueInRange(new Range$2(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((g=this._lastResult)!=null&&g.canBeReused(e,t.lineNumber,c))){const m=new LineContext$1(f,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=m,this._lastResult.acquire(),u=this._lastResult}else{const m=await provideSuggestionItems(this._languageFeatureService.completionProvider,e,t,new CompletionOptions(void 0,SuggestModel.createSuggestFilter(r).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let _;m.needsClipboard&&(_=await this._clipboardService.readText());const v=new CompletionModel(m.items,t.column,new LineContext$1(f,0),WordDistance.None,r.getOption(119),r.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},_);u=new InlineCompletionResults(e,t.lineNumber,c,v,m,this._suggestMemoryService)}return this._lastResult=u,u}handleItemDidShow(e,t){t.completion.resolve(CancellationToken.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var r;const i=e.getValueInRange(Range$2.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(r=o.triggerCharacters)!=null&&r.includes(i)&&s.add(o);if(s.size!==0)return{providers:s,ch:i}}};SuggestInlineCompletions=__decorate$f([__param$f(0,ILanguageFeaturesService),__param$f(1,IClipboardService),__param$f(2,ISuggestMemoryService),__param$f(3,ICodeEditorService)],SuggestInlineCompletions);registerEditorFeature(SuggestInlineCompletions);class ForceRetokenizeAction extends EditorAction{constructor(){super({id:"editor.action.forceRetokenize",label:localize("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new StopWatch;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}registerEditorAction(ForceRetokenizeAction);const jg=class jg extends Action2{constructor(){super({id:jg.ID,title:localize2({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:localize2("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!TabFocus.getTabFocusMode();TabFocus.setTabFocusMode(t),alert$1(t?localize("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):localize("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};jg.ID="editor.action.toggleTabFocusMode";let ToggleTabFocusModeAction=jg;registerAction2(ToggleTabFocusModeAction);const unicodeHighlighter="",bannerController="",link="";var __decorate$e=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Link=class extends Disposable{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},s,r){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=append$1(e,$$e("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??getDefaultHoverDelegate("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new DomEmitter(this.el,"click")),a=this._register(new DomEmitter(this.el,"keypress")),l=Event$1.chain(a.event,u=>u.map(f=>new StandardKeyboardEvent(f)).filter(f=>f.keyCode===3)),c=this._register(new DomEmitter(this.el,EventType.Tap)).event;this._register(Gesture.addTarget(this.el));const d=Event$1.any(o.event,l,c);this._register(d(u=>{this.enabled&&(EventHelper.stop(u,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Link=__decorate$e([__param$e(3,IHoverService),__param$e(4,IOpenerService)],Link);var __decorate$d=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$d=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const BANNER_ELEMENT_HEIGHT=26;let BannerController=class extends Disposable{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Banner))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,BANNER_ELEMENT_HEIGHT)}};BannerController=__decorate$d([__param$d(1,IInstantiationService)],BannerController);let Banner=class extends Disposable{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(MarkdownRenderer,{}),this.element=$$e("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=$$e("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){clearNode(this.element)}show(e){clearNode(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=append$1(this.element,$$e("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild($$e(`div${ThemeIcon.asCSSSelector(e.icon)}`));const s=append$1(this.element,$$e("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=append$1(this.element,$$e("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(Link,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=append$1(this.element,$$e("div.action-container"));this.actionBar=this._register(new ActionBar(r)),this.actionBar.push(this._register(new Action("banner.close","Close Banner",ThemeIcon.asClassName(widgetClose),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Banner=__decorate$d([__param$d(0,IInstantiationService)],Banner);var __decorate$c=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$c=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const warningIcon=registerIcon("extensions-warning-message",Codicon.warning,localize("warningIcon","Icon shown with a warning message in the extensions editor."));var vu;let UnicodeHighlighter=(vu=class extends Disposable{constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:localize("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new DisableHighlightingOfNonBasicAsciiCharactersAction};else if(r.ambiguousCharacterCount>=o)a={message:localize("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new DisableHighlightingOfAmbiguousCharactersAction};else if(r.invisibleCharacterCount>=o)a={message:localize("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new DisableHighlightingOfInvisibleCharactersAction};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:warningIcon,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(BannerController,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=resolveOptions(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?language:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new DocumentUnicodeHighlighter(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new ViewportUnicodeHighlighter(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},vu.ID="editor.contrib.unicodeHighlighter",vu);UnicodeHighlighter=__decorate$c([__param$c(1,IEditorWorkerService),__param$c(2,IWorkspaceTrustManagementService),__param$c(3,IInstantiationService)],UnicodeHighlighter);function resolveOptions(n,e){return{nonBasicASCII:e.nonBasicASCII===inUntrustedWorkspace?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===inUntrustedWorkspace?!n:e.includeComments,includeStrings:e.includeStrings===inUntrustedWorkspace?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let DocumentUnicodeHighlighter=class extends Disposable{constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new RunOnceScheduler(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:Decorations.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!isModelDecorationVisible(t,e))return null;const i=t.getValueInRange(e.range);return{reason:computeReason(i,this._options),inComment:isModelDecorationInComment(t,e),inString:isModelDecorationInString(t,e)}}};DocumentUnicodeHighlighter=__decorate$c([__param$c(3,IEditorWorkerService)],DocumentUnicodeHighlighter);class ViewportUnicodeHighlighter extends Disposable{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new RunOnceScheduler(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const r=UnicodeTextModelHighlighter.computeUnicodeHighlights(this._model,this._options,s);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:Decorations.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return isModelDecorationVisible(t,e)?{reason:computeReason(i,this._options),inComment:isModelDecorationInComment(t,e),inString:isModelDecorationInString(t,e)}:null}}const configureUnicodeHighlightOptionsStr=localize("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let UnicodeHighlighterHoverParticipant=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=this._editor.getContribution(UnicodeHighlighter.ID);if(!s)return[];const r=[],o=new Set;let a=300;for(const l of t){const c=s.getDecorationInfo(l);if(!c)continue;const u=i.getValueInRange(l.range).codePointAt(0),f=formatCodePointMarkdown(u);let g;switch(c.reason.kind){case 0:{isBasicASCII(c.reason.confusableWith)?g=localize("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",f,formatCodePointMarkdown(c.reason.confusableWith.codePointAt(0))):g=localize("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",f,formatCodePointMarkdown(c.reason.confusableWith.codePointAt(0)));break}case 1:g=localize("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",f);break;case 2:g=localize("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",f);break}if(o.has(g))continue;o.add(g);const m={codePoint:u,reason:c.reason,inComment:c.inComment,inString:c.inString},_=localize("unicodeHighlight.adjustSettings","Adjust settings"),v=`command:${ShowExcludeOptions.ID}?${encodeURIComponent(JSON.stringify(m))}`,C=new MarkdownString("",!0).appendMarkdown(g).appendText(" ").appendLink(v,_,configureUnicodeHighlightOptionsStr);r.push(new MarkdownHover(this,l.range,[C],!1,a++))}return r}renderHoverParts(e,t){return renderMarkdownHovers(e,t,this._editor,this._languageService,this._openerService)}};UnicodeHighlighterHoverParticipant=__decorate$c([__param$c(1,ILanguageService),__param$c(2,IOpenerService)],UnicodeHighlighterHoverParticipant);function codePointToHex(n){return`U+${n.toString(16).padStart(4,"0")}`}function formatCodePointMarkdown(n){let e=`\`${codePointToHex(n)}\``;return InvisibleCharacters.isInvisibleCharacter(n)||(e+=` "${`${renderCodePointAsInlineCode(n)}`}"`),e}function renderCodePointAsInlineCode(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function computeReason(n,e){return UnicodeTextModelHighlighter.computeUnicodeHighlightReason(n,e)}const qg=class qg{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=ModelDecorationOptions.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};qg.instance=new qg;let Decorations=qg;class DisableHighlightingInCommentsAction extends EditorAction{constructor(){super({id:DisableHighlightingOfAmbiguousCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const s=e==null?void 0:e.get(IConfigurationService);s&&this.runAction(s)}async runAction(e){await e.updateValue(unicodeHighlightConfigKeys.includeComments,!1,2)}}class DisableHighlightingInStringsAction extends EditorAction{constructor(){super({id:DisableHighlightingOfAmbiguousCharactersAction.ID,label:localize("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const s=e==null?void 0:e.get(IConfigurationService);s&&this.runAction(s)}async runAction(e){await e.updateValue(unicodeHighlightConfigKeys.includeStrings,!1,2)}}const Gg=class Gg extends EditorAction{constructor(){super({id:Gg.ID,label:localize("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const s=e==null?void 0:e.get(IConfigurationService);s&&this.runAction(s)}async runAction(e){await e.updateValue(unicodeHighlightConfigKeys.ambiguousCharacters,!1,2)}};Gg.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let DisableHighlightingOfAmbiguousCharactersAction=Gg;const Yg=class Yg extends EditorAction{constructor(){super({id:Yg.ID,label:localize("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const s=e==null?void 0:e.get(IConfigurationService);s&&this.runAction(s)}async runAction(e){await e.updateValue(unicodeHighlightConfigKeys.invisibleCharacters,!1,2)}};Yg.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let DisableHighlightingOfInvisibleCharactersAction=Yg;const Xg=class Xg extends EditorAction{constructor(){super({id:Xg.ID,label:localize("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=localize("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const s=e==null?void 0:e.get(IConfigurationService);s&&this.runAction(s)}async runAction(e){await e.updateValue(unicodeHighlightConfigKeys.nonBasicASCII,!1,2)}};Xg.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let DisableHighlightingOfNonBasicAsciiCharactersAction=Xg;const Qg=class Qg extends EditorAction{constructor(){super({id:Qg.ID,label:localize("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:s,reason:r,inString:o,inComment:a}=i,l=String.fromCodePoint(s),c=e.get(IQuickInputService),d=e.get(IConfigurationService);function u(m){return InvisibleCharacters.isInvisibleCharacter(m)?localize("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",codePointToHex(m)):localize("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${codePointToHex(m)} "${l}"`)}const f=[];if(r.kind===0)for(const m of r.notAmbiguousInLocales)f.push({label:localize("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',m),run:async()=>{excludeLocaleFromBeingHighlighted(d,[m])}});if(f.push({label:u(s),run:()=>excludeCharFromBeingHighlighted(d,[s])}),a){const m=new DisableHighlightingInCommentsAction;f.push({label:m.label,run:async()=>m.runAction(d)})}else if(o){const m=new DisableHighlightingInStringsAction;f.push({label:m.label,run:async()=>m.runAction(d)})}if(r.kind===0){const m=new DisableHighlightingOfAmbiguousCharactersAction;f.push({label:m.label,run:async()=>m.runAction(d)})}else if(r.kind===1){const m=new DisableHighlightingOfInvisibleCharactersAction;f.push({label:m.label,run:async()=>m.runAction(d)})}else if(r.kind===2){const m=new DisableHighlightingOfNonBasicAsciiCharactersAction;f.push({label:m.label,run:async()=>m.runAction(d)})}else expectNever(r);const g=await c.pick(f,{title:configureUnicodeHighlightOptionsStr});g&&await g.run()}};Qg.ID="editor.action.unicodeHighlight.showExcludeOptions";let ShowExcludeOptions=Qg;async function excludeCharFromBeingHighlighted(n,e){const t=n.getValue(unicodeHighlightConfigKeys.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(unicodeHighlightConfigKeys.allowedCharacters,i,2)}async function excludeLocaleFromBeingHighlighted(n,e){var s;const t=(s=n.inspect(unicodeHighlightConfigKeys.allowedLocales).user)==null?void 0:s.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const r of e)i[r]=!0;await n.updateValue(unicodeHighlightConfigKeys.allowedLocales,i,2)}function expectNever(n){throw new Error(`Unexpected value: ${n}`)}registerEditorAction(DisableHighlightingOfAmbiguousCharactersAction);registerEditorAction(DisableHighlightingOfInvisibleCharactersAction);registerEditorAction(DisableHighlightingOfNonBasicAsciiCharactersAction);registerEditorAction(ShowExcludeOptions);registerEditorContribution(UnicodeHighlighter.ID,UnicodeHighlighter,1);HoverParticipantRegistry.register(UnicodeHighlighterHoverParticipant);var __decorate$b=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$b=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const ignoreUnusualLineTerminators="ignoreUnusualLineTerminators";function writeIgnoreState(n,e,t){n.setModelProperty(e.uri,ignoreUnusualLineTerminators,t)}function readIgnoreState(n,e){return n.getModelProperty(e.uri,ignoreUnusualLineTerminators)}var Cu;let UnusualLineTerminatorsDetector=(Cu=class extends Disposable{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||readIgnoreState(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:localize("unusualLineTerminators.title","Unusual Line Terminators"),message:localize("unusualLineTerminators.message","Detected unusual line terminators"),detail:localize("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",basename$1(e.uri)),primaryButton:localize({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:localize("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){writeIgnoreState(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Cu.ID="editor.contrib.unusualLineTerminatorsDetector",Cu);UnusualLineTerminatorsDetector=__decorate$b([__param$b(1,IDialogService),__param$b(2,ICodeEditorService)],UnusualLineTerminatorsDetector);registerEditorContribution(UnusualLineTerminatorsDetector.ID,UnusualLineTerminatorsDetector,1);var __decorate$a=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$a=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class TextualDocumentHighlightProvider{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const s=[],r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return r?e.isDisposed()?void 0:e.findMatches(r.word,!0,!1,!0,USUAL_WORD_SEPARATORS,!1).map(a=>({range:a.range,kind:DocumentHighlightKind$1.Text})):Promise.resolve(s)}provideMultiDocumentHighlights(e,t,i,s){const r=new ResourceMap,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(r);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(o.word,!0,!1,!0,USUAL_WORD_SEPARATORS,!1).map(d=>({range:d.range,kind:DocumentHighlightKind$1.Text}));c&&r.set(a.uri,c)}return r}}let TextualMultiDocumentHighlightFeature=class extends Disposable{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new TextualDocumentHighlightProvider)),this._register(e.multiDocumentHighlightProvider.register("*",new TextualDocumentHighlightProvider))}};TextualMultiDocumentHighlightFeature=__decorate$a([__param$a(0,ILanguageFeaturesService)],TextualMultiDocumentHighlightFeature);var __decorate$9=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$9=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},WordHighlighter_1,WordHighlighterContribution_1;const ctxHasWordHighlights=new RawContextKey("hasWordHighlights",!1);function getOccurrencesAtPosition(n,e,t,i){const s=n.ordered(e);return first(s.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,onUnexpectedExternalError)),r=>r!=null).then(r=>{if(r){const o=new ResourceMap;return o.set(e.uri,r),o}return new ResourceMap})}function getOccurrencesAcrossMultipleModels(n,e,t,i,s,r){const o=n.ordered(e);return first(o.map(a=>()=>{const l=r.filter(c=>shouldSynchronizeModel(c)).filter(c=>score(a.selector,c.uri,c.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,s)).then(void 0,onUnexpectedExternalError)}),a=>a!=null)}class OccurenceAtPositionRequest{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=createCancelablePromise(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new Range$2(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const s=t.startLineNumber,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,d=i.length;!l&&c=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class SemanticOccurenceAtPositionRequest extends OccurenceAtPositionRequest{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return getOccurrencesAtPosition(this._providers,e,t.getPosition(),s).then(r=>r||new ResourceMap)}}class MultiModelOccurenceRequest extends OccurenceAtPositionRequest{constructor(e,t,i,s,r){super(e,t,i),this._providers=s,this._otherModels=r}_compute(e,t,i,s){return getOccurrencesAcrossMultipleModels(this._providers,e,t.getPosition(),i,s,this._otherModels).then(r=>r||new ResourceMap)}}function computeOccurencesAtPosition(n,e,t,i,s){return new SemanticOccurenceAtPositionRequest(e,t,s,n)}function computeOccurencesMultiModel(n,e,t,i,s,r){return new MultiModelOccurenceRequest(e,t,s,n,r)}registerModelAndPositionCommand("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(ILanguageFeaturesService),s=await getOccurrencesAtPosition(i.documentHighlightProvider,e,t,CancellationToken.None);return s==null?void 0:s.get(e.uri)});var Oa;let WordHighlighter=(Oa=class{constructor(e,t,i,s,r){this.toUnhook=new DisposableStore,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ResourceMap,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Delayer(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=ctxHasWordHighlights.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{matchesScheme(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():WordHighlighter_1.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,c;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((c=(l=WordHighlighter_1.query)==null?void 0:l.modelInfo)==null?void 0:c.model);break;case"multiFile":WordHighlighter_1.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,WordHighlighter_1.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(Range$2.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(s.startLineNumber);alert$1(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(s.startLineNumber);alert$1(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=WordHighlighter_1.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),WordHighlighter_1.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const s of t){if(!s.hasModel()||isEqual(s.getModel().uri,e==null?void 0:e.uri))continue;const r=WordHighlighter_1.storedDecorationIDs.get(s.getModel().uri);if(!r)continue;s.removeDecorations(r),i.push(s.getModel().uri);const o=WordHighlighterContribution.get(s);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const s of i)WordHighlighter_1.storedDecorationIDs.delete(s)}_stopSingular(){var e,t,i,s;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Schemas.vscodeNotebookCell&&((i=(t=WordHighlighter_1.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==Schemas.vscodeNotebookCell?(WordHighlighter_1.query=null,this._run()):(s=WordHighlighter_1.query)!=null&&s.modelInfo&&(WordHighlighter_1.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==Schemas.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Schemas.vscodeNotebookCell){const r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===Schemas.vscodeNotebookCell&&r.push(l)}return r}const i=[],s=this.codeEditorService.listCodeEditors();for(const r of s){if(!isDiffEditor(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of s){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var s,r;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){WordHighlighter_1.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,c=this._getWord();if(!c||c.startColumn>a||c.endColumn{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},onUnexpectedError)}}computeWithModel(e,t,i,s){return s.length?computeOccurencesMultiModel(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),s):computeOccurencesAtPosition(this.providers,e,t,i,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,i,s;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const r of e){const o=WordHighlighterContribution.get(r);if(!o)continue;const a=[],l=(t=r.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=WordHighlighter_1.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const f of d)f.range&&a.push({range:f.range,options:getHighlightDecorationOptions(f.kind)});let u=[];r.changeDecorations(f=>{u=f.deltaDecorations(c??[],a)}),WordHighlighter_1.storedDecorationIDs=WordHighlighter_1.storedDecorationIDs.set(l,u),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(s=o.wordHighlighter)==null||s._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},WordHighlighter_1=Oa,Oa.storedDecorationIDs=new ResourceMap,Oa.query=null,Oa);WordHighlighter=WordHighlighter_1=__decorate$9([__param$9(4,ICodeEditorService)],WordHighlighter);var ld;let WordHighlighterContribution=(ld=class extends Disposable{static get(e){return e.getContribution(WordHighlighterContribution_1.ID)}constructor(e,t,i,s){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new WordHighlighter(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,s))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},WordHighlighterContribution_1=ld,ld.ID="editor.contrib.wordHighlighter",ld);WordHighlighterContribution=WordHighlighterContribution_1=__decorate$9([__param$9(1,IContextKeyService),__param$9(2,ILanguageFeaturesService),__param$9(3,ICodeEditorService)],WordHighlighterContribution);class WordHighlightNavigationAction extends EditorAction{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=WordHighlighterContribution.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class NextWordHighlightAction extends WordHighlightNavigationAction{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:localize("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:ctxHasWordHighlights,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:65,weight:100}})}}class PrevWordHighlightAction extends WordHighlightNavigationAction{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:localize("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:ctxHasWordHighlights,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:1089,weight:100}})}}class TriggerWordHighlightAction extends EditorAction{constructor(){super({id:"editor.action.wordHighlight.trigger",label:localize("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=WordHighlighterContribution.get(t);s&&s.restoreViewState(!0)}}registerEditorContribution(WordHighlighterContribution.ID,WordHighlighterContribution,0);registerEditorAction(NextWordHighlightAction);registerEditorAction(PrevWordHighlightAction);registerEditorAction(TriggerWordHighlightAction);registerEditorFeature(TextualMultiDocumentHighlightFeature);class MoveWordCommand extends EditorCommand{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=getMapForWordSeparators(t.getOption(132),t.getOption(131)),r=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(c=>{const d=new Position$1(c.positionLineNumber,c.positionColumn),u=this._move(s,r,d,this._wordNavigationType,a);return this._moveTo(c,u,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>CursorState$1.fromModelSelection(c))),l.length===1){const c=new Position$1(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Selection$1(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Selection$1(t.lineNumber,t.column,t.lineNumber,t.column)}}class WordLeftCommand extends MoveWordCommand{_move(e,t,i,s,r){return WordOperations.moveWordLeft(e,t,i,s,r)}}class WordRightCommand extends MoveWordCommand{_move(e,t,i,s,r){return WordOperations.moveWordRight(e,t,i,s)}}class CursorWordStartLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class CursorWordEndLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class CursorWordLeft extends WordLeftCommand{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class CursorWordStartLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class CursorWordEndLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class CursorWordLeftSelect extends WordLeftCommand{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class CursorWordAccessibilityLeft extends WordLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s,r){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,r)}}class CursorWordAccessibilityLeftSelect extends WordLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s,r){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,r)}}class CursorWordStartRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class CursorWordEndRight extends WordRightCommand{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class CursorWordRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class CursorWordStartRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class CursorWordEndRightSelect extends WordRightCommand{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ContextKeyExpr.and(EditorContextKeys.textInputFocus,(e=ContextKeyExpr.and(CONTEXT_ACCESSIBILITY_MODE_ENABLED,IsWindowsContext))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class CursorWordRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class CursorWordAccessibilityRight extends WordRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s,r){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,r)}}class CursorWordAccessibilityRightSelect extends WordRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s,r){return super._move(getMapForWordSeparators(EditorOptions.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,r)}}class DeleteWordCommand extends EditorCommand{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e.get(ILanguageConfigurationService);if(!t.hasModel())return;const r=getMapForWordSeparators(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),d=s.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),f=a.map(g=>{const m=this._delete({wordSeparators:r,model:o,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ReplaceCommand(m,"")});t.pushUndoStop(),t.executeCommands(this.id,f),t.pushUndoStop()}}class DeleteWordLeftCommand extends DeleteWordCommand{_delete(e,t){const i=WordOperations.deleteWordLeft(e,t);return i||new Range$2(1,1,1,1)}}class DeleteWordRightCommand extends DeleteWordCommand{_delete(e,t){const i=WordOperations.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),r=e.model.getLineMaxColumn(s);return new Range$2(s,r,s,r)}}class DeleteWordStartLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:EditorContextKeys.writable})}}class DeleteWordEndLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:EditorContextKeys.writable})}}class DeleteWordLeft extends DeleteWordLeftCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class DeleteWordStartRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:EditorContextKeys.writable})}}class DeleteWordEndRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:EditorContextKeys.writable})}}class DeleteWordRight extends DeleteWordRightCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class DeleteInsideWord extends EditorAction{constructor(){super({id:"deleteInsideWord",precondition:EditorContextKeys.writable,label:localize("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const s=getMapForWordSeparators(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections().map(l=>{const c=WordOperations.deleteInsideWord(s,r,l);return new ReplaceCommand(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}registerEditorCommand(new CursorWordStartLeft);registerEditorCommand(new CursorWordEndLeft);registerEditorCommand(new CursorWordLeft);registerEditorCommand(new CursorWordStartLeftSelect);registerEditorCommand(new CursorWordEndLeftSelect);registerEditorCommand(new CursorWordLeftSelect);registerEditorCommand(new CursorWordStartRight);registerEditorCommand(new CursorWordEndRight);registerEditorCommand(new CursorWordRight);registerEditorCommand(new CursorWordStartRightSelect);registerEditorCommand(new CursorWordEndRightSelect);registerEditorCommand(new CursorWordRightSelect);registerEditorCommand(new CursorWordAccessibilityLeft);registerEditorCommand(new CursorWordAccessibilityLeftSelect);registerEditorCommand(new CursorWordAccessibilityRight);registerEditorCommand(new CursorWordAccessibilityRightSelect);registerEditorCommand(new DeleteWordStartLeft);registerEditorCommand(new DeleteWordEndLeft);registerEditorCommand(new DeleteWordLeft);registerEditorCommand(new DeleteWordStartRight);registerEditorCommand(new DeleteWordEndRight);registerEditorCommand(new DeleteWordRight);registerEditorAction(DeleteInsideWord);class DeleteWordPartLeft extends DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=WordPartOperations.deleteWordPartLeft(e);return i||new Range$2(1,1,1,1)}}class DeleteWordPartRight extends DeleteWordCommand{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:EditorContextKeys.writable,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=WordPartOperations.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),r=e.model.getLineMaxColumn(s);return new Range$2(s,r,s,r)}}class WordPartLeftCommand extends MoveWordCommand{_move(e,t,i,s,r){return WordPartOperations.moveWordPartLeft(e,t,i,r)}}class CursorWordPartLeft extends WordPartLeftCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}CommandsRegistry.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class CursorWordPartLeftSelect extends WordPartLeftCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}CommandsRegistry.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class WordPartRightCommand extends MoveWordCommand{_move(e,t,i,s,r){return WordPartOperations.moveWordPartRight(e,t,i)}}class CursorWordPartRight extends WordPartRightCommand{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class CursorWordPartRightSelect extends WordPartRightCommand{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}registerEditorCommand(new DeleteWordPartLeft);registerEditorCommand(new DeleteWordPartRight);registerEditorCommand(new CursorWordPartLeft);registerEditorCommand(new CursorWordPartLeftSelect);registerEditorCommand(new CursorWordPartRight);registerEditorCommand(new CursorWordPartRightSelect);const Em=class Em extends Disposable{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=MessageController.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new MarkdownString(localize("editor.simple.readonly","Cannot edit in read-only input")):t=new MarkdownString(localize("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Em.ID="editor.contrib.readOnlyMessageController";let ReadOnlyMessageController=Em;registerEditorContribution(ReadOnlyMessageController.ID,ReadOnlyMessageController,2);var __decorate$8=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$8=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let DiffEditorBreadcrumbsSource=class extends Disposable{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=observableValue(this,void 0);const s=observableSignalFromEvent("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=observableSignalFromEvent("_textModel.onDidChangeContent",Event$1.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(autorunWithStore(async(o,a)=>{s.read(o),r.read(o);const l=a.add(new DisposableCancellationTokenSource),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return s.sort(reverseOrder(compareBy(r=>r.range.endLineNumber-r.range.startLineNumber,numberComparator))),s.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};DiffEditorBreadcrumbsSource=__decorate$8([__param$8(1,ILanguageFeaturesService),__param$8(2,IOutlineModelService)],DiffEditorBreadcrumbsSource);HideUnchangedRegionsFeature.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(DiffEditorBreadcrumbsSource,n));const iPadShowKeyboard="",Lm=class Lm extends Disposable{constructor(e){super(),this.editor=e,this.widget=null,isIOS&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new ShowKeyboardWidget(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};Lm.ID="editor.contrib.iPadShowKeyboard";let IPadShowKeyboard=Lm;const Zg=class Zg extends Disposable{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(addDisposableListener(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(addDisposableListener(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return Zg.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};Zg.ID="editor.contrib.ShowKeyboardWidget";let ShowKeyboardWidget=Zg;registerEditorContribution(IPadShowKeyboard.ID,IPadShowKeyboard,3);const inspectTokens="";var __decorate$7=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$7=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},InspectTokensController_1,cd;let InspectTokensController=(cd=class extends Disposable{static get(e){return e.getContribution(InspectTokensController_1.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(TokenizationRegistry.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new InspectTokensWidget(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},InspectTokensController_1=cd,cd.ID="editor.contrib.inspectTokens",cd);InspectTokensController=InspectTokensController_1=__decorate$7([__param$7(1,IStandaloneThemeService),__param$7(2,ILanguageService)],InspectTokensController);class InspectTokens extends EditorAction{constructor(){super({id:"editor.action.inspectTokens",label:InspectTokensNLS.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=InspectTokensController.get(t);i==null||i.launch()}}function renderTokenText(n){let e="";for(let t=0,i=n.length;tNullState,tokenize:(s,r,o)=>nullTokenize(e,o),tokenizeEncoded:(s,r,o)=>nullTokenizeEncoded(i,o)}}const Jg=class Jg extends Disposable{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=getSafeTokenizationSupport(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return Jg._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let s=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){s=l;break}const r=this._model.getLineContent(e.lineNumber);let o="";if(i=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$6=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HelpQuickAccessProvider_1,dd;let HelpQuickAccessProvider=(dd=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Registry.as(Extensions$2.Quickaccess)}provide(e){const t=new DisposableStore;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(HelpQuickAccessProvider_1.PREFIX.length));s&&s.prefix&&s.prefix!==HelpQuickAccessProvider_1.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==HelpQuickAccessProvider_1.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:localize("helpPickAriaLabel","{0}, {1}",s,t.description),description:t.description}})}},HelpQuickAccessProvider_1=dd,dd.PREFIX="?",dd);HelpQuickAccessProvider=HelpQuickAccessProvider_1=__decorate$6([__param$6(0,IQuickInputService),__param$6(1,IKeybindingService)],HelpQuickAccessProvider);Registry.as(Extensions$2.Quickaccess).registerQuickAccessProvider({ctor:HelpQuickAccessProvider,prefix:"",helpEntries:[{description:QuickHelpNLS.helpQuickAccessActionLabel}]});class AbstractEditorNavigationQuickAccessProvider{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const s=new DisposableStore;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=s.add(new MutableDisposable);return r.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new DisposableStore,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=getCodeEditor(r);if(a){let l=r.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{l=r.saveViewState()??void 0})),o.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},s.add(createSingleCallFunction(t.onCancellationRequested)(()=>{var c;return(c=o.restoreViewState)==null?void 0:c.call(o)}))}s.add(toDisposable(()=>this.clearDecorations(r))),s.add(this.provideWithTextEditor(o,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&status(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return isDiffEditor(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:themeColorFromId(overviewRulerRangeHighlight),position:OverviewRulerLane.Full}}}],[o,a]=i.deltaDecorations(s,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const ep=class ep extends AbstractEditorNavigationQuickAccessProvider{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=localize("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Disposable.None}provideWithTextEditor(e,t,i){const s=e.editor,r=new DisposableStore;r.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(s,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(s,t.value.trim().substr(ep.PREFIX.length)),c=this.getPickLabel(s,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(s,l.lineNumber)){this.clearDecorations(s);return}const d=this.toRange(l.lineNumber,l.column);s.revealRangeInCenter(d,0),this.addDecorations(s,d)};o(),r.add(t.onDidChangeValue(()=>o()));const a=getCodeEditor(s);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(toDisposable(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),s=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:s+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?localize("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):localize("gotoLineLabel","Go to line {0}.",t);const s=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?localize("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",s.lineNumber,s.column,r):localize("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",s.lineNumber,s.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const s=this.getModel(e);if(!s)return!1;const r={lineNumber:t,column:i};return s.validatePosition(r).equals(r)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};ep.PREFIX=":";let AbstractGotoLineQuickAccessProvider=ep;var __decorate$5=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$5=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneGotoLineQuickAccessProvider=class extends AbstractGotoLineQuickAccessProvider{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Event$1.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};StandaloneGotoLineQuickAccessProvider=__decorate$5([__param$5(0,ICodeEditorService)],StandaloneGotoLineQuickAccessProvider);var ud;let GotoLineAction$1=(ud=class extends EditorAction{constructor(){super({id:ud.ID,label:GoToLineNLS.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(IQuickInputService).quickAccess.show(StandaloneGotoLineQuickAccessProvider.PREFIX)}},ud.ID="editor.action.gotoLine",ud);registerEditorAction(GotoLineAction$1);Registry.as(Extensions$2.Quickaccess).registerQuickAccessProvider({ctor:StandaloneGotoLineQuickAccessProvider,prefix:StandaloneGotoLineQuickAccessProvider.PREFIX,helpEntries:[{description:GoToLineNLS.gotoLineActionLabel,commandId:GotoLineAction$1.ID}]});const NO_SCORE2=[void 0,[]];function scoreFuzzy2(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?doScoreFuzzy2Multiple(n,s.values,t,i):doScoreFuzzy2Single(n,e,t,i)}function doScoreFuzzy2Multiple(n,e,t,i){let s=0;const r=[];for(const o of e){const[a,l]=doScoreFuzzy2Single(n,o,t,i);if(typeof a!="number")return NO_SCORE2;s+=a,r.push(...l)}return[s,normalizeMatches(r)]}function doScoreFuzzy2Single(n,e,t,i){const s=fuzzyScore(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],createMatches(s)]:NO_SCORE2}function normalizeMatches(n){const e=n.sort((s,r)=>s.start-r.start),t=[];let i;for(const s of e)!i||!matchOverlaps(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function matchOverlaps(n,e){return!(n.end=0,o=queryExpectsExactMatch(n);let a;const l=n.split(MULTIPLE_QUERY_VALUES_SEPARATOR);if(l.length>1)for(const c of l){const d=queryExpectsExactMatch(c),{pathNormalized:u,normalized:f,normalizedLowercase:g}=normalizeQuery(c);f&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:u,normalized:f,normalizedLowercase:g,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:r,expectContiguousMatch:o}}function normalizeQuery(n){let e;isWindows?e=n.replace(/\//g,sep$1):e=n.replace(/\\/g,sep$1);const t=stripWildcards(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function pieceToQuery(n){return Array.isArray(n)?prepareQuery(n.map(e=>e.original).join(MULTIPLE_QUERY_VALUES_SEPARATOR)):prepareQuery(n.original)}var __decorate$4=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$4=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},AbstractGotoSymbolQuickAccessProvider_1,fs;let AbstractGotoSymbolQuickAccessProvider=(fs=class extends AbstractEditorNavigationQuickAccessProvider{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,localize("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Disposable.None}provideWithTextEditor(e,t,i,s){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,s):this.doProvideWithoutEditorSymbols(e,o,t,i):Disposable.None}doProvideWithoutEditorSymbols(e,t,i,s){const r=new DisposableStore;return this.provideLabelPick(i,localize("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||s.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new DeferredPromise,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(toDisposable(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,r){var u;const o=e.editor,a=new DisposableStore;a.add(i.onDidAccept(f=>{var m;const[g]=i.selectedItems;g&&g.range&&(this.gotoLocation(e,{range:g.range.selection,keyMods:i.keyMods,preserveFocus:f.inBackground}),(m=r==null?void 0:r.handleAccept)==null||m.call(r,g),f.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:f})=>{f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,s);let c;const d=async f=>{c==null||c.dispose(!0),i.busy=!1,c=new CancellationTokenSource$1(s),i.busy=!0;try{const g=prepareQuery(i.value.substr(AbstractGotoSymbolQuickAccessProvider_1.PREFIX.length).trim()),m=await this.doGetSymbolPicks(l,g,void 0,c.token,t);if(s.isCancellationRequested)return;if(m.length>0){if(i.items=m,f&&g.original.length===0){const _=findLast(m,v=>!!(v.type!=="separator"&&v.range&&Range$2.containsPosition(v.range.decoration,f)));_&&(i.activeItems=[_])}}else g.original.length>0?this.provideLabelPick(i,localize("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,localize("noSymbolResults","No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((u=o.getSelection())==null?void 0:u.getPosition()),a.add(i.onDidChangeActive(()=>{const[f]=i.activeItems;f&&f.range&&(o.revealRangeInCenter(f.range.selection,0),this.addDecorations(o,f.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,r){var v,C;const o=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(AbstractGotoSymbolQuickAccessProvider_1.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=pieceToQuery(t.values[0]),d=pieceToQuery(t.values.slice(1))):c=t;let u;const f=(C=(v=this.options)==null?void 0:v.openSideBySideDirection)==null?void 0:C.call(v);f&&(u=[{iconClass:f==="right"?ThemeIcon.asClassName(Codicon.splitHorizontal):ThemeIcon.asClassName(Codicon.splitVertical),tooltip:f==="right"?localize("openToSide","Open to the Side"):localize("openToBottom","Open to the Bottom")}]);const g=[];for(let S=0;Sl){let G=!1;if(c!==t&&([T,A]=scoreFuzzy2(I,{...t,values:void 0},l,N),typeof T=="number"&&(G=!0)),typeof T!="number"&&([T,A]=scoreFuzzy2(I,c,l,N),typeof T!="number"))continue;if(!G&&d){if(R&&d.original.length>0&&([F,B]=scoreFuzzy2(R,d)),typeof F!="number")continue;typeof T=="number"&&(T+=F)}}const W=w.tags&&w.tags.indexOf(1)>=0;g.push({index:S,kind:w.kind,score:T,label:I,ariaLabel:getAriaLabelForSymbol(w.name,w.kind),description:R,highlights:W?void 0:{label:A,description:B},range:{selection:Range$2.collapseToStart(w.selectionRange),decoration:w.range},uri:r.uri,symbolName:L,strikethrough:W,buttons:u})}const m=g.sort((S,w)=>a?this.compareByKindAndScore(S,w):this.compareByScore(S,w));let _=[];if(a){let I=function(){w&&typeof S=="number"&&L>0&&(w.label=format$1(NLS_SYMBOL_KIND_CACHE[S]||FALLBACK_NLS_SYMBOL_KIND,L))},S,w,L=0;for(const N of m)S!==N.kind?(I(),S=N.kind,L=1,w={type:"separator"},_.push(w)):L++,_.push(N);I()}else m.length>0&&(_=[{label:localize("symbols","symbols ({0})",g.length),type:"separator"},...m]);return _}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=NLS_SYMBOL_KIND_CACHE[e.kind]||FALLBACK_NLS_SYMBOL_KIND,s=NLS_SYMBOL_KIND_CACHE[t.kind]||FALLBACK_NLS_SYMBOL_KIND,r=i.localeCompare(s);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},AbstractGotoSymbolQuickAccessProvider_1=fs,fs.PREFIX="@",fs.SCOPE_PREFIX=":",fs.PREFIX_BY_CATEGORY=`${fs.PREFIX}${fs.SCOPE_PREFIX}`,fs);AbstractGotoSymbolQuickAccessProvider=AbstractGotoSymbolQuickAccessProvider_1=__decorate$4([__param$4(0,ILanguageFeaturesService),__param$4(1,IOutlineModelService)],AbstractGotoSymbolQuickAccessProvider);const FALLBACK_NLS_SYMBOL_KIND=localize("property","properties ({0})"),NLS_SYMBOL_KIND_CACHE={5:localize("method","methods ({0})"),11:localize("function","functions ({0})"),8:localize("_constructor","constructors ({0})"),12:localize("variable","variables ({0})"),4:localize("class","classes ({0})"),22:localize("struct","structs ({0})"),23:localize("event","events ({0})"),24:localize("operator","operators ({0})"),10:localize("interface","interfaces ({0})"),2:localize("namespace","namespaces ({0})"),3:localize("package","packages ({0})"),25:localize("typeParameter","type parameters ({0})"),1:localize("modules","modules ({0})"),6:localize("property","properties ({0})"),9:localize("enum","enumerations ({0})"),21:localize("enumMember","enumeration members ({0})"),14:localize("string","strings ({0})"),0:localize("file","files ({0})"),17:localize("array","arrays ({0})"),15:localize("number","numbers ({0})"),16:localize("boolean","booleans ({0})"),18:localize("object","objects ({0})"),19:localize("key","keys ({0})"),7:localize("field","fields ({0})"),13:localize("constant","constants ({0})")};var __decorate$3=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$3=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneGotoSymbolQuickAccessProvider=class extends AbstractGotoSymbolQuickAccessProvider{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Event$1.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};StandaloneGotoSymbolQuickAccessProvider=__decorate$3([__param$3(0,ICodeEditorService),__param$3(1,ILanguageFeaturesService),__param$3(2,IOutlineModelService)],StandaloneGotoSymbolQuickAccessProvider);const tp=class tp extends EditorAction{constructor(){super({id:tp.ID,label:QuickOutlineNLS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:EditorContextKeys.hasDocumentSymbolProvider,kbOpts:{kbExpr:EditorContextKeys.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(IQuickInputService).quickAccess.show(AbstractGotoSymbolQuickAccessProvider.PREFIX,{itemActivation:ItemActivation.NONE})}};tp.ID="editor.action.quickOutline";let GotoSymbolAction=tp;registerEditorAction(GotoSymbolAction);Registry.as(Extensions$2.Quickaccess).registerQuickAccessProvider({ctor:StandaloneGotoSymbolQuickAccessProvider,prefix:AbstractGotoSymbolQuickAccessProvider.PREFIX,helpEntries:[{description:QuickOutlineNLS.quickOutlineActionLabel,prefix:AbstractGotoSymbolQuickAccessProvider.PREFIX,commandId:GotoSymbolAction.ID},{description:QuickOutlineNLS.quickOutlineByCategoryActionLabel,prefix:AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY}]});function countMapFrom(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class TfIdfCalculator{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,s);c>0&&r.push({key:o,score:c})}}return r}static termFrequencies(e){return countMapFrom(TfIdfCalculator.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const r of s)r.length>2&&/\p{Letter}{3,}/gu.test(r)&&(yield t(r))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const r=TfIdfCalculator.termFrequencies(s);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:s,tf:r})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const r=this.chunkOccurrences.get(s);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,o)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=i.get(r);typeof l!="number"&&(l=this.computeIdf(r),i.set(r,l));const c=a*l;s+=c*o}return s}computeEmbedding(e){const t=TfIdfCalculator.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const r=this.computeIdf(i);r>0&&(t[i]=s*r)}return t}}function normalizeTfIdfScores(n){var i;const e=n.slice(0);e.sort((s,r)=>r.score-s.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const s of e)s.score/=t;return e}var TriggerAction;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(TriggerAction||(TriggerAction={}));function isPicksWithActive(n){const e=n;return Array.isArray(e.items)}function isFastAndSlowPicks(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class PickerQuickAccessProvider extends Disposable{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const s=new DisposableStore;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const o=s.add(new MutableDisposable),a=async()=>{var v;const d=o.value=new DisposableStore;r==null||r.dispose(!0),e.busy=!1,r=new CancellationTokenSource$1(t);const u=r.token;let f=e.value.substring(this.prefix.length);(v=this.options)!=null&&v.shouldSkipTrimPickFilter||(f=f.trim());const g=this._getPicks(f,d,u,i),m=(C,S)=>{var I;let w,L;if(isPicksWithActive(C)?(w=C.items,L=C.active):w=C,w.length===0){if(S)return!1;(f.length>0||e.hideInput)&&((I=this.options)!=null&&I.noResultsPick)&&(isFunction$2(this.options.noResultsPick)?w=[this.options.noResultsPick(f)]:w=[this.options.noResultsPick])}return e.items=w,L&&(e.activeItems=[L]),!0},_=async C=>{let S=!1,w=!1;await Promise.all([(async()=>{typeof C.mergeDelay=="number"&&(await timeout(C.mergeDelay),u.isCancellationRequested)||w||(S=m(C.picks,!0))})(),(async()=>{e.busy=!0;try{const L=await C.additionalPicks;if(u.isCancellationRequested)return;let I,N;isPicksWithActive(C.picks)?(I=C.picks.items,N=C.picks.active):I=C.picks;let R,T;if(isPicksWithActive(L)?(R=L.items,T=L.active):R=L,R.length>0||!S){let A;if(!N&&!T){const F=e.activeItems[0];F&&I.indexOf(F)!==-1&&(A=F)}m({items:[...I,...R],active:N||T||A})}}finally{u.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(g!==null)if(isFastAndSlowPicks(g))await _(g);else if(!(g instanceof Promise))m(g);else{e.busy=!0;try{const C=await g;if(u.isCancellationRequested)return;isFastAndSlowPicks(C)?await _(C):m(C)}finally{u.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(d=>{var f;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(f=i.handleAccept)==null||f.call(i,e.activeItems[0]);return}const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(d.inBackground||e.hide(),u.accept(e.keyMods,d))}));const l=async(d,u)=>{var g;if(typeof u.trigger!="function")return;const f=((g=u.buttons)==null?void 0:g.indexOf(d))??-1;if(f>=0){const m=u.trigger(f,e.keyMods),_=typeof m=="number"?m:await m;if(t.isCancellationRequested)return;switch(_){case TriggerAction.NO_ACTION:break;case TriggerAction.CLOSE_PICKER:e.hide();break;case TriggerAction.REFRESH_PICKER:a();break;case TriggerAction.REMOVE_ITEM:{const v=e.items.indexOf(u);if(v!==-1){const C=e.items.slice(),S=C.splice(v,1),w=e.activeItems.filter(I=>I!==S[0]),L=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=C,w&&(e.activeItems=w),e.keepScrollPosition=L}break}}}};return s.add(e.onDidTriggerItemButton(({button:d,item:u})=>l(d,u))),s.add(e.onDidTriggerSeparatorButton(({button:d,separator:u})=>l(d,u))),s}}var __decorate$2=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$2=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},AbstractCommandsQuickAccessProvider_1,CommandsHistory_1,vr;let AbstractCommandsQuickAccessProvider=(vr=class extends PickerQuickAccessProvider{constructor(e,t,i,s,r,o){super(AbstractCommandsQuickAccessProvider_1.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=s,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(CommandsHistory)),this.options=e}async _getPicks(e,t,i,s){var g,m;const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=createSingleCallFunction(()=>{const _=new TfIdfCalculator;_.updateDocuments(r.map(C=>({key:C.commandId,textChunks:[this.getTfIdfChunk(C)]})));const v=_.calculateScores(e,i);return normalizeTfIdfScores(v).filter(C=>C.score>AbstractCommandsQuickAccessProvider_1.TFIDF_THRESHOLD).slice(0,AbstractCommandsQuickAccessProvider_1.TFIDF_MAX_RESULTS)}),a=[];for(const _ of r){const v=AbstractCommandsQuickAccessProvider_1.WORD_FILTER(e,_.label)??void 0,C=_.commandAlias?AbstractCommandsQuickAccessProvider_1.WORD_FILTER(e,_.commandAlias)??void 0:void 0;if(v||C)_.highlights={label:v,detail:this.options.showAlias?C:void 0},a.push(_);else if(e===_.commandId)a.push(_);else if(e.length>=3){const S=o();if(i.isCancellationRequested)return[];const w=S.find(L=>L.key===_.commandId);w&&(_.tfIdfScore=w.score,a.push(_))}}const l=new Map;for(const _ of a){const v=l.get(_.label);v?(_.description=_.commandId,v.description=v.commandId):l.set(_.label,_)}a.sort((_,v)=>{if(_.tfIdfScore&&v.tfIdfScore)return _.tfIdfScore===v.tfIdfScore?_.label.localeCompare(v.label):v.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(v.tfIdfScore)return-1;const C=this.commandsHistory.peek(_.commandId),S=this.commandsHistory.peek(v.commandId);if(C&&S)return C>S?-1:1;if(C)return-1;if(S)return 1;if(this.options.suggestedCommandIds){const w=this.options.suggestedCommandIds.has(_.commandId),L=this.options.suggestedCommandIds.has(v.commandId);if(w&&L)return 0;if(w)return-1;if(L)return 1}return _.label.localeCompare(v.label)});const c=[];let d=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let _=0;_{var C;const _=await this.getAdditionalCommandPicks(r,a,e,i);if(i.isCancellationRequested)return[];const v=_.map(S=>this.toCommandPick(S,s));return u&&((C=v[0])==null?void 0:C.type)!=="separator"&&v.unshift({type:"separator",label:localize("suggested","similar commands")}),v})()}:c}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?localize("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(r=e.args)!=null&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){isCancellationError(o)||this.dialogService.error(localize("canNotRun","Command '{0}' resulted in an error",e.label),toErrorMessage(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}},AbstractCommandsQuickAccessProvider_1=vr,vr.PREFIX=">",vr.TFIDF_THRESHOLD=.5,vr.TFIDF_MAX_RESULTS=5,vr.WORD_FILTER=or(matchesPrefix,matchesWords,matchesContiguousSubString),vr);AbstractCommandsQuickAccessProvider=AbstractCommandsQuickAccessProvider_1=__decorate$2([__param$2(1,IInstantiationService),__param$2(2,IKeybindingService),__param$2(3,ICommandService),__param$2(4,ITelemetryService),__param$2(5,IDialogService)],AbstractCommandsQuickAccessProvider);var gs;let CommandsHistory=(gs=class extends Disposable{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===WillSaveStateReason.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=CommandsHistory_1.getConfiguredCommandHistoryLength(this.configurationService),CommandsHistory_1.cache&&CommandsHistory_1.cache.limit!==this.configuredCommandsHistoryLength&&(CommandsHistory_1.cache.limit=this.configuredCommandsHistoryLength,CommandsHistory_1.hasChanges=!0))}load(){const e=this.storageService.get(CommandsHistory_1.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=CommandsHistory_1.cache=new LRUCache(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((r,o)=>r.value-o.value),s.forEach(r=>i.set(r.key,r.value))}CommandsHistory_1.counter=this.storageService.getNumber(CommandsHistory_1.PREF_KEY_COUNTER,0,CommandsHistory_1.counter)}push(e){CommandsHistory_1.cache&&(CommandsHistory_1.cache.set(e,CommandsHistory_1.counter++),CommandsHistory_1.hasChanges=!0)}peek(e){var t;return(t=CommandsHistory_1.cache)==null?void 0:t.peek(e)}saveState(){if(!CommandsHistory_1.cache||!CommandsHistory_1.hasChanges)return;const e={usesLRU:!0,entries:[]};CommandsHistory_1.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(CommandsHistory_1.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(CommandsHistory_1.PREF_KEY_COUNTER,CommandsHistory_1.counter,0,0),CommandsHistory_1.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var s,r;const i=(r=(s=e.getValue().workbench)==null?void 0:s.commandPalette)==null?void 0:r.history;return typeof i=="number"?i:CommandsHistory_1.DEFAULT_COMMANDS_HISTORY_LENGTH}},CommandsHistory_1=gs,gs.DEFAULT_COMMANDS_HISTORY_LENGTH=50,gs.PREF_KEY_CACHE="commandPalette.mru.cache",gs.PREF_KEY_COUNTER="commandPalette.mru.counter",gs.counter=1,gs.hasChanges=!1,gs);CommandsHistory=CommandsHistory_1=__decorate$2([__param$2(0,IStorageService),__param$2(1,IConfigurationService),__param$2(2,ILogService)],CommandsHistory);class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAccessProvider{constructor(e,t,i,s,r,o){super(e,t,i,s,r,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const s of e.getSupportedActions()){let r;(i=s.metadata)!=null&&i.description&&(isLocalizedString(s.metadata.description)?r=s.metadata.description:r={original:s.metadata.description,value:s.metadata.description}),t.push({commandId:s.id,commandAlias:s.alias,commandDescription:r,label:stripIcons(s.label)||s.id})}return t}}var __decorate$1=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param$1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneCommandsQuickAccessProvider=class extends AbstractEditorCommandsQuickAccessProvider{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,s,r,o){super({showAlias:!1},e,i,s,r,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};StandaloneCommandsQuickAccessProvider=__decorate$1([__param$1(0,IInstantiationService),__param$1(1,ICodeEditorService),__param$1(2,IKeybindingService),__param$1(3,ICommandService),__param$1(4,ITelemetryService),__param$1(5,IDialogService)],StandaloneCommandsQuickAccessProvider);const ip=class ip extends EditorAction{constructor(){super({id:ip.ID,label:QuickCommandNLS.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:EditorContextKeys.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(IQuickInputService).quickAccess.show(StandaloneCommandsQuickAccessProvider.PREFIX)}};ip.ID="editor.action.quickCommand";let GotoLineAction=ip;registerEditorAction(GotoLineAction);Registry.as(Extensions$2.Quickaccess).registerQuickAccessProvider({ctor:StandaloneCommandsQuickAccessProvider,prefix:StandaloneCommandsQuickAccessProvider.PREFIX,helpEntries:[{description:QuickCommandNLS.quickCommandHelp,commandId:GotoLineAction.ID}]});var __decorate=globalThis&&globalThis.__decorate||function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},__param=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let StandaloneReferencesController=class extends ReferencesController{constructor(e,t,i,s,r,o,a){super(!0,e,t,i,s,r,o,a)}};StandaloneReferencesController=__decorate([__param(1,IContextKeyService),__param(2,ICodeEditorService),__param(3,INotificationService),__param(4,IInstantiationService),__param(5,IStorageService),__param(6,IConfigurationService)],StandaloneReferencesController);registerEditorContribution(ReferencesController.ID,StandaloneReferencesController,4);class ToggleHighContrast extends EditorAction{constructor(){super({id:"editor.action.toggleHighContrast",label:ToggleHighContrastNLS.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(IStandaloneThemeService),s=i.getColorTheme();isHighContrast(s.type)?(i.setTheme(this._originalThemeName||(isDark(s.type)?VS_DARK_THEME_NAME:VS_LIGHT_THEME_NAME)),this._originalThemeName=null):(i.setTheme(isDark(s.type)?HC_BLACK_THEME_NAME:HC_LIGHT_THEME_NAME),this._originalThemeName=s.themeName)}}registerEditorAction(ToggleHighContrast);var A1=Object.defineProperty,M1=(n,e,t)=>e in n?A1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Pt=(n,e,t)=>M1(n,typeof e!="symbol"?e+"":e,t);const at=defineComponent({__name:"ShadcnIcon",props:{icon:{},size:{default:20},color:{}},emits:["on-click"],setup(n,{emit:e}){const t=e,i=n,s=ref(null),r=computed(()=>({width:typeof i.size=="number"?`${i.size}px`:i.size,height:typeof i.size=="number"?`${i.size}px`:i.size})),o=async l=>{if(l)try{const c=await __vitePreload(()=>import("./lucide-vue-next-DPmWWNyK-2e9fda8f.js"),[]);s.value=c[l]||null}catch(c){console.error("Failed to load icon",c)}else s.value=null};i.icon&&o(String(i.icon)),watch(()=>i.icon,l=>{o(String(l))});const a=()=>{t("on-click")};return(l,c)=>(openBlock(),createElementBlock("div",{class:"inline-flex shrink-0",style:normalizeStyle$1(r.value)},[l.icon?(openBlock(),createBlock$1(resolveDynamicComponent(s.value),{key:0,size:l.size,style:normalizeStyle$1(l.color?{color:l.color}:""),class:"shrink-0",onClick:a},null,8,["size","style"])):renderSlot(l.$slots,"icon",{key:1})],4))}}),N1={key:2},wc=defineComponent({__name:"ShadcnMessage",props:{content:{},duration:{default:1.5},showIcon:{type:Boolean,default:!1},type:{default:"info"},background:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},onClose:{}},emits:["on-close"],setup(n,{emit:e}){const t=e,i=n,s=ref(!0),r=ref(!1);let o=null;const a=()=>{switch(i.type){case"info":case"warning":return"Info";case"success":return"CheckCircle";case"error":return"XCircle";case"loading":return"Loader2"}},l=()=>{switch(i.type){case"info":case"loading":return"text-blue-600";case"success":return"text-green-600";case"warning":return"text-yellow-600";case"error":return"text-red-600"}},c=()=>{if(i.background)switch(i.type){case"info":case"loading":return"bg-blue-100";case"success":return"bg-green-100";case"warning":return"bg-yellow-100";case"error":return"bg-red-100"}else return"bg-white"},d=()=>{if(i.background)switch(i.type){case"info":case"loading":return"border-blue-200 text-blue-700";case"success":return"border-green-200 text-green-700";case"warning":return"border-yellow-200 text-yellow-700";case"error":return"border-red-200 text-red-700"}else return"border-gray-100 text-gray-700"},u=()=>{r.value=!0,o=setTimeout(()=>{s.value=!1,t("on-close"),i.onClose&&i.onClose()},300)};return i.duration&&i.duration>0&&setTimeout(()=>{u()},i.duration*1e3),onUnmounted(()=>{o&&clearTimeout(o),s.value=!1}),(f,g)=>s.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["fixed flex space-x-2 items-center top-5 left-1/2 border px-4 py-2 rounded-md shadow-md text-sm z-50",r.value?"animate-slide-up":"animate-slide-down",[c()],[d()]])},[f.showIcon?(openBlock(),createBlock$1(unref(at),{key:0,size:"16",class:normalizeClass$1([f.type==="loading"?"animate-spin":"",[l()]]),icon:a()},null,8,["class","icon"])):createCommentVNode("",!0),f.$slots.default?renderSlot(f.$slots,"default",{key:1}):(openBlock(),createElementBlock("span",N1,toDisplayString$1(f.content),1)),f.closable?(openBlock(),createElementBlock("div",{key:3,class:"ml-auto text-gray-500 hover:text-gray-700 cursor-pointer",onClick:u},[f.$slots.close?renderSlot(f.$slots,"close",{key:0}):(openBlock(),createBlock$1(unref(at),{key:1,size:"16",class:"ml-10",icon:"X"}))])):createCommentVNode("",!0)],2)):createCommentVNode("",!0)}}),ca=n=>{const{content:e,duration:t=1.5,showIcon:i=!1,type:s="info",background:r=!1,closable:o=!1,onClose:a}=n,l=document.createElement("div");document.body.appendChild(l);const c=createVNode(wc,{content:e,duration:t,showIcon:i,type:s,background:r,closable:o,onClose:()=>{a&&a(),render(null,l),document.body.removeChild(l)}});render(c,l)},I1={info(n){ca({...n})},success(n){ca({...n,type:"success"})},warning(n){ca({...n,type:"warning"})},error(n){ca({...n,type:"error"})},loading(n){ca({...n,type:"loading"})}};var ho=(n=>(n.primary="hover:border-blue-400",n.success="hover:border-green-400",n.warning="hover:border-yellow-400",n.error="hover:border-red-400",n))(ho||{}),xc=(n=>(n.primary="hover:text-blue-400",n.success="hover:text-green-400",n.warning="hover:text-yellow-400",n.error="hover:text-red-400",n))(xc||{}),mo=(n=>(n.default="text-black",n.primary="text-blue-400",n.success="text-green-400",n.warning="text-yellow-400",n.error="text-red-400",n))(mo||{}),Qs=(n=>(n.primary="border-blue-400",n.success="border-green-400",n.warning="border-yellow-400",n.error="border-red-400",n))(Qs||{}),_c=(n=>(n.primary="border-r-blue-400",n.success="border-r-green-400",n.warning="border-r-yellow-400",n.error="border-r-red-400",n))(_c||{}),Cc=(n=>(n.primary="bg-blue-50",n.success="bg-green-50",n.warning="bg-yellow-50",n.error="bg-red-50",n))(Cc||{}),Ar=(n=>(n.default="bg-white",n.primary="bg-blue-400",n.info="bg-blue-400",n.success="bg-green-400",n.warning="bg-yellow-400",n.error="bg-red-400",n.danger="bg-red-400",n.text="bg-transparent",n))(Ar||{}),kc=(n=>(n.default="bg-gray-200",n.primary="bg-blue-400",n.success="bg-green-400",n.warning="bg-yellow-400",n.error="bg-red-400",n))(kc||{}),$c=(n=>(n.default="border-gray-300",n.primary="border-blue-500",n.success="border-green-500",n.warning="border-yellow-500",n.error="border-red-500",n))($c||{}),Sc=(n=>(n.default="hover:bg-white",n.primary="hover:bg-blue-500",n.info="hover:bg-blue-500",n.success="hover:bg-green-500",n.warning="hover:bg-yellow-500",n.error="hover:bg-red-500",n.danger="hover:bg-red-500",n.text="hover:bg-transparent",n))(Sc||{}),Oo=(n=>(n.default="h-8",n.small="h-6",n.large="h-10",n))(Oo||{}),Vc=(n=>(n.default="min-h-8",n.small="min-h-6",n.large="min-h-10",n))(Vc||{}),Ns=(n=>(n.default="0.250rem",n.small="0.125rem",n.large="0.400rem",n))(Ns||{}),Ec=(n=>(n.default="h-10",n.small="h-8",n))(Ec||{}),Bo=(n=>(n.default="h-10 w-10",n.small="h-8 w-8",n.large="h-16 w-16",n))(Bo||{}),ei=(n=>(n.small="h-6 px-3 text-sm",n.default="h-8 px-4 text-sm",n.large="h-10 px-6 text-base",n))(ei||{}),Tc=(n=>(n.small="h-6 w-6",n.default="h-8 w-8",n.large="h-10 w-10",n))(Tc||{}),ti=(n=>(n.default="h-8 w-8",n.small="h-6 w-6",n.large="h-12 w-12",n))(ti||{}),Rc=(n=>(n.default="h-6 px-3",n.medium="h-8 px-2",n.large="h-10 px-4",n))(Rc||{});const L1={key:0,class:"absolute inset-0 bg-gray-50 opacity-65 z-10"},O1={class:"z-20"},Mr=defineComponent({__name:"ShadcnSpin",props:{modelValue:{type:Boolean,default:!0},type:{default:"primary"},size:{default:"default"},fixed:{type:Boolean,default:!1}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i=n;return watch(()=>i.modelValue,s=>{t("update:modelValue",s),t("on-change",s)}),(s,r)=>s.modelValue?(openBlock(),createElementBlock("div",{key:0,role:"status","aria-label":"loading",class:normalizeClass$1(["inline-flex items-center justify-center",s.fixed?"absolute inset-0":"relative"])},[s.fixed?(openBlock(),createElementBlock("div",L1)):createCommentVNode("",!0),createBaseVNode("div",O1,[s.$slots.default?renderSlot(s.$slots,"default",{key:0}):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass$1(["inline-block animate-spin rounded-full border-2","shadow-lg p-2",s.fixed?"bg-transparent":"bg-white",unref(ti)[s.size],unref(_c)[s.type]])},null,2))])],2)):createCommentVNode("",!0)}}),B1=n=>{const{type:e="primary",size:t="default",fixed:i=!0}=n,s=document.createElement("div");s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex="50",document.body.appendChild(s);const r=createVNode(Mr,{modelValue:!0,type:e,size:t,fixed:i,onClose:()=>{render(null,s),document.body.removeChild(s)}});return render(r,s),{close:()=>{render(null,s),document.body.removeChild(s)}}};let No;const D1={show(n){No&&No.close(),No=B1({...n})},hide(){No&&(No.close(),No=void 0)},primary(n){this.show({...n,type:"primary"})},success(n){this.show({...n,type:"success"})},warning(n){this.show({...n,type:"warning"})},error(n){this.show({...n,type:"error"})}},P1={upload:{text:{placeholder:'点击上传 或拖拽文件到这里',description:"支持单文件或批量上传",success:"上传成功",error:"上传失败"}},toolbar:{text:{ok:"确定",cancel:"取消"}},modal:{text:{ok:"确定",cancel:"取消"}},exception:{text:{401:{title:"未登录",description:"抱歉,您需要先登录才能访问此页面。"},403:{title:"无权限访问此页面",description:"抱歉,您没有访问此页面的权限。"},404:{title:"找不到页面",description:"抱歉,找不到您要访问的页面。"},500:{title:"服务器错误",description:"抱歉,服务器出现了错误。"}},action:{backHome:"返回首页"}},select:{text:{placeholder:"请选择一个选项"}},pagination:{text:{total:"共 {{ total }} 条",previous:"上一页",next:"下一页",item:"{{ item }} 条"}},dataBuilder:{placeholder:{width:"宽度",height:"高度",backgroundImage:"背景图"},text:{showGrid:"显示网格",snapToGrid:"网格对齐",showRuler:"显示尺子",dragResize:"拖拽调整大小",showGuidelines:"显示参考线",configureCenter:"配置中心",basicConfigure:"基础配置",backgroundColor:"背景颜色",backgroundImage:"背景图",opacity:"透明度",xCoordinate:"X 坐标",yCoordinate:"Y 坐标",width:"宽度",height:"高度"}},logger:{placeholder:{search:"搜索 ..."},text:{allLevel:"所有级别"}},countDown:{text:{day:"天",hour:"时",minute:"分",second:"秒",pause:"暂停",resume:"继续",reset:"重置",paused:"已暂停",completed:"已完成",timeUp:"即将到期",running:"进行中"}},empty:{text:{retry:"重试",noData:"暂无数据",noDataDescription:"没有找到相关数据"}},workflow:{placeholder:{search:"搜索 ...",selectNode:"请选择一个节点进行配置"},text:{input:"输入",output:"输出",nodeConfigure:"节点配置",dataConfigure:"数据配置",nodeId:"节点 ID"},validated:{required:"此项为必填项"}},inputTag:{text:{placeholder:"请输入标签"}},map:{placeholder:{key:"键",value:"值"},validated:{duplicate:"不允许使用重复的键",required:"键为必填项"}},dataFilter:{placeholder:{value:"请输入值",values:"请输入多个值",number:"请输入数字",numbers:"请输入多个数字",minNumber:"最小值",maxNumber:"最大值"},text:{eq:"等于",neq:"不等于",gt:"大于",gte:"大于等于",lt:"小于",lte:"小于等于",in:"在 ... 中",notIn:"不在 ... 中",between:"在 ... 之间",notBetween:"不在 ... 之间",isNull:"为空",isNotNull:"不为空",like:"包含",notLike:"不包含",regex:"匹配",notRegex:"不匹配",isTrue:"为 True",isFalse:"为 False",addCondition:"添加条件",addGroup:"添加分组",and:"且",or:"或"},validated:{invalid:"无效的字段",required:"请选择字段",operatorRequired:"请选择操作符",valueRequired:"请输入值",rangeRequired:"请输入范围",invalidRange:"范围值无效",invalidDateRange:"日期范围无效",invalidRegex:"正则表达式无效"}},timePicker:{text:{am:"上午",pm:"下午"},placeholder:{time:"请选择时间"}},colorPicker:{text:{transparency:"透明度",format:"格式"}},datePicker:{text:{sunday:"星期日",monday:"星期一",tuesday:"星期二",wednesday:"星期三",thursday:"星期四",friday:"星期五",saturday:"星期六",january:"一月",february:"二月",march:"三月",april:"四月",may:"五月",june:"六月",july:"七月",august:"八月",september:"九月",october:"十月",november:"十一月",december:"十二月",year:"年",month:"月",today:"今天",yesterday:"昨天",thisWeek:"本周",lastWeek:"上周",thisMonth:"本月",lastMonth:"上月",last3Months:"过去 3 个月",thisYear:"今年",lastYear:"去年"},placeholder:{date:"请选择日期"}},cron:{placeholder:{multiple:"可多选"},text:{second:"秒",minute:"分",hour:"时",day:"日",month:"月",week:"周",year:"年",everySecond:"每秒",everyMinute:"每分钟",everyHour:"每小时",everyDay:"每天",everyWeek:"每周",everyMonth:"每月",periodFrom:"周期从",fromStart:"从开始",secondStart:"秒开始",every:"每",secondExecute:"秒执行",specify:"指定",minuteStart:"分钟开始",minuteExecute:"分钟执行",hourStart:"小时开始",hourExecute:"小时执行",notSpecified:"未指定",dayStart:"天开始",dayExecute:"天执行",workday:"工作日",nearestWorkday:"号最近工作日",lastDayOfMonth:"月最后一天",monthStart:"月开始",monthExecute:"月执行",weekPeriodFrom:"周周期从",specificWeek:"指定周",the:"第",weekOf:"周",lastWeek:"上周",yearNotFilled:"年份未填写",everyYear:"每年",yearStart:"年开始",yearExecute:"年执行",nextExecutionTime:"下次执行时间",nextExecutionTimeAtOnN:"第 {{ n }} 次执行时间: {{ time }}"}},contribution:{text:{less:"少",more:"多",contribution:"贡献"}},codeEditor:{text:{loading:"正在加载代码提示...",copy:"复制",cut:"剪切",paste:"粘贴",findInContext:"在文中查找",replace:"替换",replaceAll:"全部替换"},validated:{endpoint:"必须提供 API 接口地址",transform:"必须提供转换函数",regex:"正则表达式无效",search:"搜索错误"}}},F1={upload:{text:{placeholder:' Click upload or drag and drop the file here',description:"Support for a single or bulk upload.",success:"Upload successfully",error:"Upload failed"}},toolbar:{text:{ok:"OK",cancel:"Cancel"}},modal:{text:{ok:"OK",cancel:"Cancel"}},exception:{text:{401:{title:"Not logged in",description:"Sorry, you need to login first to access this page."},403:{title:"No permission to access this page",description:"Sorry, you do not have permission to access this page."},404:{title:"The visited page does not exist",description:"The page you are looking for does not exist."},500:{title:"There was an error on the server",description:"Sorry, there was an error on the server."}},action:{backHome:"Back Home"}},select:{text:{placeholder:"Please select a option"}},pagination:{text:{total:"Total {{ total }} items",previous:"Prev page",next:"Next page",item:"{{ item }} items"}},dataBuilder:{placeholder:{width:"Width",height:"Height",backgroundImage:"Background image"},text:{showGrid:"Show grid",snapToGrid:"Snap to grid",showRuler:"Show ruler",dragResize:"Drag resize",showGuidelines:"Show guidelines",configureCenter:"Configure center",basicConfigure:"Basic configure",backgroundColor:"Background color",backgroundImage:"Background image",opacity:"Opacity",xCoordinate:"X Coordinate",yCoordinate:"Y Coordinate",width:"Width",height:"Height"}},logger:{placeholder:{search:"Search ..."},text:{allLevel:"All level"}},countDown:{text:{day:"Day",hour:"Hour",minute:"Minute",second:"Second",pause:"Pause",resume:"Resume",reset:"Reset",paused:"Paused",completed:"Completed",timeUp:"Time up",running:"Running"}},empty:{text:{retry:"Retry",noData:"No data",noDataDescription:"No data was found"}},workflow:{placeholder:{search:"Search ...",selectNode:"Please select a node to configure"},text:{input:"Input",output:"Output",nodeConfigure:"Node configure",dataConfigure:"Data configure",nodeId:"Node ID"},validated:{required:"This is required"}},inputTag:{text:{placeholder:"Please enter a tag"}},map:{placeholder:{key:"Key",value:"Value"},validated:{duplicate:"Duplicate keys are not allowed",required:"The key is required"}},dataFilter:{placeholder:{value:"Enter a value",values:"Enter values",number:"Enter a number",numbers:"Enter numbers",minNumber:"Min number",maxNumber:"Max number"},text:{eq:"Equal to",neq:"Not equal to",gt:"Greater than",gte:"Greater than or equal to",lt:"Less than",lte:"Less than or equal to",in:"In ...",notIn:"Not in ...",between:"Between ... and ...",notBetween:"Not between ... and ...",isNull:"Is null",isNotNull:"Is not null",like:"Contains",notLike:"Does not contain",regex:"Matches",notRegex:"Does not match",isTrue:"Is True",isFalse:"Is False",addCondition:"Add condition",addGroup:"Add group",and:"And",or:"Or"},validated:{invalid:"Invalid field",required:"The field is required",operatorRequired:"The operator is required",valueRequired:"The value is required",rangeRequired:"The range is required",invalidRange:"The range is invalid",invalidDateRange:"The date range is invalid",invalidRegex:"The regex is invalid"}},timePicker:{text:{am:"AM",pm:"PM"},placeholder:{time:"Please select a time"}},colorPicker:{text:{transparency:"Transparency",format:"Format"}},datePicker:{text:{sunday:"Sun",monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",january:"Jan",february:"Feb",march:"Mar",april:"Apr",may:"May",june:"Jun",july:"Jul",august:"Aug",september:"Sep",october:"Oct",november:"Nov",december:"Dec",year:"Year",month:"Month",today:"Today",yesterday:"Yesterday",thisWeek:"This week",lastWeek:"Last week",thisMonth:"This month",lastMonth:"Last month",last3Months:"Last 3 months",thisYear:"This year",lastYear:"Last year"},placeholder:{date:"Please select a date"}},cron:{placeholder:{multiple:"You can select more than one"},text:{second:"Second",minute:"Minute",hour:"Hour",day:"Day",month:"Month",week:"Week",year:"Year",everySecond:"Every second",everyMinute:"Every minute",everyHour:"Every hour",everyDay:"Every day",everyWeek:"Every week",everyMonth:"Every month",periodFrom:"Period from",fromStart:"From start",secondStart:"Second start",every:"Every",secondExecute:"Second execute",specify:"Specify",minuteStart:"Minute start",minuteExecute:"Minute execute",hourStart:"Hour start",hourExecute:"Hour execute",notSpecified:"Not specified",dayStart:"Day start",dayExecute:"Day execute",workday:"Workday",nearestWorkday:"Nearest workday",lastDayOfMonth:"Last day of month",monthStart:"Month start",monthExecute:"Month execute",weekPeriodFrom:"Week period from",specificWeek:"Specific week",the:"The",weekOf:"Week of",lastWeek:"Last week",yearNotFilled:"Year not filled",everyYear:"Every year",yearStart:"Year start",yearExecute:"Year execute",nextExecutionTime:"Next execution time",nextExecutionTimeAtOnN:"{{ n }}th execution time: {{ time }}"}},contribution:{text:{less:"Less",more:"More",contribution:"Contribution"}},codeEditor:{text:{loading:"Loading code hint...",copy:"Copy",cut:"Cut",paste:"Paste",findInContext:"Find in context",replace:"Replace",replaceAll:"Replace all"},validated:{endpoint:"The API interface address must be provided",transform:"The transform function must be provided",regex:"The regex is invalid",search:"Search error"}}},bs={en:F1,"zh-cn":P1},Ac=ref("en"),U1=n=>n.replace(/\s+/g,"").toLowerCase(),P=(n,e)=>{const t=n.split("."),i=U1(Ac.value);let s=bs[i];s||(s=bs.en);for(const o of t){if(!s||s[o]===void 0){s=bs.en;break}s=s[o]}const r=String(s);return e?r.replace(/\{\{\s*(\w+)\s*\}\}/g,(o,a)=>e[a]!==void 0?e[a]:o):s},Hd=n=>{Ac.value=n};/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var yr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z1=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $a=(n,e)=>({size:t,strokeWidth:i=2,absoluteStrokeWidth:s,color:r,class:o,...a},{attrs:l,slots:c})=>h$1("svg",{...yr,width:t||yr.width,height:t||yr.height,stroke:r||yr.stroke,"stroke-width":s?Number(i)*24/Number(t):i,...l,class:["lucide",`lucide-${z1(n)}`],...a},[...e.map(d=>h$1(...d)),...c.default?[c.default()]:[]]);/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gd=$a("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qd=$a("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jd=$a("ChevronsLeftIcon",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yd=$a("ChevronsRightIcon",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-vue-next v0.360.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W1=$a("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),H1={class:"w-full cursor-pointer"},G1=["href","target"],wa=defineComponent({__name:"ShadcnLink",props:{external:{type:Boolean,default:!1},link:{},target:{default:"_self"}},setup(n){return(e,t)=>{const i=resolveComponent("RouterLink");return openBlock(),createElementBlock("div",H1,[e.external?(openBlock(),createElementBlock("a",{key:0,class:"block w-full cursor-pointer",href:String(e.link),target:e.target},[renderSlot(e.$slots,"default")],8,G1)):(openBlock(),createBlock$1(i,{key:1,class:"block w-full cursor-pointer",to:String(e.link),target:e.target},{default:withCtx(()=>[renderSlot(e.$slots,"default")]),_:3},8,["to","target"]))])}}}),Nr=defineComponent({__name:"ShadcnButton",props:{text:{},size:{default:"default"},type:{default:"primary"},round:{type:Boolean},circle:{type:Boolean,default:!1},loading:{type:Boolean},color:{},disabled:{type:Boolean},ghost:{type:Boolean,default:!1},submit:{type:Boolean,default:!1},reset:{type:Boolean,default:!1},to:{}},setup(n){const e=n,t=computed(()=>e.ghost?{primary:"border-blue-500",success:"border-green-500",warning:"border-yellow-500",danger:"border-red-500",info:"border-gray-500",default:"border-gray-200"}[e.type]:""),i=computed(()=>e.ghost?{primary:"text-blue-500",success:"text-green-500",warning:"text-yellow-500",danger:"text-red-500",info:"text-gray-500",default:"text-gray-500"}[e.type]:""),s=computed(()=>e.ghost?{primary:"hover:bg-blue-50 hover:border-blue-600 hover:text-blue-600",success:"hover:bg-green-50 hover:border-green-600 hover:text-green-600",warning:"hover:bg-yellow-50 hover:border-yellow-600 hover:text-yellow-600",danger:"hover:bg-red-50 hover:border-red-600 hover:text-red-600",info:"hover:bg-gray-50 hover:border-gray-600 hover:text-gray-600",default:"hover:bg-gray-50 hover:border-gray-300"}[e.type]:""),r=computed(()=>e.disabled||e.loading?e.type==="default"?["bg-white","border-solid border border-gray-200","text-gray-500"]:[Ar[e.type],e.type==="text"?"text-gray-500":"text-white"]:e.type==="default"?["bg-white","border-solid border border-gray-200","text-gray-500","hover:border-gray-300"]:[Ar[e.type],Sc[e.type],e.type==="text"?"text-gray-500":"text-white"]),o=inject("buttonGroupSize",void 0),a=computed(()=>(o==null?void 0:o.value)||e.size),l=computed(()=>{if(e.circle){const d=a.value;return{[Tc[d]]:!0}}}),c=computed(()=>({...e.to?{link:e.to}:{type:e.submit?"submit":e.reset?"reset":"button"},class:["inline-flex items-center justify-center whitespace-nowrap transition-colors",!e.circle&&ei[a.value],e.ghost?["bg-transparent","border-solid border",t.value,i.value,!e.disabled&&!e.loading&&s.value]:r.value,{"rounded-full":e.round||e.circle},{"rounded-md":!e.round&&!e.circle},l.value,{"opacity-50 cursor-not-allowed":e.loading||e.disabled}],disabled:e.loading||e.disabled,style:e.color?{backgroundColor:e.color}:{}}));return(d,u)=>(openBlock(),createBlock$1(resolveDynamicComponent(d.to?unref(wa):"button"),normalizeProps(guardReactiveProps(c.value)),{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass$1(["inline-flex items-center justify-center",{"gap-1.5":!d.circle}])},[d.loading?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1({"mr-1.5":!d.circle&&(d.text||d.$slots.default)})},[renderSlot(d.$slots,"loading",{},()=>[createVNode(unref(W1),{class:normalizeClass$1(["animate-spin",{"w-3 h-3":a.value==="small","w-4 h-4":a.value==="default","w-5 h-5":a.value==="large"}])},null,8,["class"])])],2)):createCommentVNode("",!0),d.loading?createCommentVNode("",!0):(openBlock(),createElementBlock(Fragment,{key:1},[d.circle?renderSlot(d.$slots,"default",{key:0},()=>[renderSlot(d.$slots,"icon")]):renderSlot(d.$slots,"icon",{key:1})],64)),d.circle?createCommentVNode("",!0):(openBlock(),createElementBlock(Fragment,{key:2},[d.text?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass$1({"ml-0":!d.$slots.icon&&!d.loading})},toDisplayString$1(d.text),3)):createCommentVNode("",!0),renderSlot(d.$slots,"default")],64))],2)]),_:3},16))}}),q1=defineComponent({__name:"ShadcnButtonGroup",props:{direction:{default:"horizontal"},size:{default:"default"}},setup(n){const e=n,t=computed(()=>ei[e.size]);return provide("buttonGroupSize",computed(()=>e.size)),(i,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["inline-flex",i.direction==="vertical"?["flex-col","divide-y divide-gray-200","[&>button:first-child]:rounded-t-md [&>button:first-child]:rounded-b-none","[&>button:last-child]:rounded-b-md [&>button:last-child]:rounded-t-none","[&>button:not(:first-child):not(:last-child)]:rounded-none"]:["flex-row","divide-x divide-gray-200","[&>button:first-child]:rounded-l-md [&>button:first-child]:rounded-r-none","[&>button:last-child]:rounded-r-md [&>button:last-child]:rounded-l-none","[&>button:not(:first-child):not(:last-child)]:rounded-none"],t.value])},[renderSlot(i.$slots,"default")],2))}});function Mc(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e{const e=J1(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:s=>{const r=s.split(ni);return r[0]===""&&r.length!==1&&r.shift(),Nc(r,e)||K1(s)},getConflictingClassGroupIds:(s,r)=>{const o=t[s]||[];return r&&i[s]?[...o,...i[s]]:o}}},Nc=(n,e)=>{var t;if(n.length===0)return e.classGroupId;const i=n[0],s=e.nextPart.get(i),r=s?Nc(n.slice(1),s):void 0;if(r)return r;if(e.validators.length===0)return;const o=n.join(ni);return(t=e.validators.find(({validator:a})=>a(o)))==null?void 0:t.classGroupId},Kd=/^\[(.+)\]$/,K1=n=>{if(Kd.test(n)){const e=Kd.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},J1=n=>{const{theme:e,prefix:t}=n,i={nextPart:new Map,validators:[]};return Z1(Object.entries(n.classGroups),t).forEach(([s,r])=>{Is(r,i,s,e)}),i},Is=(n,e,t,i)=>{n.forEach(s=>{if(typeof s=="string"){const r=s===""?e:Jd(e,s);r.classGroupId=t;return}if(typeof s=="function"){if(X1(s)){Is(s(i),e,t,i);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([r,o])=>{Is(o,Jd(e,r),t,i)})})},Jd=(n,e)=>{let t=n;return e.split(ni).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t},X1=n=>n.isThemeGetter,Z1=(n,e)=>e?n.map(([t,i])=>{const s=i.map(r=>typeof r=="string"?e+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([o,a])=>[e+o,a])):r);return[t,s]}):n,Q1=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;const s=(r,o)=>{t.set(r,o),e++,e>n&&(e=0,i=t,t=new Map)};return{get(r){let o=t.get(r);if(o!==void 0)return o;if((o=i.get(r))!==void 0)return s(r,o),o},set(r,o){t.has(r)?t.set(r,o):s(r,o)}}},Ic="!",eb=n=>{const{separator:e,experimentalParseClassName:t}=n,i=e.length===1,s=e[0],r=e.length,o=a=>{const l=[];let c=0,d=0,u;for(let v=0;vd?u-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:_}};return t?a=>t({className:a,parseClassName:o}):o},tb=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(i=>{i[0]==="["?(e.push(...t.sort(),i),t=[]):t.push(i)}),e.push(...t.sort()),e},nb=n=>({cache:Q1(n.cacheSize),parseClassName:eb(n),...Y1(n)}),ob=/\s+/,ab=(n,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:s}=e,r=[],o=n.trim().split(ob);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=t(c);let m=!!g,_=i(m?f.substring(0,g):f);if(!_){if(!m){a=c+(a.length>0?" "+a:a);continue}if(_=i(f),!_){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=tb(d).join(":"),C=u?v+Ic:v,S=C+_;if(r.includes(S))continue;r.push(S);const w=s(_,m);for(let L=0;L0?" "+a:a)}return a};function rb(){let n=0,e,t,i="";for(;n{if(typeof n=="string")return n;let e,t="";for(let i=0;iu(d),n());return t=nb(c),i=t.cache.get,s=t.cache.set,r=a,a(l)}function a(l){const c=i(l);if(c)return c;const d=ab(l,t);return s(l,d),d}return function(){return r(rb.apply(null,arguments))}}const dt=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},Oc=/^\[(?:([a-z-]+):)?(.+)\]$/i,sb=/^\d+\/\d+$/,ib=new Set(["px","full","screen"]),ub=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,db=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=n=>Do(n)||ib.has(n)||sb.test(n),Yn=n=>qo(n,"length",xb),Do=n=>!!n&&!Number.isNaN(Number(n)),ws=n=>qo(n,"number",Do),fa=n=>!!n&&Number.isInteger(Number(n)),hb=n=>n.endsWith("%")&&Do(n.slice(0,-1)),Ge=n=>Oc.test(n),Kn=n=>ub.test(n),mb=new Set(["length","size","percentage"]),vb=n=>qo(n,mb,Bc),gb=n=>qo(n,"position",Bc),yb=new Set(["image","url"]),bb=n=>qo(n,yb,Cb),wb=n=>qo(n,"",_b),pa=()=>!0,qo=(n,e,t)=>{const i=Oc.exec(n);return i?i[1]?typeof e=="string"?i[1]===e:e.has(i[1]):t(i[2]):!1},xb=n=>db.test(n)&&!cb.test(n),Bc=()=>!1,_b=n=>fb.test(n),Cb=n=>pb.test(n),kb=()=>{const n=dt("colors"),e=dt("spacing"),t=dt("blur"),i=dt("brightness"),s=dt("borderColor"),r=dt("borderRadius"),o=dt("borderSpacing"),a=dt("borderWidth"),l=dt("contrast"),c=dt("grayscale"),d=dt("hueRotate"),u=dt("invert"),f=dt("gap"),g=dt("gradientColorStops"),m=dt("gradientColorStopPositions"),_=dt("inset"),v=dt("margin"),C=dt("opacity"),S=dt("padding"),w=dt("saturate"),L=dt("scale"),I=dt("sepia"),N=dt("skew"),R=dt("space"),T=dt("translate"),A=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Ge,e],W=()=>[Ge,e],G=()=>["",On,Yn],j=()=>["auto",Do,Ge],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",Ge],ce=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[Do,Ge];return{cacheSize:500,separator:":",theme:{colors:[pa],spacing:[On,Yn],blur:["none","",Kn,Ge],brightness:ie(),borderColor:[n],borderRadius:["none","","full",Kn,Ge],borderSpacing:W(),borderWidth:G(),contrast:ie(),grayscale:Q(),hueRotate:ie(),invert:Q(),gap:W(),gradientColorStops:[n],gradientColorStopPositions:[hb,Yn],inset:B(),margin:B(),opacity:ie(),padding:W(),saturate:ie(),scale:ie(),sepia:Q(),skew:ie(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Ge]}],container:["container"],columns:[{columns:[Kn]}],"break-after":[{"break-after":ce()}],"break-before":[{"break-before":ce()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),Ge]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fa,Ge]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ge]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",fa,Ge]}],"grid-cols":[{"grid-cols":[pa]}],"col-start-end":[{col:["auto",{span:["full",fa,Ge]},Ge]}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":[pa]}],"row-start-end":[{row:["auto",{span:[fa,Ge]},Ge]}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ge]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ge,e]}],"min-w":[{"min-w":[Ge,e,"min","max","fit"]}],"max-w":[{"max-w":[Ge,e,"none","full","min","max","fit","prose",{screen:[Kn]},Kn]}],h:[{h:[Ge,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ge,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ge,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ge,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Kn,Yn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ws]}],"font-family":[{font:[pa]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ge]}],"line-clamp":[{"line-clamp":["none",Do,ws]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,Ge]}],"list-image":[{"list-image":["none",Ge]}],"list-style-type":[{list:["none","disc","decimal",Ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,Yn]}],"underline-offset":[{"underline-offset":["auto",On,Ge]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),gb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},bb]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:ee()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[On,Ge]}],"outline-w":[{outline:[On,Yn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[On,Yn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Kn,wb]}],"shadow-color":[{shadow:[pa]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Kn,Ge]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ge]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Ge]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[fa,Ge]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[On,Yn,ws]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},$b=lb(kb);function $t(...n){return $b(j1(n))}var Dc=(n=>(n.never="shadow-background",n.always="shadow-2xl",n.hover="hover:shadow-2xl",n))(Dc||{});const Sb={class:"relative"},Vb={class:"grid gap-2"},Eb={class:"text-lg font-semibold leading-none tracking-tight"},Tb={key:0},Rb={key:0},Ab={class:"text-sm text-muted-foreground"},Mb={key:0},Nb={key:0},Ib={key:2},Pc=defineComponent({__name:"ShadcnCard",props:{title:{},description:{},shadow:{default:"never"},loading:{type:Boolean,default:!1},onlyContentLoading:{type:Boolean,default:!1},border:{type:Boolean,default:!0}},setup(n){const e=n,t=ref(e.loading);return watch(()=>e.loading,i=>{t.value=i}),(i,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)("bg-white rounded-sm relative",i.border&&"border",unref(Dc)[i.shadow]))},[createBaseVNode("div",Sb,[i.onlyContentLoading?createCommentVNode("",!0):(openBlock(),createBlock$1(unref(Mr),{key:0,modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),fixed:""},null,8,["modelValue"])),i.$slots.title||i.title?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass$1(unref($t)("p-2",i.border&&"border-b",i.$slots.extra&&"flex flex-row items-center justify-between"))},[createBaseVNode("div",Vb,[createBaseVNode("h3",Eb,[i.title?(openBlock(),createElementBlock("span",Tb,toDisplayString$1(i.title),1)):renderSlot(i.$slots,"title",{key:1})]),i.$slots.description||i.description?(openBlock(),createElementBlock("div",Rb,[createBaseVNode("p",Ab,[i.description?(openBlock(),createElementBlock("span",Mb,toDisplayString$1(i.description),1)):renderSlot(i.$slots,"description",{key:1})])])):createCommentVNode("",!0)]),i.$slots.extra?(openBlock(),createElementBlock("div",Nb,[renderSlot(i.$slots,"extra")])):createCommentVNode("",!0)],2)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1([i.onlyContentLoading&&"relative"])},[i.onlyContentLoading?(openBlock(),createBlock$1(unref(Mr),{key:0,modelValue:t.value,"onUpdate:modelValue":s[1]||(s[1]=r=>t.value=r),fixed:""},null,8,["modelValue"])):createCommentVNode("",!0),renderSlot(i.$slots,"content"),renderSlot(i.$slots,"default")],2),i.$slots.footer?(openBlock(),createElementBlock("div",Ib,[renderSlot(i.$slots,"footer")])):createCommentVNode("",!0)])],2))}}),Lb={class:"relative inline-flex items-center"},Ob=defineComponent({__name:"ShadcnCopy",props:{text:{},tooltip:{type:Boolean,default:!0},position:{default:"top"}},emits:["on-success","on-failed"],setup(n,{emit:e}){const t=n,i=e,s=ref("Copy"),r=ref(!1),o=ref("Copied!"),a=async()=>{try{await navigator.clipboard.writeText(t.text),s.value="Check",o.value="Copied!",r.value=!0,i("on-success")}catch{o.value="Copy failed!",r.value=!0,i("on-failed")}finally{setTimeout(()=>{s.value="Copy",r.value=!1},500)}};return(l,c)=>(openBlock(),createElementBlock("div",Lb,[l.$slots.icon?(openBlock(),createElementBlock("div",{key:0,class:"cursor-pointer",onClick:a},[renderSlot(l.$slots,"icon")])):(openBlock(),createBlock$1(unref(at),{key:1,class:"cursor-pointer",icon:s.value,onClick:a},null,8,["icon"])),l.tooltip?(openBlock(),createBlock$1(Transition,{key:2,name:"fade"},{default:withCtx(()=>[r.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(unref($t)("absolute transform bg-gray-700 text-white text-xs rounded p-1.5",l.position==="top"&&"bottom-full mb-2 left-1/2 -translate-x-1/2",l.position==="bottom"&&"top-full mt-2 left-1/2 -translate-x-1/2",l.position==="left"&&"right-full mr-2 top-1/2 -translate-y-1/2",l.position==="right"&&"left-full ml-2 top-1/2 -translate-y-1/2"))},toDisplayString$1(o.value),3)):createCommentVNode("",!0)]),_:1})):createCommentVNode("",!0)]))}});var Fc=(n=>(n.default="h-8",n.small="h-6",n.large="h-10",n))(Fc||{});const Bb={key:0},Db={key:1},Uc=defineComponent({__name:"ShadcnInput",props:{modelValue:{default:""},placeholder:{default:""},clearable:{type:Boolean,default:!1},size:{default:"default"},wordCount:{type:Boolean,default:!1},maxCount:{},disabled:{type:Boolean},type:{default:"text"},rows:{default:3},cols:{default:20},name:{},readonly:{type:Boolean}},emits:["on-change","on-clear","on-blur","on-prefix-click","on-suffix-click","update:modelValue"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.modelValue),r=ref(!1),o=ref(!1),a=computed(()=>i.type==="textarea");watch(()=>i.modelValue,I=>{s.value=I},{immediate:!0});const l=computed(()=>o.value?"text":i.type),c=computed(()=>{var I;return((I=s.value)==null?void 0:I.length)??0}),d=ref(null),u=ref(12),f=()=>{d.value&&(u.value=d.value.offsetWidth)};onMounted(()=>{nextTick$1(()=>f())}),watch(c,()=>{nextTick$1(()=>f())});const g=I=>{const N=I.target.value;s.value=N,t("update:modelValue",N),t("on-change",N)},m=inject(`form-item-${i.name}`),_=I=>{const N=I.target.value;s.value=N,t("update:modelValue",N),t("on-change",N),t("on-blur",N),m&&m.onBlur()},v=I=>{const N=String(I);s.value=N,t("update:modelValue",N),t("on-change",N)},C=()=>{const I="";s.value=I,t("update:modelValue",I),t("on-change",I),t("on-clear")},S=()=>{o.value=!o.value},w=()=>{t("on-prefix-click")},L=()=>{t("on-suffix-click")};return(I,N)=>(openBlock(),createElementBlock("div",{class:"relative w-full items-center border-gray-300 active:border-blue-400 hover:border-blue-400 border rounded transition-colors duration-300",onMouseenter:N[0]||(N[0]=R=>r.value=!0),onMouseleave:N[1]||(N[1]=R=>r.value=!1)},[(openBlock(),createBlock$1(resolveDynamicComponent(a.value?"textarea":"input"),mergeProps(a.value?{rows:i.rows,cols:i.cols}:{type:l.value},{class:unref($t)("w-full p-2 rounded outline-none border-none",I.type!=="textarea"&&I.size&&unref(Fc)[I.size],I.$slots.prefix&&"pl-6",I.$slots.suffix&&"pr-6"),style:I.wordCount||I.maxCount?{paddingRight:u.value+"px"}:"",value:s.value,placeholder:I.placeholder,maxlength:I.maxCount,disabled:I.disabled,readonly:I.readonly,onInput:g,onBlur:_,"onUpdate:modelValue":v}),null,16,["class","style","value","placeholder","maxlength","disabled","readonly"])),I.clearable&&s.value&&r.value?(openBlock(),createElementBlock("span",{key:0,class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 cursor-pointer",onClick:C},[createVNode(unref(at),{class:"size-5 text-muted-foreground",icon:"CircleX"})])):createCommentVNode("",!0),I.type==="password"?(openBlock(),createElementBlock("span",{key:1,class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 cursor-pointer",onClick:S},[createVNode(unref(at),{icon:o.value?"Eye":"EyeOff",class:"size-5 text-muted-foreground"},null,8,["icon"])])):createCommentVNode("",!0),I.wordCount?(openBlock(),createElementBlock("span",{key:2,ref_key:"wordCountSpan",ref:d,class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 text-gray-400 text-xs font-thin w-auto"},[I.maxCount?(openBlock(),createElementBlock("span",Bb,toDisplayString$1(c.value)+" / "+toDisplayString$1(I.maxCount),1)):(openBlock(),createElementBlock("span",Db,toDisplayString$1(c.value),1))],512)):createCommentVNode("",!0),I.$slots.prefix?(openBlock(),createElementBlock("span",{key:3,class:"absolute start-0 inset-y-0 flex items-center justify-center px-2 cursor-pointer",onClick:w},[I.$slots.prefix?renderSlot(I.$slots,"prefix",{key:0}):createCommentVNode("",!0)])):createCommentVNode("",!0),I.$slots.suffix?(openBlock(),createElementBlock("span",{key:4,class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 cursor-pointer",onClick:L},[I.$slots.suffix?renderSlot(I.$slots,"suffix",{key:0}):createCommentVNode("",!0)])):createCommentVNode("",!0)],32))}}),kn=class{static calc(e,t={}){const i={...this.DEFAULT_OPTIONS,...t};if(e==null||e==="")return i.fallback;if(e===0||e==="0")return"0";if(typeof e=="string"){const s=e.trim();if(this.CSS_KEYWORDS.includes(s)||this.CALC_REGEX.test(s)||this.VAR_REGEX.test(s))return s;if(this.UNIT_REGEX.test(s))return this.normalizeValue(s,i);if(this.NUMBER_REGEX.test(s)){const o=parseFloat(s);return this.formatSize(o,i)}const r=parseFloat(s);return isNaN(r)?i.fallback:this.formatSize(r,i)}return typeof e=="number"?this.formatSize(e,i):i.fallback}static formatSize(e,t){!t.allowNegative&&e<0&&(e=Math.abs(e)),e=Math.max(t.min,Math.min(t.max,e));const i=Number(e.toFixed(t.decimals));return i===0?"0":`${i}${t.defaultUnit}`}static normalizeValue(e,t){const i=e.match(/^(-?\d*\.?\d+)(.+)$/);if(!i)return t.fallback;const[,s,r]=i,o=parseFloat(s);return this.CSS_UNITS.includes(r)?this.formatSize(o,{...t,defaultUnit:r}):this.formatSize(o,t)}};Pt(kn,"DEFAULT_OPTIONS",{defaultUnit:"px",allowNegative:!0,min:Number.NEGATIVE_INFINITY,max:Number.POSITIVE_INFINITY,decimals:2,fallback:"auto"}),Pt(kn,"CSS_UNITS",["px","rem","em","vw","vh","%","pt","pc","in","cm","mm","ex","ch"]),Pt(kn,"CSS_KEYWORDS",["auto","inherit","initial","unset","none","fit-content","max-content","min-content"]),Pt(kn,"CALC_REGEX",/^calc\(.+\)$/),Pt(kn,"VAR_REGEX",/^var\(.+\)$/),Pt(kn,"NUMBER_REGEX",/^-?\d*\.?\d+$/),Pt(kn,"UNIT_REGEX",new RegExp(`^-?\\d*\\.?\\d+(${kn.CSS_UNITS.join("|")})$`));let Ls=kn;const ke=(n,e)=>Ls.calc(n,e),Pr=(n,e,t)=>Math.random().toString(36).slice(2,10),Pb={key:0,class:"fixed inset-0 z-50 flex items-center justify-center"},Fb={key:0,class:"border-b p-2"},Ub={class:"flex justify-between"},zb={class:"text-lg font-semibold"},Wb={key:0},Hb={key:0,class:"text-sm text-muted-foreground"},Gb={key:0},qb={class:"p-2 flex-1 overflow-auto"},jb={key:1,class:"border-t p-2 flex justify-end"},Yb=defineComponent({__name:"ShadcnModal",props:{modelValue:{type:Boolean},title:{},description:{},width:{default:"30%"},height:{default:"auto"},okText:{default:String(P("modal.text.ok"))},cancelText:{default:String(P("modal.text.cancel"))},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0}},emits:["update:modelValue","on-close"],setup(n,{emit:e}){const t=e,i=n,s=()=>{i.maskClosable&&r()},r=()=>{t("on-close"),t("update:modelValue",!1)};return(o,a)=>(openBlock(),createBlock$1(Teleport,{to:"body"},[o.modelValue?(openBlock(),createElementBlock("div",Pb,[createBaseVNode("div",{class:"fixed inset-0 bg-black/50 transition-opacity",onClick:s}),createBaseVNode("div",{class:"'relative bg-white z-50 flex flex-col animate-in fade-in-0 zoom-in-95 w-full max-w-lg mx-auto rounded-sm",style:normalizeStyle$1([{width:unref(ke)(o.width),minWidth:unref(ke)(o.width),maxWidth:unref(ke)(o.width)},{height:unref(ke)(o.height),minHeight:unref(ke)(o.height),maxHeight:unref(ke)(o.height)}])},[o.$slots.title||o.title?(openBlock(),createElementBlock("div",Fb,[createBaseVNode("div",Ub,[createBaseVNode("div",null,[createBaseVNode("h2",zb,[o.title?(openBlock(),createElementBlock("span",Wb,toDisplayString$1(o.title),1)):renderSlot(o.$slots,"title",{key:1})]),o.$slots.description||o.description?(openBlock(),createElementBlock("p",Hb,[o.description?(openBlock(),createElementBlock("span",Gb,toDisplayString$1(o.description),1)):renderSlot(o.$slots,"description",{key:1})])):createCommentVNode("",!0)]),o.closable?(openBlock(),createElementBlock("div",{key:0,class:"flex items-center cursor-pointer",onClick:r},[renderSlot(o.$slots,"close",{},()=>[a[0]||(a[0]=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5 text-gray-400 hover:text-muted-foreground"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1))])])):createCommentVNode("",!0)])])):createCommentVNode("",!0),createBaseVNode("div",qb,[o.$slots.content?renderSlot(o.$slots,"content",{key:0}):renderSlot(o.$slots,"default",{key:1})]),o.$slots.footer?(openBlock(),createElementBlock("div",jb,[renderSlot(o.$slots,"footer")])):createCommentVNode("",!0)],4)])):createCommentVNode("",!0)]))}}),zc=(n,e,t=0)=>{const i=n.top===0?n.top+n.height+t:n.top-e.height-t,s=n.left+(n.width-e.width)/2,r=Math.max(0,Math.min(s,window.innerWidth-e.width));return{top:ke(i),left:ke(r)}},Wc=(n,e,t=0)=>{const i=n.top+n.height+t>window.innerHeight?n.top-e.height-t:n.top+n.height+t,s=n.left+(n.width-e.width)/2,r=Math.max(0,Math.min(s,window.innerWidth-e.width));return{top:ke(i),left:ke(r)}},Hc=(n,e,t=0,i="left")=>{(i===null||n.left===0)&&(i=n.left>e.width+t?"left":"right");const s=i==="left"?n.left-e.width-t:n.left+n.width+t,r=n.top+(n.height-e.height)/2,o=Math.max(0,Math.min(r,window.innerHeight-e.height));return{left:ke(Math.max(0,s)),top:ke(o),maxWidth:ke(i==="left"?n.left-t:window.innerWidth-n.right-t)}},Gc=(n,e,t=0,i="right")=>{Math.abs(n.right-window.innerWidth)<=10&&(i=n.left+n.width+e.width+t<=window.innerWidth?"right":"left");const s=i==="right"?n.left+n.width+t:n.left-e.width-t,r=n.top+(n.height-e.height)/2,o=Math.max(0,Math.min(r,window.innerHeight-e.height));return{left:ke(Math.max(0,s)),top:ke(o),maxWidth:ke(i==="right"?window.innerWidth-n.right-t:n.left-t)}},Kb={class:"text-center break-words"},Jb=["innerHTML"],Po=defineComponent({__name:"ShadcnTooltip",props:{content:{},position:{default:"top"},arrow:{type:Boolean,default:!1},delay:{default:0},maxWidth:{default:"250px"}},setup(n){const e=n,t=ref(!1),i=ref(null),s=ref(null),r=ref({}),o=ref({}),a=computed(()=>ke(e.maxWidth)),l=computed(()=>{switch(e.position){case"top":return"bottom-[-5px] left-1/2 -translate-x-1/2 rotate-45";case"bottom":return"top-[-5px] left-1/2 -translate-x-1/2 rotate-45";case"left":return"right-[-5px] top-1/2 -translate-y-1/2 rotate-45";case"right":return"left-[-5px] top-1/2 -translate-y-1/2 rotate-45";default:return""}}),c=()=>{setTimeout(()=>{t.value=!0,nextTick$1(f)},e.delay)},d=()=>{t.value=!1},u={top:(m,_)=>zc(m,_,8),bottom:(m,_)=>Wc(m,_,8),left:(m,_)=>Hc(m,_,8,e.position),right:(m,_)=>Gc(m,_,8,e.position)},f=async()=>{var m;if(!s.value||!i.value)return;const _=i.value.getBoundingClientRect();await nextTick$1();const v=s.value.getBoundingClientRect();r.value=((m=u[e.position])==null?void 0:m.call(u,_,v))||{}},g=()=>{t.value&&f()};return onMounted(()=>{window.addEventListener("resize",g)}),onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>(openBlock(),createElementBlock("div",{class:"relative inline-block",onMouseenter:c,onMouseleave:d},[createBaseVNode("div",{ref_key:"tooltipTrigger",ref:i},[renderSlot(m.$slots,"default")],512),(openBlock(),createBlock$1(Teleport,{to:"body"},[t.value?(openBlock(),createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:s,class:"fixed z-[100] px-3 py-2 text-sm text-white bg-black rounded shadow-lg",style:normalizeStyle$1([r.value,{maxWidth:a.value}])},[createBaseVNode("div",Kb,[m.$slots.content?renderSlot(m.$slots,"content",{key:0}):(openBlock(),createElementBlock("div",{key:1,innerHTML:m.content},null,8,Jb))]),m.arrow?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["absolute w-2.5 h-2.5 rotate-45 bg-black",l.value]),style:normalizeStyle$1(o.value)},null,6)):createCommentVNode("",!0)],4)):createCommentVNode("",!0)]))],32))}});function Xb(n,e){if(!e.endpoint)throw new Error(P("codeEditor.validated.endpoint"));if(!e.transform)throw new Error(P("codeEditor.validated.transform"));e.maxSuggestions=e.maxSuggestions||1e3,e.timeout=e.timeout||5e3;const t=document.createElement("div");t.className="fixed z-50 max-w-[300px] bg-white rounded-lg shadow-lg border border-gray-200 overflow-hidden",t.style.display="none";const i=document.createElement("div");i.className="p-2 flex items-center gap-2";const s=document.createElement("div");s.className="w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin";const r=document.createElement("span");r.className="text-sm text-gray-600",r.textContent=P("codeEditor.text.loading"),i.appendChild(s),i.appendChild(r);const o=document.createElement("ul");o.className="max-h-60 overflow-y-auto w-full",t.appendChild(i),t.appendChild(o),n.getContainerDomNode().appendChild(t);let a=0;function l(){o.querySelectorAll("li").forEach((g,m)=>{m===a?(g.classList.add("bg-blue-50"),g.scrollIntoView({block:"nearest",behavior:"smooth"})):g.classList.remove("bg-blue-50")})}let c=[];n.onKeyDown(g=>{if(t.style.display!=="none")if(g.keyCode===KeyCode.DownArrow){g.preventDefault();const m=o.querySelectorAll("li");a=(a+1)%m.length,l()}else if(g.keyCode===KeyCode.UpArrow){g.preventDefault();const m=o.querySelectorAll("li");a=(a-1+m.length)%m.length,l()}else if(g.keyCode===KeyCode.Enter){g.preventDefault();const m=o.querySelectorAll("li");if(m[a]){const _=m[a],v=_.dataset.insertText||_.textContent||"",C=n.getPosition();C&&n.executeEdits("completion",[{range:new Range(C.lineNumber,C.column-d.length,C.lineNumber,C.column),text:v}]),t.style.display="none"}}else g.keyCode===KeyCode.Escape&&(t.style.display="none")});let d="";const u=languages.registerCompletionItemProvider(n.getModel().getLanguageId(),{triggerCharacters:e.trigger||["."],async provideCompletionItems(g,m){try{const _=n.getDomNode();if(!_)return{suggestions:[]};i.style.display="flex",o.style.display="none",t.style.display="block";const v=_.getBoundingClientRect(),C=m.column,S=m.lineNumber,w=n.getScrolledVisiblePosition({lineNumber:S,column:C}),L=t.offsetWidth||300,I=t.offsetHeight||200;let N=v.left+w.left,R=v.top+w.top+20;const T=window.innerWidth,A=window.innerHeight;N+L>T-20&&(N=N-L,N<20&&(N=20)),N<20&&(N=20),R+I>A-20&&(R=v.top+w.top-I-10,R<20&&(R=20)),R<20&&(R=20),t.style.left=`${N}px`,t.style.top=`${R}px`;const F=g.getWordUntilPosition(m);d=F.word;const B={modelValue:g.getValue(),position:m,word:F.word};let W=e.endpoint;if(e.requestParams){const Q=new URLSearchParams(e.requestParams(B));W=`${W}${W.includes("?")?"&":"?"}${Q.toString()}`}let G;const j=new AbortController,K=setTimeout(()=>j.abort(),e.timeout),ee={method:e.method||"POST",headers:{"Content-Type":"application/json",...e.headers},signal:j.signal};e.requestBody&&(ee.body=JSON.stringify(e.requestBody(B)));try{const Q=await fetch(W,ee);clearTimeout(K),G=await Q.json()}catch(Q){return clearTimeout(K),Q.name==="AbortError"?(console.error("Request timeout:",e.timeout+"ms"),i.style.display="none",o.innerHTML=`
  • Request timeout after ${e.timeout}ms
  • `,o.style.display="block",{suggestions:[]}):(i.style.display="none",o.innerHTML=`
  • ${Q.message}
  • `,o.style.display="block",c.forEach(ce=>ce()),{suggestions:[]})}const U=e.transform?e.transform(G):G,q=U==null?void 0:U.slice(0,e.maxSuggestions);return c.forEach(Q=>Q()),c=[],o.innerHTML="",a=0,q&&q.length>0&&q.forEach((Q,ce)=>{const{element:ie,cleanup:Ce}=ew(Q,ce);c.push(Ce),ie.addEventListener("click",()=>{const ae=Q.insertText||Q.label,be=n.getPosition();be&&n.executeEdits("completion",[{range:new Range(be.lineNumber,be.column-d.length,be.lineNumber,be.column),text:ae}]),t.style.display="none"}),o.appendChild(ie)}),i.style.display="none",o.style.display="block",{suggestions:[]}}catch(_){return console.error("API completion error:",_),t.style.display="none",c.forEach(v=>v()),c=[],{suggestions:[]}}}});n.onDidChangeCursorPosition(()=>{t.style.display="none"});const f=g=>{t.style.display!=="none"&&!t.contains(g.target)&&(t.style.display="none",c.forEach(m=>m()))};return document.addEventListener("click",f),{dispose:()=>{t.remove(),u.dispose(),c.forEach(g=>g()),document.removeEventListener("click",f)}}}function Zb(n){const e=document.createElement("div");return e.className="hidden fixed z-[60] p-2 bg-gray-800 text-white text-sm rounded shadow-lg max-w-xs whitespace-normal",e.textContent=n,e}function Qb(n="Command"){const e=document.createElement("div");e.className="flex-shrink-0 -mt-1 w-4 h-4 text-gray-400";const t=createApp({render(){return h$1(at,{icon:n,size:14,class:"w-4 h-4 text-gray-400"})}});return t.mount(e),{element:e,cleanup:()=>t.unmount()}}function ew(n,e){const t=document.createElement("li");t.className="group relative px-3 py-2 hover:bg-blue-50 cursor-pointer flex items-center gap-2",e===0&&t.classList.add("bg-blue-50");const{element:i,cleanup:s}=Qb(n.icon||"Command"),r=document.createElement("div");r.className="flex-1 min-w-0";const o=document.createElement("span");o.className="block truncate text-sm text-gray-700",o.textContent=n.label;const a=Zb(n.label);return document.body.appendChild(a),a.className+=" transition-opacity duration-200 opacity-0",r.appendChild(o),t.appendChild(i),t.appendChild(r),t.dataset.insertText=n.insertText||n.label,t.addEventListener("mouseenter",()=>{const l=t.getBoundingClientRect();a.style.display="block",a.style.opacity="1";const c=a.getBoundingClientRect();window.innerWidth-(l.right+c.width)>20?(a.style.left=`${l.right+8}px`,a.style.top=`${l.top+(l.height-c.height)/2}px`):(a.style.left=`${l.left-c.width-8}px`,a.style.top=`${l.top+(l.height-c.height)/2}px`)}),t.addEventListener("mouseleave",()=>{a.style.opacity="0",a.style.display="none"}),{element:t,cleanup:()=>{a.remove(),s()}}}function tw(n){const e={typescript:languages.typescript.typescriptDefaults,javascript:languages.typescript.javascriptDefaults,css:languages.css.cssDefaults,json:languages.json.jsonDefaults}[n];e&&e.setDiagnosticsOptions({noSyntaxValidation:!0,noSemanticValidation:!0,validate:!1})}function nw(n,e){const t=document.createElement("div");t.className="fixed z-50 min-w-[100px] bg-white rounded-lg shadow-lg border border-gray-200 transition-opacity duration-200 ease-in-out opacity-0 pointer-events-none",document.body.appendChild(t);const i=n.onContextMenu(s=>{s.event.preventDefault(),s.event.stopPropagation();const r=n.getSelection();t.style.left=`${s.event.browserEvent.pageX}px`,t.style.top=`${s.event.browserEvent.pageY}px`,t.className=t.className.replace("opacity-0 pointer-events-none","opacity-100 pointer-events-auto");const o=[];(e==null?void 0:e.showDefaultItems)!==!1&&o.push(...ow(n,r)),e!=null&&e.items&&o.push(...e.items),aw(t,o,n,r)});return document.addEventListener("click",s=>{t.contains(s.target)||(t.className=t.className.replace("opacity-100 pointer-events-auto","opacity-0 pointer-events-none"))}),{dispose:()=>{i.dispose(),document.body.removeChild(t)}}}function ow(n,e){return[{label:P("codeEditor.text.copy"),icon:"Copy",action:()=>{var t;if(e&&!e.isEmpty()){const i=((t=n.getModel())==null?void 0:t.getValueInRange(e))||"";navigator.clipboard.writeText(i)}}},{label:P("codeEditor.text.paste"),icon:"Clipboard",action:async()=>{const t=await navigator.clipboard.readText();n.executeEdits("paste",[{range:e||new Range(0,0,0,0),text:t,forceMoveMarkers:!0}])}},{label:P("codeEditor.text.cut"),icon:"Scissors",action:()=>{var t;if(e&&!e.isEmpty()){const i=((t=n.getModel())==null?void 0:t.getValueInRange(e))||"";navigator.clipboard.writeText(i),n.executeEdits("cut",[{range:e,text:"",forceMoveMarkers:!0}])}}}]}function aw(n,e,t,i){n.innerHTML="";const s=document.createElement("ul");s.className="py-2",e.forEach(r=>{const o=document.createElement("li");if(o.className="px-4 py-2 space-x-2 hover:bg-gray-100 cursor-pointer text-gray-700 text-sm flex items-center justify-start",r.icon){const l=document.createElement("span");l.className="inline-flex items-center justify-center w-5";const c=h$1(at,{icon:r.icon,class:"w-4 h-4 flex-shrink-0"});render(c,l),o.appendChild(l)}else{const l=document.createElement("span");l.className="w-5",o.appendChild(l)}const a=document.createElement("span");a.className="flex-1",a.textContent=r.label,o.appendChild(a),o.onclick=l=>{l.stopPropagation(),r.action({editor:t,selection:i}),n.className=n.className.replace("opacity-100 pointer-events-auto","opacity-0 pointer-events-none")},s.appendChild(o)}),s.className="py-2 w-full",n.appendChild(s)}function rw(){const n=document.createElement("div");n.className="hidden max-h-[200px] overflow-y-auto border-t border-gray-200";const e=document.createElement("div");return e.className="p-2",n.appendChild(e),{panel:n,updatePreview:(t,i)=>{const s=t.range.startLineNumber,r=Math.max(1,s-1),o=Math.min(i.getLineCount(),s+1);let a="";for(let l=r;l<=o;l++){const c=i.getLineContent(l),d=l===s?"bg-yellow-50":"",u="text-gray-400 select-none pr-2 w-8 inline-block text-right";if(l===s){const f=c.substring(0,t.range.startColumn-1),g=c.substring(t.range.startColumn-1,t.range.endColumn-1),m=c.substring(t.range.endColumn-1);a+=` +
    + ${l} + ${f} + ${g} + ${m} +
    `}else a+=` +
    + ${l} + ${c} +
    `}e.innerHTML=a},show:()=>{n.className=n.className.replace("hidden","")},hide:()=>{n.className.includes("hidden")||(n.className+=" hidden")},clear:()=>{e.innerHTML=""}}}function lw(n,e){const t=document.createElement("div");t.className="fixed z-[9999] bg-white rounded-md shadow-lg border border-gray-200 transition-opacity duration-200 ease-in-out opacity-0 pointer-events-none",document.body.appendChild(t);const i=[];let s=[];const r=10;let o=[];const a=()=>{const f=document.createElement("div");f.className="flex flex-col min-w-[300px]";const g=document.createElement("div");g.className="flex items-center px-2 py-1.5",f.appendChild(g);const m=document.createElement("div");m.className="flex items-center px-2 py-1.5 border-t border-gray-200";const _=document.createElement("div");_.className="flex items-center flex-1 mr-2";const v=document.createElement("span");v.className="mr-2";const C=h$1(at,{icon:"Replace",size:14,class:"w-4 h-4 text-gray-400"});render(C,v),_.appendChild(v);const S=document.createElement("input");S.type="text",S.className="flex-1 outline-none text-sm",S.placeholder=typeof P("codeEditor.text.replace")=="string"?P("codeEditor.text.replace"):"Replace",_.appendChild(S);const w=document.createElement("div");w.className="flex items-center space-x-1.5";const L=document.createElement("button");L.className="px-2 py-1 text-xs hover:bg-gray-100 rounded",L.textContent=typeof P("codeEditor.text.replace")=="string"?P("codeEditor.text.replace"):"Replace",w.appendChild(L);const I=document.createElement("button");I.className="px-2 py-1 text-xs hover:bg-gray-100 rounded",I.textContent=typeof P("codeEditor.text.replaceAll")=="string"?P("codeEditor.text.replaceAll"):"Replace All",w.appendChild(I),m.appendChild(_),m.appendChild(w),f.appendChild(m);const N=document.createElement("div");N.className="hidden max-h-[200px] overflow-y-auto border-t border-gray-200",f.appendChild(N);const R=()=>{e.showHistory&&(N.innerHTML="",s.forEach(ye=>{const Re=document.createElement("div");Re.className="flex items-center px-2 py-1.5 hover:bg-gray-50 cursor-pointer";const Ue=document.createElement("span");Ue.className="mr-2";const He=h$1(at,{icon:"History",size:14,class:"w-4 h-4 text-gray-400"});render(He,Ue),Re.appendChild(Ue);const Ve=document.createElement("span");Ve.textContent=ye,Ve.className="text-sm text-gray-600",Re.appendChild(Ve),Re.onclick=()=>{W.value=ye,je(),N.className=N.className+" hidden"},N.appendChild(Re)}))},T=rw();f.appendChild(T.panel);const A=document.createElement("div");A.className="flex items-center flex-1 mr-2";const F=document.createElement("span");F.className="mr-2";const B=h$1(at,{icon:"Search",size:14,class:"w-4 h-4 text-gray-400"});render(B,F),A.appendChild(F);const W=document.createElement("input");W.type="text",W.className="flex-1 outline-none text-sm",W.placeholder=typeof P("codeEditor.text.findInContext")=="string"?P("codeEditor.text.findInContext"):"Find in file",A.appendChild(W);const G=document.createElement("div");G.className="flex items-center space-x-1.5";const j=document.createElement("span");j.className="text-xs text-gray-500 mr-2 min-w-[50px]",j.textContent="0/0",G.appendChild(j);const K=document.createElement("button");K.className="p-1 hover:bg-gray-100 rounded";const ee=h$1(at,{icon:"ArrowUp",size:14,class:"w-4 h-4 text-gray-600"});render(ee,K),G.appendChild(K);const U=document.createElement("button");U.className="p-1 hover:bg-gray-100 rounded";const q=h$1(at,{icon:"ArrowDown",size:14,class:"w-4 h-4 text-gray-600"});render(q,U),G.appendChild(U);const Q=document.createElement("button");Q.className="p-1 hover:bg-gray-100 rounded";const ce=h$1(at,{icon:"Text",size:14,class:"w-4 h-4 text-gray-600"});render(ce,Q),G.appendChild(Q);const ie=document.createElement("button");ie.className="p-1 hover:bg-gray-100 rounded";const Ce=h$1(at,{icon:"Code",size:14,class:"w-4 h-4 text-gray-600"});render(Ce,ie),G.appendChild(ie);const ae=document.createElement("button");ae.className="p-1 hover:bg-gray-100 rounded";const be=h$1(at,{icon:"CaseLower",size:14,class:"w-4 h-4 text-gray-600"});render(be,ae),G.appendChild(ae);const De=document.createElement("button");De.className="p-1 hover:bg-gray-100 rounded ml-1";const Te=h$1(at,{icon:"X",size:14,class:"w-4 h-4 text-gray-600"});render(Te,De),G.appendChild(De),g.appendChild(A),g.appendChild(G),t.appendChild(f);let xe=!1,ze=!1,Qe=!1,qe=[],Le=-1;const je=()=>{const ye=W.value.trim();ye&&e.showHistory&&!s.includes(ye)&&(s.unshift(ye),s.length>r&&s.pop(),R());const Re=n.getModel();if(Re){if(o.length>0&&(o=Re.deltaDecorations(o,[])),!ye){qe=[],Le=-1,j.textContent="0/0";return}try{let Ue=ye;if(Qe)try{new RegExp(ye),Ue=ye}catch{qe=[],Le=-1,j.textContent=P("codeMirror.validated.regex");return}if(qe=Re.findMatches(Ue,!Qe,ze,xe,null,!0),Le=qe.length>0?0:-1,j.textContent=qe.length>0?`${Le+1}/${qe.length}`:"0/0",qe.length>0){const He=qe.map((Oe,ot)=>({range:Oe.range,options:{className:ot===Le?"bg-blue-200":"bg-yellow-100",isWholeLine:!1,stickiness:editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}));o=Re.deltaDecorations([],He);const Ve=qe[Le];n.revealRangeInCenterIfOutsideViewport(Ve.range),n.setPosition({lineNumber:Ve.range.startLineNumber,column:Ve.range.startColumn}),T.updatePreview(qe[Le],Re),T.show()}else T.hide(),T.clear()}catch(Ue){console.error("Search error:",Ue),qe=[],Le=-1,j.textContent=P("codeMirror.validated.search")}}},le=()=>{if(Le===-1||!qe.length)return;const ye=n.getModel();if(!ye)return;const Re=qe[Le],Ue=S.value,He={range:Re.range,text:Ue};ye.pushEditOperations([],[He],()=>null),je()},pe=()=>{if(!qe.length)return;const ye=n.getModel();if(!ye)return;const Re=S.value,Ue=qe.map(He=>({range:He.range,text:Re}));ye.pushEditOperations([],Ue,()=>null),je()},Ie=ye=>{if(qe.length===0)return;const Re=n.getModel();if(!Re)return;T.updatePreview(qe[Le],Re),ye==="next"?Le=(Le+1)%qe.length:Le=(Le-1+qe.length)%qe.length,j.textContent=`${Le+1}/${qe.length}`;const Ue=qe.map((Ve,Oe)=>({range:Ve.range,options:{className:Oe===Le?"bg-blue-200":"bg-yellow-100",isWholeLine:!1,stickiness:editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}));o=Re.deltaDecorations(o,Ue);const He=qe[Le];n.revealRangeInCenterIfOutsideViewport(He.range),n.setPosition({lineNumber:He.range.startLineNumber,column:He.range.startColumn})},$e=()=>{t.className=t.className.replace("opacity-100 pointer-events-auto","opacity-0 pointer-events-none");const ye=n.getModel();ye&&o.length>0&&(o=ye.deltaDecorations(o,[])),W.value="",W.style.color="",S.value="",N.className=N.className+" hidden",T.hide(),T.clear(),n.focus()};return W.addEventListener("input",()=>{const ye=W.value.trim();if(ye&&e.showHistory?N.className=N.className.replace("hidden",""):N.className=N.className+" hidden",Qe&&ye)try{new RegExp(ye),W.style.color=""}catch{W.style.color="red"}else W.style.color="";requestAnimationFrame(je)}),W.addEventListener("focus",()=>{e.showHistory&&s.length>0&&(N.className=N.className.replace("hidden",""))}),K.onclick=()=>Ie("prev"),U.onclick=()=>Ie("next"),De.onclick=$e,Q.onclick=()=>{ze=!ze,Q.className=`p-1 hover:bg-gray-100 rounded ${ze?"bg-blue-100":""}`,je()},ie.onclick=()=>{Qe=!Qe,ie.className=`p-1 hover:bg-gray-100 rounded ${Qe?"bg-blue-100":""}`,je()},ae.onclick=()=>{xe=!xe;const ye=h$1(at,{icon:xe?"CaseUpper":"CaseLower",size:14,class:"w-4 h-4 text-gray-600"});render(ye,ae),je()},L.onclick=le,I.onclick=pe,W.addEventListener("keydown",ye=>{ye.key==="Enter"&&!ye.shiftKey?(Ie("next"),ye.preventDefault()):ye.key==="Enter"&&ye.shiftKey?(Ie("prev"),ye.preventDefault()):ye.key==="Escape"?($e(),ye.preventDefault()):ye.key==="Enter"&&ye.ctrlKey&&(le(),ye.preventDefault())}),S.addEventListener("keydown",ye=>{ye.key==="Enter"&&!ye.ctrlKey?(le(),ye.preventDefault()):ye.key==="Enter"&&ye.ctrlKey?(pe(),ye.preventDefault()):ye.key==="Escape"&&($e(),ye.preventDefault())}),{searchInput:W,replaceInput:S,search:je}},{searchInput:l,replaceInput:c,search:d}=a();i.push(n.addCommand(KeyMod.CtrlCmd|KeyCode.KeyF,()=>{var f,g;const m=n.getContainerDomNode().getBoundingClientRect(),_=((f=n.getContainerDomNode().offsetParent)==null?void 0:f.getBoundingClientRect())||{left:0,top:0},v=m.right-_.left-t.offsetWidth;t.style.left=`${v}px`,t.style.top=`${m.top-_.top}px`,t.className=t.className.replace("opacity-0 pointer-events-none","opacity-100 pointer-events-auto"),l.focus(),l.select();const C=n.getSelection();if(C&&!C.isEmpty()){const S=((g=n.getModel())==null?void 0:g.getValueInRange(C))||"";l.value=S,d()}}),n.addCommand(KeyMod.CtrlCmd|KeyMod.Alt|KeyCode.KeyF,()=>{n.trigger("editor","actions.find",null),setTimeout(()=>{c.focus()},0)}));const u=f=>{if(!t.contains(f.target)){t.className=t.className.replace("opacity-100 pointer-events-auto","opacity-0 pointer-events-none");const g=n.getModel();g&&o.length>0&&(o=g.deltaDecorations(o,[]))}};return document.addEventListener("click",u),{dispose:()=>{i.forEach(g=>{g&&typeof g.dispose=="function"&&g.dispose()}),document.removeEventListener("click",u);const f=n.getModel();f&&o.length>0&&f.deltaDecorations(o,[]),t.parentNode&&t.parentNode.removeChild(t)}}}const sw=defineComponent({__name:"ShadcnCodeEditor",props:{modelValue:{},height:{default:300},config:{default:{language:"javascript",fontSize:18,tabSize:2}},disableValidation:{type:Boolean,default:!0},autoCompleteConfig:{},contextMenuConfig:{},searchConfig:{default:{caseSensitive:!1,replace:!0,matchWholeWord:!1,useRegex:!1,showHistory:!1}}},emits:["update:modelValue","on-change","on-created"],setup(n,{emit:e}){const t=n,i=e,s=ref(null);let r=null,o=null,a=null;const l=()=>{if(!s.value)return;t.disableValidation&&["typescript","javascript","css","json"].forEach(g=>tw(g));const f={...t.config,value:t.modelValue||"",contextmenu:!1,suggest:{showMethods:!1,showFunctions:!1,showConstructors:!1,showFields:!1,showVariables:!1,showClasses:!1,showStructs:!1,showInterfaces:!1,showModules:!1,showProperties:!1,showEvents:!1,showOperators:!1,showUnits:!1,showValues:!1,showConstants:!1,showEnums:!1,showEnumMembers:!1,showKeywords:!1,showWords:!1,showColors:!1,showFiles:!1,showReferences:!1,showFolders:!1,showTypeParameters:!1,showSnippets:!1},scrollBeyondLastLine:!1};r=editor.create(s.value,f),r.addCommand(KeyCode.KeyF|KeyMod.CtrlCmd,()=>{}),t.contextMenuConfig&&(o=nw(r,t.contextMenuConfig)),t.searchConfig&&(a=lw(r,t.searchConfig)),r.onDidChangeModelContent(()=>{i("update:modelValue",r==null?void 0:r.getValue()),i("on-change",r==null?void 0:r.getValue())}),i("on-created",r)},c=()=>{r&&r.updateOptions(t.config)},d=()=>{r&&r.getValue()!==t.modelValue&&r.setValue(t.modelValue||"")};watch(()=>t.config,c),watch(()=>t.modelValue,d);const u=()=>{if(!r||!t.autoCompleteConfig)return;const f=Xb(r,t.autoCompleteConfig);onBeforeUnmount(()=>{f.dispose()})};return onMounted(()=>{l(),u()}),onBeforeUnmount(()=>{r&&r.dispose(),o==null||o.dispose(),a==null||a.dispose()}),(f,g)=>(openBlock(),createElementBlock("div",{ref_key:"editorContainer",ref:s,class:"border w-full overflow-hidden",style:normalizeStyle$1({height:unref(ke)(f.height)})},null,4))}});var qc=(n=>(n.top="start",n.middle="center",n.bottom="end",n))(qc||{});const iw=["id"],uw=defineComponent({__name:"ShadcnRow",props:{gutter:{default:0},align:{},justify:{},wrap:{type:Boolean}},setup(n){const e=n,t=ref(!1),i=ref(0),s=computed(()=>e.wrap||i.value>12),r=computed(()=>`ShadcnRow-${Math.random().toString(36).slice(2)}`);return provide("ShadcnRowContext",{registerCol:o=>{t.value=!0,i.value+=o}}),onMounted(()=>{t.value||console.error("ShadcnRow must contain at least one ShadcnCol component.")}),(o,a)=>(openBlock(),createElementBlock("div",{id:r.value,class:normalizeClass$1(unref($t)("grid w-full",o.align&&`items-${unref(qc)[o.align]}`,o.justify&&`justify-${o.justify}`,s.value&&"flex-wrap")),style:normalizeStyle$1({"grid-template-columns":"repeat(12, minmax(0, 1fr))",gap:unref(ke)(o.gutter)})},[renderSlot(o.$slots,"default")],14,iw))}}),dw=defineComponent({__name:"ShadcnCol",props:{span:{default:1},order:{}},setup(n){const e=n,t=computed(()=>{const s=Number(e.span);if(s<1||s>12)throw new Error("ShadcnCol span must be between 1 and 12.");return Math.min(Math.max(s,1),12)}),i=inject("ShadcnRowContext",null);return onMounted(()=>{i?i.registerCol(Number(e.span)):console.error("ShadcnCol must be used inside a ShadcnRow component.")}),(s,r)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)(s.order&&`order-${s.order}`)),style:normalizeStyle$1({"grid-column":`span ${t.value}`})},[renderSlot(s.$slots,"default")],6))}}),cw=defineComponent({__name:"ShadcnDivider",props:{text:{},type:{default:"horizontal"},orientation:{},dashed:{type:Boolean,default:!1}},setup(n){return(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)(e.type==="vertical"?"border-l":"flex items-center w-full relative pr-8"))},[e.text&&e.orientation==="left"?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["w-8 border-t border-gray-100",e.dashed&&"border-dashed"])},null,2)):e.orientation!=="left"?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass$1(unref($t)(e.type==="vertical"?"bg-gray-100":"flex-grow border-t border-gray-100",e.dashed&&"border-dashed",e.orientation==="right"&&"flex-1"))},null,2)):createCommentVNode("",!0),(e.text||e.$slots.default)&&e.orientation==="left"&&e.type==="horizontal"?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass$1(["w-8 mr-4 border-t border-gray-100",e.dashed&&"border-dashed"])},null,2)):createCommentVNode("",!0),e.text?(openBlock(),createElementBlock("span",{key:3,class:normalizeClass$1(unref($t)(e.orientation==="left"&&(e.type==="vertical"?"order-first mb-2":"mx-4"),e.orientation==="right"&&(e.type==="vertical"?"order-last mt-2":"order-last mx-4"),e.orientation==="center"&&(e.type==="vertical"?"my-2":"mx-6"),"text-sm text-gray-500",e.orientation==="right"&&e.type==="horizontal"&&"mr-3"))},toDisplayString$1(e.text),3)):(openBlock(),createElementBlock("div",{key:4,class:normalizeClass$1(unref($t)(e.orientation==="left"&&(e.type==="vertical"?"order-first mb-2":"mr-4"),e.orientation==="right"&&(e.type==="vertical"?"order-last mt-2":"order-last mx-4"),e.orientation==="center"&&(e.type==="vertical"?"my-2":"mx-6")))},[renderSlot(e.$slots,"default")],2)),createBaseVNode("div",{class:normalizeClass$1(unref($t)(e.type==="vertical"?"bg-gray-100":"flex-grow border-t border-gray-100",e.dashed&&"border-dashed",e.orientation==="right"&&"flex-1"))},null,2),(e.text||e.$slots.default)&&e.orientation==="right"&&e.type==="horizontal"?(openBlock(),createElementBlock("div",{key:5,class:normalizeClass$1(["absolute right-0 top-1/2 -translate-y-1/2 w-8 border-t border-gray-100",e.dashed&&"border-dashed"])},null,2)):createCommentVNode("",!0)],2))}});var ha=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ir={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Ir.exports;(function(n,e){(function(){var t,i="4.17.21",s=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",u=1,f=2,g=4,m=1,_=2,v=1,C=2,S=4,w=8,L=16,I=32,N=64,R=128,T=256,A=512,F=30,B="...",W=800,G=16,j=1,K=2,ee=3,U=1/0,q=9007199254740991,Q=17976931348623157e292,ce=NaN,ie=4294967295,Ce=ie-1,ae=ie>>>1,be=[["ary",R],["bind",v],["bindKey",C],["curry",w],["curryRight",L],["flip",A],["partial",I],["partialRight",N],["rearg",T]],De="[object Arguments]",Te="[object Array]",xe="[object AsyncFunction]",ze="[object Boolean]",Qe="[object Date]",qe="[object DOMException]",Le="[object Error]",je="[object Function]",le="[object GeneratorFunction]",pe="[object Map]",Ie="[object Number]",$e="[object Null]",ye="[object Object]",Re="[object Promise]",Ue="[object Proxy]",He="[object RegExp]",Ve="[object Set]",Oe="[object String]",ot="[object Symbol]",et="[object Undefined]",nt="[object WeakMap]",lt="[object WeakSet]",Ct="[object ArrayBuffer]",Nt="[object DataView]",kt="[object Float32Array]",hi="[object Float64Array]",Vt="[object Int8Array]",_i="[object Int16Array]",Xt="[object Int32Array]",At="[object Uint8Array]",Si="[object Uint8ClampedArray]",bi="[object Uint16Array]",vi="[object Uint32Array]",Ot=/\b__p \+= '';/g,Hn=/\b(__p \+=) '' \+/g,Cr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ps=/&(?:amp|lt|gt|quot|#39);/g,Li=/[&<>"']/g,mn=RegExp(ps.source),xo=RegExp(Li.source),xr=/<%-([\s\S]+?)%>/g,ms=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/,oe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ge=/[\\^$.*+?()[\]{}|]/g,_e=RegExp(ge.source),Ee=/^\s+/,Ae=/\s/,Ye=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,bt=/,? & /,Dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,It=/[()=,{}\[\]\/\s]/,Wt=/\\(\\)?/g,Yt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ri=/\w*$/,Hi=/^[-+]0x[0-9a-f]+$/i,ys=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,rt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jt=/($^)/,Fi=/['\n\r\u2028\u2029\\]/g,Di="\\ud800-\\udfff",Bi="\\u0300-\\u036f",Ji="\\ufe20-\\ufe2f",Gn="\\u20d0-\\u20ff",Ni=Bi+Ji+Gn,Eo="\\u2700-\\u27bf",cn="a-z\\xdf-\\xf6\\xf8-\\xff",np="\\xac\\xb1\\xd7\\xf7",sp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rp="\\u2000-\\u206f",Fa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hd="A-Z\\xc0-\\xd6\\xd8-\\xde",yu="\\ufe0e\\ufe0f",Su=np+sp+rp+Fa,fd="['’]",op="["+Di+"]",gd="["+Su+"]",Ba="["+Ni+"]",ko="\\d+",ap="["+Eo+"]",Io="["+cn+"]",To="[^"+Di+Su+ko+Eo+cn+hd+"]",Ao="\\ud83c[\\udffb-\\udfff]",lp="(?:"+Ba+"|"+Ao+")",Ln="[^"+Di+"]",pd="(?:\\ud83c[\\udde6-\\uddff]){2}",md="[\\ud800-\\udbff][\\udc00-\\udfff]",Tr="["+hd+"]",_t="\\u200d",wu="(?:"+Io+"|"+To+")",xu="(?:"+Tr+"|"+To+")",Eu="(?:"+fd+"(?:d|ll|m|re|s|t|ve))?",Lu="(?:"+fd+"(?:D|LL|M|RE|S|T|VE))?",ku=lp+"?",Iu="["+yu+"]?",cp="(?:"+_t+"(?:"+[Ln,pd,md].join("|")+")"+Iu+ku+")*",As="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xs=Iu+ku+cp,dp="(?:"+[ap,pd,md].join("|")+")"+Xs,up="(?:"+[Ln+Ba+"?",Ba,pd,md,op].join("|")+")",hp=RegExp(fd,"g"),Tu=RegExp(Ba,"g"),_d=RegExp(Ao+"(?="+Ao+")|"+up+Xs,"g"),fp=RegExp([Tr+"?"+Io+"+"+Eu+"(?="+[gd,Tr,"$"].join("|")+")",xu+"+"+Lu+"(?="+[gd,Tr+wu,"$"].join("|")+")",Tr+"?"+wu+"+"+Eu,Tr+"+"+Lu,Xn,As,ko,dp].join("|"),"g"),Du=RegExp("["+_t+Di+Ni+yu+"]"),ut=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nu=-1,wi={};wi[kt]=wi[hi]=wi[Vt]=wi[_i]=wi[Xt]=wi[At]=wi[Si]=wi[bi]=wi[vi]=!0,wi[De]=wi[Te]=wi[Ct]=wi[ze]=wi[Nt]=wi[Qe]=wi[Le]=wi[je]=wi[pe]=wi[Ie]=wi[ye]=wi[He]=wi[Ve]=wi[Oe]=wi[nt]=!1;var Ci={};Ci[De]=Ci[Te]=Ci[Ct]=Ci[Nt]=Ci[ze]=Ci[Qe]=Ci[kt]=Ci[hi]=Ci[Vt]=Ci[_i]=Ci[Xt]=Ci[pe]=Ci[Ie]=Ci[ye]=Ci[He]=Ci[Ve]=Ci[Oe]=Ci[ot]=Ci[At]=Ci[Si]=Ci[bi]=Ci[vi]=!0,Ci[Le]=Ci[je]=Ci[nt]=!1;var pp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},mp={"&":"&","<":"<",">":">",'"':""","'":"'"},Au={"&":"&","<":"<",">":">",""":'"',"'":"'"},_p={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ru=parseFloat,Pu=parseInt,Mu=typeof ha=="object"&&ha&&ha.Object===Object&&ha,bp=typeof self=="object"&&self&&self.Object===Object&&self,Vi=Mu||bp||Function("return this")(),Wa=e&&!e.nodeType&&e,Zs=Wa&&!0&&n&&!n.nodeType&&n,bd=Zs&&Zs.exports===Wa,vd=bd&&Mu.process,Xi=function(){try{var Se=Zs&&Zs.require&&Zs.require("util").types;return Se||vd&&vd.binding&&vd.binding("util")}catch{}}(),Ou=Xi&&Xi.isArrayBuffer,$u=Xi&&Xi.isDate,Ha=Xi&&Xi.isMap,Fu=Xi&&Xi.isRegExp,Bu=Xi&&Xi.isSet,za=Xi&&Xi.isTypedArray;function tn(Se,Me,Ne){switch(Ne.length){case 0:return Se.call(Me);case 1:return Se.call(Me,Ne[0]);case 2:return Se.call(Me,Ne[0],Ne[1]);case 3:return Se.call(Me,Ne[0],Ne[1],Ne[2])}return Se.apply(Me,Ne)}function vp(Se,Me,Ne,ct){for(var Et=-1,Qt=Se==null?0:Se.length;++Et-1}function Js(Se,Me,Ne){for(var ct=-1,Et=Se==null?0:Se.length;++ct-1;);return Ne}function Im(Se,Me){for(var Ne=Se.length;Ne--&&re(Me,Se[Ne],0)>-1;);return Ne}function Xv(Se,Me){for(var Ne=Se.length,ct=0;Ne--;)Se[Ne]===Me&&++ct;return ct}var Qv=Je(pp),Zv=Je(mp);function Jv(Se){return"\\"+_p[Se]}function e0(Se,Me){return Se==null?t:Se[Me]}function Ka(Se){return Du.test(Se)}function t0(Se){return ut.test(Se)}function i0(Se){for(var Me,Ne=[];!(Me=Se.next()).done;)Ne.push(Me.value);return Ne}function Sp(Se){var Me=-1,Ne=Array(Se.size);return Se.forEach(function(ct,Et){Ne[++Me]=[Et,ct]}),Ne}function Tm(Se,Me){return function(Ne){return Se(Me(Ne))}}function Rr(Se,Me){for(var Ne=-1,ct=Se.length,Et=0,Qt=[];++Ne-1}function z0(y,k){var M=this.__data__,V=ih(M,y);return V<0?(++this.size,M.push([y,k])):M[V][1]=k,this}er.prototype.clear=B0,er.prototype.delete=V0,er.prototype.get=W0,er.prototype.has=H0,er.prototype.set=z0;function tr(y){var k=-1,M=y==null?0:y.length;for(this.clear();++k=k?y:k)),y}function Dn(y,k,M,V,X,ne){var he,me=k&u,we=k&f,Fe=k&g;if(M&&(he=X?M(y,V,X,ne):M(y)),he!==t)return he;if(!Ai(y))return y;var Be=Tt(y);if(Be){if(he=qy(y),!me)return dn(y,he)}else{var Ke=Zi(y),st=Ke==je||Ke==le;if(no(y))return u1(y,me);if(Ke==ye||Ke==De||st&&!X){if(he=we||st?{}:ev(y),!me)return we?Oy(y,ry(he,y)):My(y,Wm(he,y))}else{if(!Ci[Ke])return X?y:{};he=Gy(y,Ke,me)}}ne||(ne=new Un);var mt=ne.get(y);if(mt)return mt;ne.set(y,he),Tv(y)?y.forEach(function(wt){he.add(Dn(wt,k,M,wt,y,ne))}):kv(y)&&y.forEach(function(wt,zt){he.set(zt,Dn(wt,k,M,zt,y,ne))});var St=Fe?we?Gp:qp:we?hn:qi,Mt=Be?t:St(y);return nn(Mt||y,function(wt,zt){Mt&&(zt=wt,wt=y[zt]),Ld(he,zt,Dn(wt,k,M,zt,y,ne))}),he}function oy(y){var k=qi(y);return function(M){return Hm(M,y,k)}}function Hm(y,k,M){var V=M.length;if(y==null)return!V;for(y=Ei(y);V--;){var X=M[V],ne=k[X],he=y[X];if(he===t&&!(X in y)||!ne(he))return!1}return!0}function zm(y,k,M){if(typeof y!="function")throw new In(o);return Rd(function(){y.apply(t,M)},k)}function kd(y,k,M,V){var X=-1,ne=Ua,he=!0,me=y.length,we=[],Fe=k.length;if(!me)return we;M&&(k=xi(k,zi(M))),V?(ne=Js,he=!1):k.length>=s&&(ne=Cd,he=!1,k=new Vo(k));e:for(;++XX?0:X+M),V=V===t||V>X?X:Rt(V),V<0&&(V+=X),V=M>V?0:Nv(V);M0&&M(me)?k>1?Yi(me,k-1,M,V,X):es(X,me):V||(X[X.length]=me)}return X}var Tp=_1(),jm=_1(!0);function ts(y,k){return y&&Tp(y,k,qi)}function Dp(y,k){return y&&jm(y,k,qi)}function sh(y,k){return Qn(k,function(M){return ar(y[M])})}function Go(y,k){k=eo(k,y);for(var M=0,V=k.length;y!=null&&Mk}function cy(y,k){return y!=null&&gi.call(y,k)}function dy(y,k){return y!=null&&k in Ei(y)}function uy(y,k,M){return y>=Qi(k,M)&&y=120&&Be.length>=120)?new Vo(he&&Be):t}Be=y[0];var Ke=-1,st=me[0];e:for(;++Ke-1;)me!==y&&Yu.call(me,we,1),Yu.call(y,we,1);return y}function n1(y,k){for(var M=y?k.length:0,V=M-1;M--;){var X=k[M];if(M==V||X!==ne){var ne=X;rr(X)?Yu.call(y,X,1):Vp(y,X)}}return y}function $p(y,k){return y+Zu($m()*(k-y+1))}function xy(y,k,M,V){for(var X=-1,ne=Ki(Qu((k-y)/(M||1)),0),he=Ne(ne);ne--;)he[V?ne:++X]=y,y+=M;return he}function Fp(y,k){var M="";if(!y||k<1||k>q)return M;do k%2&&(M+=y),k=Zu(k/2),k&&(y+=y);while(k);return M}function Bt(y,k){return tm(nv(y,k,fn),y+"")}function Ey(y){return Vm(il(y))}function Ly(y,k){var M=il(y);return ph(M,Ko(k,0,M.length))}function Dd(y,k,M,V){if(!Ai(y))return y;k=eo(k,y);for(var X=-1,ne=k.length,he=ne-1,me=y;me!=null&&++XX?0:X+k),M=M>X?X:M,M<0&&(M+=X),X=k>M?0:M-k>>>0,k>>>=0;for(var ne=Ne(X);++V>>1,he=y[ne];he!==null&&!vn(he)&&(M?he<=k:he=s){var Fe=k?null:Vy(y);if(Fe)return Wu(Fe);he=!1,X=Cd,we=new Vo}else we=k?[]:me;e:for(;++V=V?y:Nn(y,k,M)}var d1=_0||function(y){return Vi.clearTimeout(y)};function u1(y,k){if(k)return y.slice();var M=y.length,V=Am?Am(M):new y.constructor(M);return y.copy(V),V}function Up(y){var k=new y.constructor(y.byteLength);return new qu(k).set(new qu(y)),k}function Ny(y,k){var M=k?Up(y.buffer):y.buffer;return new y.constructor(M,y.byteOffset,y.byteLength)}function Ay(y){var k=new y.constructor(y.source,Ri.exec(y));return k.lastIndex=y.lastIndex,k}function Ry(y){return Ed?Ei(Ed.call(y)):{}}function h1(y,k){var M=k?Up(y.buffer):y.buffer;return new y.constructor(M,y.byteOffset,y.length)}function f1(y,k){if(y!==k){var M=y!==t,V=y===null,X=y===y,ne=vn(y),he=k!==t,me=k===null,we=k===k,Fe=vn(k);if(!me&&!Fe&&!ne&&y>k||ne&&he&&we&&!me&&!Fe||V&&he&&we||!M&&we||!X)return 1;if(!V&&!ne&&!Fe&&y=me)return we;var Fe=M[V];return we*(Fe=="desc"?-1:1)}}return y.index-k.index}function g1(y,k,M,V){for(var X=-1,ne=y.length,he=M.length,me=-1,we=k.length,Fe=Ki(ne-he,0),Be=Ne(we+Fe),Ke=!V;++me1?M[X-1]:t,he=X>2?M[2]:t;for(ne=y.length>3&&typeof ne=="function"?(X--,ne):t,he&&rn(M[0],M[1],he)&&(ne=X<3?t:ne,X=1),k=Ei(k);++V-1?X[ne?k[he]:he]:t}}function C1(y){return sr(function(k){var M=k.length,V=M,X=Tn.prototype.thru;for(y&&k.reverse();V--;){var ne=k[V];if(typeof ne!="function")throw new In(o);if(X&&!he&&fh(ne)=="wrapper")var he=new Tn([],!0)}for(V=he?V:M;++V1&&Kt.reverse(),Be&&weme))return!1;var Fe=ne.get(y),Be=ne.get(k);if(Fe&&Be)return Fe==k&&Be==y;var Ke=-1,st=!0,mt=M&_?new Vo:t;for(ne.set(y,k),ne.set(k,y);++Ke1?"& ":"")+k[V],k=k.join(M>2?", ":" "),y.replace(Ye,`{ +/* [wrapped with `+k+`] */ +`)}function Xy(y){return Tt(y)||Zo(y)||!!(Mm&&y&&y[Mm])}function rr(y,k){var M=typeof y;return k=k??q,!!k&&(M=="number"||M!="symbol"&&Xe.test(y))&&y>-1&&y%1==0&&y0){if(++k>=W)return arguments[0]}else k=0;return y.apply(t,arguments)}}function ph(y,k){var M=-1,V=y.length,X=V-1;for(k=k===t?V:k;++M1?y[k-1]:t;return M=typeof M=="function"?(y.pop(),M):t,pv(y,M)});function mv(y){var k=J(y);return k.__chain__=!0,k}function aI(y,k){return k(y),y}function mh(y,k){return k(y)}var lI=sr(function(y){var k=y.length,M=k?y[0]:0,V=this.__wrapped__,X=function(ne){return Ip(ne,y)};return k>1||this.__actions__.length||!(V instanceof Ut)||!rr(M)?this.thru(X):(V=V.slice(M,+M+(k?1:0)),V.__actions__.push({func:mh,args:[X],thisArg:t}),new Tn(V,this.__chain__).thru(function(ne){return k&&!ne.length&&ne.push(t),ne}))});function cI(){return mv(this)}function dI(){return new Tn(this.value(),this.__chain__)}function uI(){this.__values__===t&&(this.__values__=Dv(this.value()));var y=this.__index__>=this.__values__.length,k=y?t:this.__values__[this.__index__++];return{done:y,value:k}}function hI(){return this}function fI(y){for(var k,M=this;M instanceof th;){var V=cv(M);V.__index__=0,V.__values__=t,k?X.__wrapped__=V:k=V;var X=V;M=M.__wrapped__}return X.__wrapped__=y,k}function gI(){var y=this.__wrapped__;if(y instanceof Ut){var k=y;return this.__actions__.length&&(k=new Ut(this)),k=k.reverse(),k.__actions__.push({func:mh,args:[im],thisArg:t}),new Tn(k,this.__chain__)}return this.thru(im)}function pI(){return l1(this.__wrapped__,this.__actions__)}var mI=lh(function(y,k,M){gi.call(y,M)?++y[M]:ir(y,M,1)});function _I(y,k,M){var V=Tt(y)?Vu:ay;return M&&rn(y,k,M)&&(k=t),V(y,yt(k,3))}function bI(y,k){var M=Tt(y)?Qn:Km;return M(y,yt(k,3))}var vI=v1(dv),CI=v1(uv);function yI(y,k){return Yi(_h(y,k),1)}function SI(y,k){return Yi(_h(y,k),U)}function wI(y,k,M){return M=M===t?1:Rt(M),Yi(_h(y,k),M)}function _v(y,k){var M=Tt(y)?nn:Qr;return M(y,yt(k,3))}function bv(y,k){var M=Tt(y)?Cp:Um;return M(y,yt(k,3))}var xI=lh(function(y,k,M){gi.call(y,M)?y[M].push(k):ir(y,M,[k])});function EI(y,k,M,V){y=un(y)?y:il(y),M=M&&!V?Rt(M):0;var X=y.length;return M<0&&(M=Ki(X+M,0)),Sh(y)?M<=X&&y.indexOf(k,M)>-1:!!X&&re(y,k,M)>-1}var LI=Bt(function(y,k,M){var V=-1,X=typeof k=="function",ne=un(y)?Ne(y.length):[];return Qr(y,function(he){ne[++V]=X?tn(k,he,M):Id(he,k,M)}),ne}),kI=lh(function(y,k,M){ir(y,M,k)});function _h(y,k){var M=Tt(y)?xi:Qm;return M(y,yt(k,3))}function II(y,k,M,V){return y==null?[]:(Tt(k)||(k=k==null?[]:[k]),M=V?t:M,Tt(M)||(M=M==null?[]:[M]),t1(y,k,M))}var TI=lh(function(y,k,M){y[M?0:1].push(k)},function(){return[[],[]]});function DI(y,k,M){var V=Tt(y)?H:ft,X=arguments.length<3;return V(y,yt(k,4),M,X,Qr)}function NI(y,k,M){var V=Tt(y)?x:ft,X=arguments.length<3;return V(y,yt(k,4),M,X,Um)}function AI(y,k){var M=Tt(y)?Qn:Km;return M(y,Ch(yt(k,3)))}function RI(y){var k=Tt(y)?Vm:Ey;return k(y)}function PI(y,k,M){(M?rn(y,k,M):k===t)?k=1:k=Rt(k);var V=Tt(y)?iy:Ly;return V(y,k)}function MI(y){var k=Tt(y)?ny:Iy;return k(y)}function OI(y){if(y==null)return 0;if(un(y))return Sh(y)?ja(y):y.length;var k=Zi(y);return k==pe||k==Ve?y.size:Pp(y).length}function $I(y,k,M){var V=Tt(y)?b:Ty;return M&&rn(y,k,M)&&(k=t),V(y,yt(k,3))}var FI=Bt(function(y,k){if(y==null)return[];var M=k.length;return M>1&&rn(y,k[0],k[1])?k=[]:M>2&&rn(k[0],k[1],k[2])&&(k=[k[0]]),t1(y,Yi(k,1),[])}),bh=b0||function(){return Vi.Date.now()};function BI(y,k){if(typeof k!="function")throw new In(o);return y=Rt(y),function(){if(--y<1)return k.apply(this,arguments)}}function vv(y,k,M){return k=M?t:k,k=y&&k==null?y.length:k,nr(y,R,t,t,t,t,k)}function Cv(y,k){var M;if(typeof k!="function")throw new In(o);return y=Rt(y),function(){return--y>0&&(M=k.apply(this,arguments)),y<=1&&(k=t),M}}var sm=Bt(function(y,k,M){var V=v;if(M.length){var X=Rr(M,el(sm));V|=I}return nr(y,V,k,M,X)}),yv=Bt(function(y,k,M){var V=v|C;if(M.length){var X=Rr(M,el(yv));V|=I}return nr(k,V,y,M,X)});function Sv(y,k,M){k=M?t:k;var V=nr(y,w,t,t,t,t,t,k);return V.placeholder=Sv.placeholder,V}function wv(y,k,M){k=M?t:k;var V=nr(y,L,t,t,t,t,t,k);return V.placeholder=wv.placeholder,V}function xv(y,k,M){var V,X,ne,he,me,we,Fe=0,Be=!1,Ke=!1,st=!0;if(typeof y!="function")throw new In(o);k=Rn(k)||0,Ai(M)&&(Be=!!M.leading,Ke="maxWait"in M,ne=Ke?Ki(Rn(M.maxWait)||0,k):ne,st="trailing"in M?!!M.trailing:st);function mt(Oi){var qn=V,cr=X;return V=X=t,Fe=Oi,he=y.apply(cr,qn),he}function St(Oi){return Fe=Oi,me=Rd(zt,k),Be?mt(Oi):he}function Mt(Oi){var qn=Oi-we,cr=Oi-Fe,zv=k-qn;return Ke?Qi(zv,ne-cr):zv}function wt(Oi){var qn=Oi-we,cr=Oi-Fe;return we===t||qn>=k||qn<0||Ke&&cr>=ne}function zt(){var Oi=bh();if(wt(Oi))return Kt(Oi);me=Rd(zt,Mt(Oi))}function Kt(Oi){return me=t,st&&V?mt(Oi):(V=X=t,he)}function Sn(){me!==t&&d1(me),Fe=0,V=we=X=me=t}function an(){return me===t?he:Kt(bh())}function wn(){var Oi=bh(),qn=wt(Oi);if(V=arguments,X=this,we=Oi,qn){if(me===t)return St(we);if(Ke)return d1(me),me=Rd(zt,k),mt(we)}return me===t&&(me=Rd(zt,k)),he}return wn.cancel=Sn,wn.flush=an,wn}var VI=Bt(function(y,k){return zm(y,1,k)}),WI=Bt(function(y,k,M){return zm(y,Rn(k)||0,M)});function HI(y){return nr(y,A)}function vh(y,k){if(typeof y!="function"||k!=null&&typeof k!="function")throw new In(o);var M=function(){var V=arguments,X=k?k.apply(this,V):V[0],ne=M.cache;if(ne.has(X))return ne.get(X);var he=y.apply(this,V);return M.cache=ne.set(X,he)||ne,he};return M.cache=new(vh.Cache||tr),M}vh.Cache=tr;function Ch(y){if(typeof y!="function")throw new In(o);return function(){var k=arguments;switch(k.length){case 0:return!y.call(this);case 1:return!y.call(this,k[0]);case 2:return!y.call(this,k[0],k[1]);case 3:return!y.call(this,k[0],k[1],k[2])}return!y.apply(this,k)}}function zI(y){return Cv(2,y)}var UI=Dy(function(y,k){k=k.length==1&&Tt(k[0])?xi(k[0],zi(yt())):xi(Yi(k,1),zi(yt()));var M=k.length;return Bt(function(V){for(var X=-1,ne=Qi(V.length,M);++X=k}),Zo=Gm(function(){return arguments}())?Gm:function(y){return Pi(y)&&gi.call(y,"callee")&&!Pm.call(y,"callee")},Tt=Ne.isArray,rD=Ou?zi(Ou):fy;function un(y){return y!=null&&yh(y.length)&&!ar(y)}function Mi(y){return Pi(y)&&un(y)}function oD(y){return y===!0||y===!1||Pi(y)&&sn(y)==ze}var no=C0||mm,aD=$u?zi($u):gy;function lD(y){return Pi(y)&&y.nodeType===1&&!Pd(y)}function cD(y){if(y==null)return!0;if(un(y)&&(Tt(y)||typeof y=="string"||typeof y.splice=="function"||no(y)||tl(y)||Zo(y)))return!y.length;var k=Zi(y);if(k==pe||k==Ve)return!y.size;if(Ad(y))return!Pp(y).length;for(var M in y)if(gi.call(y,M))return!1;return!0}function dD(y,k){return Td(y,k)}function uD(y,k,M){M=typeof M=="function"?M:t;var V=M?M(y,k):t;return V===t?Td(y,k,t,M):!!V}function om(y){if(!Pi(y))return!1;var k=sn(y);return k==Le||k==qe||typeof y.message=="string"&&typeof y.name=="string"&&!Pd(y)}function hD(y){return typeof y=="number"&&Om(y)}function ar(y){if(!Ai(y))return!1;var k=sn(y);return k==je||k==le||k==xe||k==Ue}function Lv(y){return typeof y=="number"&&y==Rt(y)}function yh(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=q}function Ai(y){var k=typeof y;return y!=null&&(k=="object"||k=="function")}function Pi(y){return y!=null&&typeof y=="object"}var kv=Ha?zi(Ha):my;function fD(y,k){return y===k||Rp(y,k,Xp(k))}function gD(y,k,M){return M=typeof M=="function"?M:t,Rp(y,k,Xp(k),M)}function pD(y){return Iv(y)&&y!=+y}function mD(y){if(Jy(y))throw new Et(r);return Ym(y)}function _D(y){return y===null}function bD(y){return y==null}function Iv(y){return typeof y=="number"||Pi(y)&&sn(y)==Ie}function Pd(y){if(!Pi(y)||sn(y)!=ye)return!1;var k=Gu(y);if(k===null)return!0;var M=gi.call(k,"constructor")&&k.constructor;return typeof M=="function"&&M instanceof M&&Uu.call(M)==g0}var am=Fu?zi(Fu):_y;function vD(y){return Lv(y)&&y>=-q&&y<=q}var Tv=Bu?zi(Bu):by;function Sh(y){return typeof y=="string"||!Tt(y)&&Pi(y)&&sn(y)==Oe}function vn(y){return typeof y=="symbol"||Pi(y)&&sn(y)==ot}var tl=za?zi(za):vy;function CD(y){return y===t}function yD(y){return Pi(y)&&Zi(y)==nt}function SD(y){return Pi(y)&&sn(y)==lt}var wD=hh(Mp),xD=hh(function(y,k){return y<=k});function Dv(y){if(!y)return[];if(un(y))return Sh(y)?zn(y):dn(y);if(yd&&y[yd])return i0(y[yd]());var k=Zi(y),M=k==pe?Sp:k==Ve?Wu:il;return M(y)}function lr(y){if(!y)return y===0?y:0;if(y=Rn(y),y===U||y===-U){var k=y<0?-1:1;return k*Q}return y===y?y:0}function Rt(y){var k=lr(y),M=k%1;return k===k?M?k-M:k:0}function Nv(y){return y?Ko(Rt(y),0,ie):0}function Rn(y){if(typeof y=="number")return y;if(vn(y))return ce;if(Ai(y)){var k=typeof y.valueOf=="function"?y.valueOf():y;y=Ai(k)?k+"":k}if(typeof y!="string")return y===0?y:+y;y=Ro(y);var M=ys.test(y);return M||ve.test(y)?Pu(y.slice(2),M?2:8):Hi.test(y)?ce:+y}function Av(y){return is(y,hn(y))}function ED(y){return y?Ko(Rt(y),-q,q):y===0?y:0}function Jt(y){return y==null?"":_n(y)}var LD=Za(function(y,k){if(Ad(k)||un(k)){is(k,qi(k),y);return}for(var M in k)gi.call(k,M)&&Ld(y,M,k[M])}),Rv=Za(function(y,k){is(k,hn(k),y)}),wh=Za(function(y,k,M,V){is(k,hn(k),y,V)}),kD=Za(function(y,k,M,V){is(k,qi(k),y,V)}),ID=sr(Ip);function TD(y,k){var M=Qa(y);return k==null?M:Wm(M,k)}var DD=Bt(function(y,k){y=Ei(y);var M=-1,V=k.length,X=V>2?k[2]:t;for(X&&rn(k[0],k[1],X)&&(V=1);++M1),ne}),is(y,Gp(y),M),V&&(M=Dn(M,u|f|g,Wy));for(var X=k.length;X--;)Vp(M,k[X]);return M});function GD(y,k){return Mv(y,Ch(yt(k)))}var YD=sr(function(y,k){return y==null?{}:Sy(y,k)});function Mv(y,k){if(y==null)return{};var M=xi(Gp(y),function(V){return[V]});return k=yt(k),i1(y,M,function(V,X){return k(V,X[0])})}function XD(y,k,M){k=eo(k,y);var V=-1,X=k.length;for(X||(X=1,y=t);++Vk){var V=y;y=k,k=V}if(M||y%1||k%1){var X=$m();return Qi(y+X*(k-y+Ru("1e-"+((X+"").length-1))),k)}return $p(y,k)}var aN=Ja(function(y,k,M){return k=k.toLowerCase(),y+(M?Fv(k):k)});function Fv(y){return dm(Jt(y).toLowerCase())}function Bv(y){return y=Jt(y),y&&y.replace(rt,Qv).replace(Tu,"")}function lN(y,k,M){y=Jt(y),k=_n(k);var V=y.length;M=M===t?V:Ko(Rt(M),0,V);var X=M;return M-=k.length,M>=0&&y.slice(M,X)==k}function cN(y){return y=Jt(y),y&&xo.test(y)?y.replace(Li,Zv):y}function dN(y){return y=Jt(y),y&&_e.test(y)?y.replace(ge,"\\$&"):y}var uN=Ja(function(y,k,M){return y+(M?"-":"")+k.toLowerCase()}),hN=Ja(function(y,k,M){return y+(M?" ":"")+k.toLowerCase()}),fN=b1("toLowerCase");function gN(y,k,M){y=Jt(y),k=Rt(k);var V=k?ja(y):0;if(!k||V>=k)return y;var X=(k-V)/2;return uh(Zu(X),M)+y+uh(Qu(X),M)}function pN(y,k,M){y=Jt(y),k=Rt(k);var V=k?ja(y):0;return k&&V>>0,M?(y=Jt(y),y&&(typeof k=="string"||k!=null&&!am(k))&&(k=_n(k),!k&&Ka(y))?to(zn(y),0,M):y.split(k,M)):[]}var SN=Ja(function(y,k,M){return y+(M?" ":"")+dm(k)});function wN(y,k,M){return y=Jt(y),M=M==null?0:Ko(Rt(M),0,y.length),k=_n(k),y.slice(M,M+k.length)==k}function xN(y,k,M){var V=J.templateSettings;M&&rn(y,k,M)&&(k=t),y=Jt(y),k=wh({},k,V,E1);var X=wh({},k.imports,V.imports,E1),ne=qi(X),he=yp(X,ne),me,we,Fe=0,Be=k.interpolate||jt,Ke="__p += '",st=wp((k.escape||jt).source+"|"+Be.source+"|"+(Be===vt?Yt:jt).source+"|"+(k.evaluate||jt).source+"|$","g"),mt="//# sourceURL="+(gi.call(k,"sourceURL")?(k.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nu+"]")+` +`;y.replace(st,function(wt,zt,Kt,Sn,an,wn){return Kt||(Kt=Sn),Ke+=y.slice(Fe,wn).replace(Fi,Jv),zt&&(me=!0,Ke+=`' + +__e(`+zt+`) + +'`),an&&(we=!0,Ke+=`'; +`+an+`; +__p += '`),Kt&&(Ke+=`' + +((__t = (`+Kt+`)) == null ? '' : __t) + +'`),Fe=wn+wt.length,wt}),Ke+=`'; +`;var St=gi.call(k,"variable")&&k.variable;if(!St)Ke=`with (obj) { +`+Ke+` +} +`;else if(It.test(St))throw new Et(a);Ke=(we?Ke.replace(Ot,""):Ke).replace(Hn,"$1").replace(Cr,"$1;"),Ke="function("+(St||"obj")+`) { +`+(St?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(me?", __e = _.escape":"")+(we?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Ke+`return __p +}`;var Mt=Wv(function(){return Qt(ne,mt+"return "+Ke).apply(t,he)});if(Mt.source=Ke,om(Mt))throw Mt;return Mt}function EN(y){return Jt(y).toLowerCase()}function LN(y){return Jt(y).toUpperCase()}function kN(y,k,M){if(y=Jt(y),y&&(M||k===t))return Ro(y);if(!y||!(k=_n(k)))return y;var V=zn(y),X=zn(k),ne=km(V,X),he=Im(V,X)+1;return to(V,ne,he).join("")}function IN(y,k,M){if(y=Jt(y),y&&(M||k===t))return y.slice(0,Dm(y)+1);if(!y||!(k=_n(k)))return y;var V=zn(y),X=Im(V,zn(k))+1;return to(V,0,X).join("")}function TN(y,k,M){if(y=Jt(y),y&&(M||k===t))return y.replace(Ee,"");if(!y||!(k=_n(k)))return y;var V=zn(y),X=km(V,zn(k));return to(V,X).join("")}function DN(y,k){var M=F,V=B;if(Ai(k)){var X="separator"in k?k.separator:X;M="length"in k?Rt(k.length):M,V="omission"in k?_n(k.omission):V}y=Jt(y);var ne=y.length;if(Ka(y)){var he=zn(y);ne=he.length}if(M>=ne)return y;var me=M-ja(V);if(me<1)return V;var we=he?to(he,0,me).join(""):y.slice(0,me);if(X===t)return we+V;if(he&&(me+=we.length-me),am(X)){if(y.slice(me).search(X)){var Fe,Be=we;for(X.global||(X=wp(X.source,Jt(Ri.exec(X))+"g")),X.lastIndex=0;Fe=X.exec(Be);)var Ke=Fe.index;we=we.slice(0,Ke===t?me:Ke)}}else if(y.indexOf(_n(X),me)!=me){var st=we.lastIndexOf(X);st>-1&&(we=we.slice(0,st))}return we+V}function NN(y){return y=Jt(y),y&&mn.test(y)?y.replace(ps,o0):y}var AN=Ja(function(y,k,M){return y+(M?" ":"")+k.toUpperCase()}),dm=b1("toUpperCase");function Vv(y,k,M){return y=Jt(y),k=M?t:k,k===t?t0(y)?c0(y):O(y):y.match(k)||[]}var Wv=Bt(function(y,k){try{return tn(y,t,k)}catch(M){return om(M)?M:new Et(M)}}),RN=sr(function(y,k){return nn(k,function(M){M=ns(M),ir(y,M,sm(y[M],y))}),y});function PN(y){var k=y==null?0:y.length,M=yt();return y=k?xi(y,function(V){if(typeof V[1]!="function")throw new In(o);return[M(V[0]),V[1]]}):[],Bt(function(V){for(var X=-1;++Xq)return[];var M=ie,V=Qi(y,ie);k=yt(k),y-=ie;for(var X=Ht(V,k);++M0||k<0)?new Ut(M):(y<0?M=M.takeRight(-y):y&&(M=M.drop(y)),k!==t&&(k=Rt(k),M=k<0?M.dropRight(-k):M.take(k-y)),M)},Ut.prototype.takeRightWhile=function(y){return this.reverse().takeWhile(y).reverse()},Ut.prototype.toArray=function(){return this.take(ie)},ts(Ut.prototype,function(y,k){var M=/^(?:filter|find|map|reject)|While$/.test(k),V=/^(?:head|last)$/.test(k),X=J[V?"take"+(k=="last"?"Right":""):k],ne=V||/^find/.test(k);X&&(J.prototype[k]=function(){var he=this.__wrapped__,me=V?[1]:arguments,we=he instanceof Ut,Fe=me[0],Be=we||Tt(he),Ke=function(zt){var Kt=X.apply(J,es([zt],me));return V&&st?Kt[0]:Kt};Be&&M&&typeof Fe=="function"&&Fe.length!=1&&(we=Be=!1);var st=this.__chain__,mt=!!this.__actions__.length,St=ne&&!st,Mt=we&&!mt;if(!ne&&Be){he=Mt?he:new Ut(this);var wt=y.apply(he,me);return wt.__actions__.push({func:mh,args:[Ke],thisArg:t}),new Tn(wt,st)}return St&&Mt?y.apply(this,me):(wt=this.thru(Ke),St?V?wt.value()[0]:wt.value():wt)})}),nn(["pop","push","shift","sort","splice","unshift"],function(y){var k=Hu[y],M=/^(?:push|sort|unshift)$/.test(y)?"tap":"thru",V=/^(?:pop|shift)$/.test(y);J.prototype[y]=function(){var X=arguments;if(V&&!this.__chain__){var ne=this.value();return k.apply(Tt(ne)?ne:[],X)}return this[M](function(he){return k.apply(Tt(he)?he:[],X)})}}),ts(Ut.prototype,function(y,k){var M=J[k];if(M){var V=M.name+"";gi.call(Xa,V)||(Xa[V]=[]),Xa[V].push({name:k,func:M})}}),Xa[ch(t,C).name]=[{name:"wrapper",func:t}],Ut.prototype.clone=N0,Ut.prototype.reverse=A0,Ut.prototype.value=R0,J.prototype.at=lI,J.prototype.chain=cI,J.prototype.commit=dI,J.prototype.next=uI,J.prototype.plant=fI,J.prototype.reverse=gI,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=pI,J.prototype.first=J.prototype.head,yd&&(J.prototype[yd]=hI),J},qa=d0();Zs?((Zs.exports=qa)._=qa,Wa._=qa):Vi._=qa}).call(ha)})(Ir,Ir.exports);var gn=Ir.exports;const fw={key:0},pw=defineComponent({__name:"ShadcnEllipsis",props:{text:{},line:{default:1},tooltip:{type:Boolean},length:{}},setup(n){const e=n,t=computed(()=>gn.toNumber(e.line)>1),i=ref(e.text),s=(l,c)=>{if(!l)return"";const d=gn.toNumber(c);return d&&l.length>d?l.slice(0,d)+"...":l},r=ref(null),o=()=>{const l=r.value;if(l&&!a()){const c=parseInt(getComputedStyle(l).lineHeight,10)*gn.toNumber(e.line);if(l.scrollHeight>c){let d=e.text||"";for(;l.scrollHeight>c&&d.length>0;)d=d.slice(0,-1),i.value=d+"..."}}},a=()=>"webkitLineClamp"in document.body.style||"lineClamp"in document.body.style;return onMounted(()=>{i.value=s(e.text,e.length),a()||o()}),(l,c)=>(openBlock(),createElementBlock("div",{ref_key:"ellipsisContent",ref:r,class:normalizeClass$1(unref($t)("max-w-full",t.value?"overflow-hidden":"whitespace-nowrap overflow-ellipsis",l.length?"whitespace-normal":"overflow-hidden")),style:normalizeStyle$1(t.value?{"-webkit-line-clamp":l.line,"-webkit-box-orient":"vertical",display:"-webkit-box"}:{})},[l.tooltip?(openBlock(),createBlock$1(unref(Po),{key:0,content:l.text},{default:withCtx(()=>[l.text?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString$1(i.value),1)],64)):renderSlot(l.$slots,"default",{key:1})]),_:3},8,["content"])):(openBlock(),createElementBlock(Fragment,{key:1},[l.text?(openBlock(),createElementBlock("span",fw,toDisplayString$1(i.value),1)):renderSlot(l.$slots,"default",{key:1})],64))],6))}}),hw=["src","alt"],Os=defineComponent({__name:"ShadcnAvatar",props:{src:{},alt:{},size:{default:"default"},square:{type:Boolean}},emits:["on-success","on-failed"],setup(n,{emit:e}){const t=e,i=()=>t("on-success"),s=()=>t("on-failed");return(r,o)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)("relative inline-block overflow-hidden bg-muted",r.size&&unref(Bo)[r.size],r.square?"rounded-sm":"rounded-full"))},[r.src?(openBlock(),createElementBlock("img",{key:0,src:String(r.src),class:normalizeClass$1(unref($t)("h-full w-full object-cover cursor-pointer border-white border-2")),alt:r.alt,onLoad:i,onError:s},null,42,hw)):(openBlock(),createElementBlock("div",{key:1,class:normalizeClass$1(unref($t)("flex h-full w-full items-center justify-center bg-muted font-medium",r.size&&unref(Bo)[r.size]))},toDisplayString$1(r.alt),3))],2))}}),mw={class:"flex -space-x-3"},vw=defineComponent({__name:"ShadcnAvatarGroup",props:{items:{},size:{default:"default"},square:{type:Boolean,default:!1},max:{}},setup(n){const e=n,t=computed(()=>{var s;return(s=e.items)==null?void 0:s.slice(0,Number(e.max)||1/0)}),i=computed(()=>{var s;return Math.max(0,(((s=e.items)==null?void 0:s.length)??0)-(Number(e.max)||1/0))});return(s,r)=>(openBlock(),createElementBlock("div",mw,[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.value,(o,a)=>(openBlock(),createBlock$1(unref(Po),{key:a,content:o.name},{default:withCtx(()=>[createVNode(unref(Os),{class:"ring-2 ring-background",src:o.src,alt:o.name,size:s.size,square:s.square},null,8,["src","alt","size","square"])]),_:2},1032,["content"]))),128)),i.value>0?(openBlock(),createBlock$1(unref(Os),{key:0,class:"text-gray-500 text-sm font-thin",alt:`+${i.value}`,size:s.size,square:s.square},null,8,["alt","size","square"])):createCommentVNode("",!0)]))}}),gw=defineComponent({__name:"ShadcnBadge",props:{text:{},type:{default:"primary"},dot:{type:Boolean},max:{default:1/0}},setup(n){const e=n,t=computed(()=>{if(typeof e.text=="number"||!gn.isNaN(gn.toNumber(e.text))){const i=gn.toNumber(e.text),s=gn.toNumber(e.max);return i>s?`${s}+`:i}return e.text});return(i,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["relative",i.$slots.default&&"inline-block"])},[renderSlot(i.$slots,"default"),createBaseVNode("div",{class:normalizeClass$1(unref($t)("top-0 right-0 rounded-full w-fit text-white text-xs font-medium",i.dot?"p-1":"px-1.5 py-0.5",i.$slots.default&&"absolute translate-x-1/2 -translate-y-1/2",unref(Ar)[i.type]))},[renderSlot(i.$slots,"text",{},()=>[createTextVNode(toDisplayString$1(t.value),1)])],2)],2))}}),yw={class:"flex items-center gap-3"},bw={key:0,class:"flex-shrink-0"},ww={key:1,class:"flex-shrink-0"},xw={class:"flex-1 min-w-0"},_w={key:0,class:"text-sm font-medium leading-none tracking-tight"},Cw={key:0},kw=defineComponent({__name:"ShadcnAlert",props:{title:{},type:{default:"primary"},showIcon:{type:Boolean},banner:{type:Boolean},closable:{type:Boolean,default:!1}},emits:["on-close"],setup(n,{emit:e}){const t={primary:"Info",success:"CheckCircle",warning:"AlertTriangle",error:"XCircle"},i=e,s=ref(!0),r=()=>{s.value=!1,i("on-close",s.value)};return(o,a)=>s.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["relative w-full border py-2 px-3",o.banner?"rounded-none":"rounded-md",unref(Qs)[o.type],unref(Cc)[o.type]])},[createBaseVNode("div",yw,[!o.banner&&o.showIcon?(openBlock(),createElementBlock("div",bw,[createVNode(unref(at),{icon:t[o.type],class:normalizeClass$1(["h-5 w-5",unref(mo)[o.type]])},null,8,["icon","class"])])):o.$slots.icon?(openBlock(),createElementBlock("div",ww,[renderSlot(o.$slots,"icon")])):createCommentVNode("",!0),createBaseVNode("div",xw,[!o.banner&&(o.title||o.$slots.title)?(openBlock(),createElementBlock("div",_w,[o.title?(openBlock(),createElementBlock("span",Cw,toDisplayString$1(o.title),1)):o.$slots.title?renderSlot(o.$slots,"title",{key:1}):createCommentVNode("",!0)])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["text-sm",{"mt-1":o.title||o.$slots.title}])},[renderSlot(o.$slots,"default")],2)]),o.closable?(openBlock(),createElementBlock("div",{key:2,class:"flex-shrink-0 mr-2 cursor-pointer text-gray-500 hover:text-gray-700",onClick:r},[o.$slots.close?renderSlot(o.$slots,"close",{key:0}):(openBlock(),createBlock$1(unref(at),{key:1,icon:"XCircle",class:"h-4 w-4"}))])):createCommentVNode("",!0)])],2)):createCommentVNode("",!0)}}),$w={key:0,class:"absolute inset-0 flex items-center justify-center text-white text-xs font-normal"};var jc=(n=>(n.success="bg-green-500",n.error="bg-red-500",n.warning="bg-yellow-500",n.info="bg-blue-500",n))(jc||{}),Yc=(n=>(n.default="h-2.5",n.large="h-5",n))(Yc||{});const Sw=defineComponent({__name:"ShadcnProgress",props:{modelValue:{},status:{default:"info"},size:{default:"default"},showLabel:{type:Boolean}},setup(n){const e=n,t=s=>Math.min(Math.max(s,0),100),i=ref(t(e.modelValue));return watch(()=>e.modelValue,s=>{i.value=t(s)}),(s,r)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)("relative w-full bg-gray-200 rounded-lg",s.size&&Yc[s.size]))},[createBaseVNode("div",{class:normalizeClass$1(unref($t)("h-full rounded-lg transition-all",s.status&&jc[s.status])),style:normalizeStyle$1({width:i.value+"%"})},null,6),s.showLabel?(openBlock(),createElementBlock("div",$w,toDisplayString$1(i.value)+"% ",1)):createCommentVNode("",!0)],2))}});var Bs=(n=>(n.small="8",n.default="16",n.large="24",n))(Bs||{});const xa=defineComponent({__name:"ShadcnSpace",props:{size:{default:"small"},wrap:{type:Boolean}},setup(n){const e=n,t=computed(()=>Array.isArray(e.size)?`${e.size[0]}px ${e.size[1]}px`:e.size in Bs?`${Bs[e.size]}px`:`${e.size}px`);return(i,s)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(unref($t)("flex",i.wrap&&"flex-wrap")),style:normalizeStyle$1({gap:`${t.value}`})},[renderSlot(i.$slots,"default")],6))}}),Vw={key:0,class:"absolute left-0 pl-1.5 text-white text-xs z-10"},Ew={key:1,class:"absolute right-0 pr-1.5 text-white text-xs"},Tw=["checked"];var Ds=(n=>(n.small="w-10 h-5",n.default="w-14 h-6",n.large="w-20 h-8",n))(Ds||{});const Rw=defineComponent({__name:"ShadcnSwitch",props:{modelValue:{default:!1},type:{default:"primary"},size:{default:"default"},disabled:{type:Boolean},trueValue:{default:!0},falseValue:{default:!1}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i={small:"w-5 h-4",default:"w-6 h-6",large:"w-8 h-6"},s=n,r=computed(()=>s.modelValue===s.trueValue),o=()=>{if(s.disabled)return;const l=r.value?s.falseValue:s.trueValue;t("update:modelValue",l),t("on-change",l)},a=l=>{if(s.disabled)return;const c=l.target.checked?s.trueValue:s.falseValue;t("update:modelValue",c),t("on-change",c)};return(l,c)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["relative inline-flex items-center",Ds[l.size],{"cursor-pointer":!l.disabled,"cursor-not-allowed opacity-50":l.disabled}]),onClick:o},[createBaseVNode("div",{class:normalizeClass$1(["relative w-full flex items-center justify-between",Ds[l.size]])},[l.$slots.close&&r.value?(openBlock(),createElementBlock("div",Vw,[renderSlot(l.$slots,"close")])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["absolute w-full h-full rounded-full transition-colors duration-300",{"bg-blue-400":l.type==="primary"&&r.value,"bg-green-400":l.type==="success"&&r.value,"bg-yellow-400":l.type==="warning"&&r.value,"bg-red-400":l.type==="error"&&r.value,"bg-gray-300":!r.value}])},null,2),l.$slots.open&&!r.value?(openBlock(),createElementBlock("div",Ew,[renderSlot(l.$slots,"open")])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["absolute h-full bg-white rounded-full transition-all duration-300",i[l.size],{"left-0":!r.value,"right-0":r.value}])},null,2),createBaseVNode("input",{type:"checkbox",class:"sr-only",checked:r.value,onChange:a},null,40,Tw)],2)],2))}}),Aw=["value","checked","disabled"],Mw={key:0,class:"ml-2 text-sm"},Nw={key:1,class:"ml-2 text-sm"};var Kc=(n=>(n.default="w-5 h-5",n.small="w-4 h-4",n.large="w-6 h-6",n))(Kc||{}),Jc=(n=>(n.default="w-3 h-3",n.small="w-2 h-2",n.large="w-4 h-4",n))(Jc||{});const Iw=defineComponent({__name:"ShadcnRadio",props:{modelValue:{},value:{},disabled:{type:Boolean,default:!1},size:{default:"default"},type:{default:"primary"}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i=n,s=inject("radioGroup",null),r=computed(()=>s?s.modelValue.modelValue===i.value:i.modelValue===i.value),o=()=>{i.disabled||(s?s.updateModelValue(i.value):(t("update:modelValue",i.value),t("on-change",i.value)))};return(a,l)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["inline-flex items-center",{"cursor-pointer":!a.disabled,"cursor-not-allowed opacity-50":a.disabled}]),onClick:o},[createBaseVNode("input",{type:"radio",value:a.value,checked:r.value,disabled:a.disabled,class:"sr-only"},null,8,Aw),createBaseVNode("div",{class:normalizeClass$1(["flex items-center justify-center rounded-full border transition-colors duration-300",Kc[a.size],{"bg-blue-400":a.type==="primary"&&r.value,"bg-green-400":a.type==="success"&&r.value,"bg-yellow-400":a.type==="warning"&&r.value,"bg-red-400":a.type==="error"&&r.value,"bg-white":!r.value}])},[r.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["bg-white rounded-full",Jc[a.size]])},null,2)):createCommentVNode("",!0)],2),a.$slots.label?(openBlock(),createElementBlock("div",Mw,[renderSlot(a.$slots,"label")])):(openBlock(),createElementBlock("div",Nw,[renderSlot(a.$slots,"default")]))],2))}}),Lw=["checked","value"],Ow={key:0,class:"ml-2 text-sm text-nowrap"},Bw={key:1,class:"ml-2 text-sm text-nowrap"};var Xc=(n=>(n.default="w-5 h-5",n.small="w-4 h-4",n.large="w-6 h-6",n))(Xc||{}),Zc=(n=>(n.default="w-3 h-3",n.small="w-2 h-2",n.large="w-4 h-4",n))(Zc||{});const Qc=defineComponent({__name:"ShadcnCheckbox",props:{modelValue:{default:null},value:{},disabled:{type:Boolean,default:!1},size:{default:"default"},type:{default:"primary"}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i=n,s=inject("checkboxGroup",null),r=computed(()=>s?s.modelValue.modelValue.includes(i.value):i.modelValue===i.value),o=()=>{if(!i.disabled)if(s)s.updateModelValue(i.value,!r.value);else{const a=r.value?null:i.value;t("update:modelValue",a),t("on-change",a)}};return(a,l)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["inline-flex items-center",{"cursor-pointer":!a.disabled,"cursor-not-allowed opacity-50":a.disabled}]),onClick:o},[createBaseVNode("input",{type:"checkbox",checked:r.value,class:"sr-only",value:a.value},null,8,Lw),createBaseVNode("div",{class:normalizeClass$1(["flex items-center justify-center rounded border transition-colors duration-300",Xc[a.size],{"bg-blue-400":a.type==="primary"&&r.value,"bg-green-400":a.type==="success"&&r.value,"bg-yellow-400":a.type==="warning"&&r.value,"bg-red-400":a.type==="error"&&r.value,"bg-white":!r.value}])},[r.value?(openBlock(),createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",class:normalizeClass$1(["text-white",Zc[a.size]])},l[0]||(l[0]=[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]),2)):createCommentVNode("",!0)],2),a.$slots.label?(openBlock(),createElementBlock("div",Ow,[renderSlot(a.$slots,"label")])):(openBlock(),createElementBlock("div",Bw,[renderSlot(a.$slots,"default")]))],2))}}),Dw=defineComponent({__name:"ShadcnCheckboxGroup",props:{modelValue:{}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=reactive({modelValue:t.modelValue||[]});return watch(()=>t.modelValue,r=>{s.modelValue=r||[]}),provide("checkboxGroup",{modelValue:s,updateModelValue:(r,o)=>{let a=[...s.modelValue];o?a.includes(r)||a.push(r):a=a.filter(l=>l!==r),s.modelValue=a,i("update:modelValue",a),i("on-change",a)}}),(r,o)=>(openBlock(),createBlock$1(unref(xa),{wrap:"",size:[10,10]},{default:withCtx(()=>[renderSlot(r.$slots,"default")]),_:3}))}}),Pw=defineComponent({__name:"ShadcnRadioGroup",props:{modelValue:{}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=reactive({modelValue:t.modelValue});return watch(()=>t.modelValue,r=>{s.modelValue=r}),watch(()=>s.modelValue,r=>{i("update:modelValue",r)}),provide("radioGroup",{modelValue:s,updateModelValue:r=>{s.modelValue=r,i("on-change",r)}}),(r,o)=>(openBlock(),createBlock$1(unref(xa),{wrap:"",size:[10,10]},{default:withCtx(()=>[renderSlot(r.$slots,"default")]),_:3}))}}),Fw=["data-parent"],Uw={class:normalizeClass$1(["flex items-center gap-2 select-none"])},zw={key:0,class:"w-4 h-4 border rounded flex items-center justify-center"},Ww={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",class:"w-3 h-3"},ef=defineComponent({__name:"ShadcnSelectOption",props:{value:{},label:{},selected:{type:Boolean},disabled:{type:Boolean},type:{default:"primary"},parentName:{}},setup(n){const e=n,t=inject("selectContext"),i=inject("inGroup",!1),s=t.parentName,r=computed(()=>t.multiple?Array.isArray(t.modelValue.value)&&t.modelValue.value.includes(e.value):t.modelValue.value===e.value),o=()=>{e.disabled||t.selectOption({value:e.value,label:e.label,disabled:e.disabled,selected:r.value,type:e.type,parentName:s})};return watch([()=>e.value,()=>e.label,()=>e.disabled,()=>e.type],()=>{e.value!==void 0&&e.label&&t.registerOption({value:e.value,label:e.label,disabled:e.disabled,selected:r.value,type:e.type,parentName:s})},{immediate:!0}),onMounted(()=>{e.value!==void 0&&e.label&&t.registerOption({value:e.value,label:e.label,disabled:e.disabled,selected:r.value,type:e.type,parentName:s})}),onUnmounted(()=>{e.value!==void 0&&t.unregisterOption(e.value)}),(a,l)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["flex items-center text-sm p-2 hover:bg-gray-100 h-8 rounded-sm",{"cursor-not-allowed opacity-50":a.disabled,"cursor-pointer":!a.disabled,[unref(mo)[a.type]]:r.value,"bg-gray-50":r.value},unref(i)&&"ml-4"]),"data-parent":unref(s),onClick:o},[createBaseVNode("div",Uw,[unref(t).multiple?(openBlock(),createElementBlock("div",zw,[r.value?(openBlock(),createElementBlock("svg",Ww,l[0]||(l[0]=[createBaseVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):createCommentVNode("",!0)])):createCommentVNode("",!0),createTextVNode(" "+toDisplayString$1(a.label),1)])],10,Fw))}}),Hw={class:"flex-1 flex items-center overflow-hidden"},Gw=["onClick"],qw={key:1,class:"flex items-center min-w-0 truncate select-none"},jw={class:normalizeClass$1(["flex items-center ml-1 flex-shrink-0"])},Yw={key:0,class:"flex justify-center items-center py-2"},oi=defineComponent({__name:"ShadcnSelect",props:{modelValue:{},options:{},placeholder:{default:String(P("select.text.placeholder"))},disabled:{type:Boolean,default:!1},size:{default:"default"},type:{default:"primary"},multiple:{type:Boolean,default:!1},border:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},loadData:{}},emits:["update:modelValue","update:options","on-change","on-click-outside"],setup(n,{emit:e}){const t=e,i=n,s=ref(!1),r=ref([]),o=ref([]),a=ref(null),l=ref(null),c=`shadcn-select-${Pr()}`,d=ref(!1),u=()=>{if(!i.lazy||!i.loadData||d.value)return;const I=l.value;if(!I)return;const{scrollTop:N,scrollHeight:R,clientHeight:T}=I;R-N-T<20&&(d.value||(d.value=!0,i.loadData(A=>{Array.isArray(A)&&A.length>0&&(i.options!==void 0?t("update:options",[...i.options,...A]):o.value=[...o.value,...A]),d.value=!1})))},f=I=>{if(!I||I.parentName!==c)return;const N=o.value.findIndex(R=>R.value===I.value);N===-1?o.value.push(I):o.value[N]=I},g=I=>{const N=o.value.findIndex(R=>R.value===I);N!==-1&&o.value.splice(N,1)},m=I=>i.multiple?Array.isArray(i.modelValue)&&i.modelValue.includes(I):i.modelValue===I,_=()=>{if(i.multiple&&Array.isArray(i.modelValue))r.value=i.modelValue.map(I=>{const N=o.value.find(R=>R.value===I);return N?N.label:I});else{const I=o.value.find(N=>N.value===i.modelValue);r.value=I?[I.label]:[]}},v=I=>{if(i.multiple&&Array.isArray(i.modelValue)){const N=[...i.modelValue];N.splice(I,1),t("update:modelValue",N),t("on-change",N)}},C=computed(()=>i.options||o.value),S=()=>{i.disabled||(s.value=!s.value,s.value&&nextTick$1(_))},w=I=>{if(!(i.disabled||I.disabled))if(i.multiple){const N=Array.isArray(i.modelValue)?[...i.modelValue]:[],R=N.indexOf(I.value);R===-1?N.push(I.value):N.splice(R,1),t("update:modelValue",N),t("on-change",N)}else t("update:modelValue",I.value),t("on-change",I),s.value=!1},L=I=>{a.value&&!a.value.contains(I.target)&&s.value&&(S(),t("on-click-outside",!0))};return watch(()=>i.modelValue,()=>{_()},{immediate:!0,deep:!0}),watch(()=>o.value,()=>{_()},{deep:!0}),provide("selectContext",{registerOption:f,unregisterOption:g,selectOption:w,modelValue:computed(()=>i.modelValue),multiple:i.multiple,parentName:c}),onMounted(()=>{document.addEventListener("click",L),s.value=!0,nextTick$1(()=>{s.value=!1})}),onUnmounted(()=>{document.removeEventListener("click",L)}),(I,N)=>(openBlock(),createElementBlock("div",{ref_key:"selectRef",ref:a,class:"relative"},[createBaseVNode("div",{class:normalizeClass$1(["flex rounded px-2",I.border&&"border",{"cursor-pointer":!I.disabled,"cursor-not-allowed opacity-50 bg-gray-100":I.disabled,[unref(ho)[I.type]]:!0}]),onClick:S},[createBaseVNode("div",Hw,[createBaseVNode("div",{class:normalizeClass$1(["flex flex-wrap gap-1 w-full py-0.5",unref(Vc)[I.size]])},[renderSlot(I.$slots,"selected",{},()=>[I.multiple&&r.value.length?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(r.value,(R,T)=>(openBlock(),createElementBlock("span",{class:"bg-gray-100 px-2 rounded-md text-sm flex items-center gap-1",key:T,style:normalizeStyle$1({paddingTop:unref(Ns)[I.size],paddingBottom:unref(Ns)[I.size]})},[createTextVNode(toDisplayString$1(R)+" ",1),createBaseVNode("button",{class:"hover:text-red-500",onClick:withModifiers(A=>v(T),["stop"])}," × ",8,Gw)],4))),128)):(openBlock(),createElementBlock("span",qw,toDisplayString$1(r.value[0]||I.placeholder),1))])],2)]),createBaseVNode("div",jw,[(openBlock(),createElementBlock("svg",{class:normalizeClass$1(["w-4 h-4 transition-transform duration-200",{"rotate-180":s.value}]),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},N[0]||(N[0]=[createBaseVNode("path",{"clip-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","fill-rule":"evenodd"},null,-1)]),2))])],2),withDirectives(createBaseVNode("div",{ref_key:"dropdownRef",ref:l,class:"absolute z-10 bg-white border border-gray-300 rounded-sm mt-1 w-full py-2 px-2 space-y-1 overflow-y-auto max-h-60",onScroll:u},[renderSlot(I.$slots,"options",{},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(C.value,(R,T)=>(openBlock(),createBlock$1(ef,{key:T,value:R.value,label:R.label,selected:m(R.value),disabled:R.disabled,type:I.type},null,8,["value","label","selected","disabled","type"]))),128))]),d.value?(openBlock(),createElementBlock("div",Yw,N[1]||(N[1]=[createBaseVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent"},null,-1)]))):createCommentVNode("",!0)],544),[[vShow,s.value]])],512))}}),Kw={class:"select-group space-y-1"},Jw={class:"px-1.5 py-1.5 text-sm font-normal text-gray-300"},Xw=defineComponent({__name:"ShadcnSelectGroup",props:{label:{}},setup(n){return provide("inGroup",!0),(e,t)=>(openBlock(),createElementBlock("div",Kw,[createBaseVNode("div",Jw,toDisplayString$1(e.label),1),renderSlot(e.$slots,"default")]))}}),Zw={class:"flex items-center"},Qw=["onClick","onMousemove"],ex={class:"relative block"},tx=defineComponent({__name:"ShadcnRate",props:{modelValue:{},max:{default:5},allowHalf:{type:Boolean,default:!1},type:{default:"primary"},disabled:{type:Boolean,default:!1},showText:{type:Boolean,default:!1}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=ref(0),r=ref(!1),o=f=>{const{offsetX:g,target:m}=f,_=m.clientWidth;return g<_/2},a=(f,g)=>{if(!t.disabled){let m=f;t.allowHalf&&o(g)&&(m-=.5),i("update:modelValue",m),i("on-change",m)}},l=(f,g)=>{t.disabled||(t.allowHalf&&o(g)?(s.value=f-.5,r.value=!0):(s.value=f,r.value=!1))},c=()=>{t.disabled||(s.value=t.modelValue||0,r.value=t.modelValue%1!==0)};watch(()=>t.modelValue,f=>{s.value=f||0,r.value=f%1!==0},{immediate:!0});const d=f=>f===Math.ceil(s.value)&&r.value,u=(f,g)=>{const m=f<=s.value,_=d(f)&&g;return["transition-all duration-150",m||_?mo[t.type]:"text-gray-300"]};return(f,g)=>(openBlock(),createElementBlock("div",Zw,[createVNode(unref(xa),null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(gn.toNumber)(f.max),m=>(openBlock(),createElementBlock("span",{key:m,class:normalizeClass$1(["relative flex text-xl",{"cursor-not-allowed":f.disabled,"cursor-pointer":!f.disabled}]),onClick:_=>a(m,_),onMousemove:_=>l(m,_),onMouseleave:c},[createBaseVNode("span",ex,[createBaseVNode("span",{class:normalizeClass$1([u(m,!0),"absolute left-0 top-0 h-full overflow-hidden"]),style:normalizeStyle$1({width:d(m)?"50%":"100%"})},[renderSlot(f.$slots,"character",{},()=>[g[0]||(g[0]=createTextVNode("★"))])],6),createBaseVNode("span",{class:normalizeClass$1(f.disabled?"text-gray-400":"text-gray-300")},[renderSlot(f.$slots,"character",{},()=>[g[1]||(g[1]=createTextVNode("★"))])],2)])],42,Qw))),128)),f.showText?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass$1(["ml-2 text-sm flex items-center",unref(mo)[t.type]])},[createVNode(unref(xa),{size:[0,4],class:"flex items-center"},{default:withCtx(()=>[createBaseVNode("span",null,toDisplayString$1(f.modelValue),1),renderSlot(f.$slots,"text")]),_:3})],2)):createCommentVNode("",!0)]),_:3})]))}}),nx=["onClick"],ox={class:"whitespace-nowrap"},ax=defineComponent({__name:"ShadcnTab",props:{modelValue:{},type:{default:"primary"},size:{default:"default"},card:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},position:{default:"left"},direction:{default:"horizontal"}},emits:["update:modelValue","on-change","on-tab-remove"],setup(n,{emit:e}){const t=e,i=n,s=ref(""),r=ref([]),o=(u,f)=>{var g;f.disabled||((g=f.onClick)==null||g.call(f,u),a(f.value))},a=u=>{s.value!==u&&(s.value=u,t("update:modelValue",u),t("on-change",u))},l=(u,f,g=!1,m,_,v)=>{if(!f){console.warn("Tab value must be a non-empty string");return}if(r.value.find(C=>C.value===f)){console.warn(`Tab with value "${f}" already exists`);return}r.value.push({label:u,value:f,disabled:g,icon:m,labelSlot:_,onClick:v})},c=u=>{const f=r.value.findIndex(g=>g.value===u);if(f!==-1){if(s.value===u){const g=[...r.value].slice(0,f).reverse().find(v=>!v.disabled),m=r.value.slice(f+1).find(v=>!v.disabled),_=g||m;_?a(_.value):(s.value="",t("update:modelValue",""),t("on-change",""))}r.value.splice(f,1)}};provide("activeTab",s),provide("registerTab",l),provide("unregisterTab",c),watch(()=>i.modelValue,u=>{u&&a(u)},{immediate:!0}),watchEffect(()=>{i.direction==="vertical"&&!["left","right"].includes(i.position)&&console.warn('Invalid position for vertical tabs. Must be either "left" or "right"')});const d=u=>{try{if(!r.value.some(f=>f.value===u)){console.warn(`Cannot remove non-existent tab: ${u}`);return}t("on-tab-remove",u),c(u)}catch(f){console.error("Error removing tab:",f)}};return(u,f)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["w-full flex",{"flex-row":u.direction==="vertical"&&u.position!=="right","flex-row-reverse":u.direction==="vertical"&&u.position==="right","flex-col":u.direction!=="vertical"}])},[createBaseVNode("div",{class:normalizeClass$1([u.direction!=="vertical"?"border-b":"",u.direction==="vertical"?"border-b-0 border-r flex-col":"flex justify-between",u.card?"space-x-1":""]),style:normalizeStyle$1({width:u.direction==="vertical"?"auto":"100%"})},[createBaseVNode("div",{class:normalizeClass$1([u.direction==="vertical"?"flex flex-col":"flex",u.card&&u.direction!=="vertical"?"space-x-1":"",u.card&&u.direction==="vertical"?"space-y-1":""])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,g=>(openBlock(),createElementBlock("div",{key:g.value,class:normalizeClass$1(["py-2 transition-colors duration-200 flex group items-center",u.direction==="horizontal"?"px-4":"",u.direction==="horizontal"?[unref(Ec)[u.size]]:"",u.card&&u.direction==="vertical"?"py-2 px-2 h-auto":"",{"border-b-2 cursor-pointer":s.value===g.value&&!g.disabled&&u.direction!=="vertical","border-r-2 cursor-pointer":s.value===g.value&&!g.disabled&&u.direction==="vertical",[unref(mo)[u.type]]:s.value===g.value&&!g.disabled,[unref(Qs)[u.type]]:s.value===g.value&&!g.disabled,"text-gray-600 hover:border-b-2 hover:cursor-pointer":s.value!==g.value&&!g.disabled&&u.direction!=="vertical","text-gray-600 hover:border-r-2 hover:cursor-pointer":s.value!==g.value&&!g.disabled&&u.direction==="vertical",[unref(xc)[u.type]]:s.value!==g.value&&!g.disabled,[unref(ho)[u.type]]:s.value!==g.value&&!g.disabled,"text-gray-400 cursor-not-allowed opacity-50":g.disabled},{"border-t border-l border-r rounded-t items-center":u.card&&u.direction!=="vertical","border-l border-t border-b rounded-l items-center":u.card&&u.direction==="vertical"}]),onClick:m=>o(m,g)},[createBaseVNode("div",{class:normalizeClass$1(["flex items-center",u.direction==="vertical"?"space-y-1":"space-x-1"]),style:normalizeStyle$1(u.direction==="horizontal"?{}:{writingMode:"vertical-rl",textOrientation:"mixed",height:"auto",alignItems:"center"})},[g.icon?(openBlock(),createBlock$1(unref(at),{key:0,icon:g.icon},null,8,["icon"])):createCommentVNode("",!0),createBaseVNode("div",ox,[g.labelSlot?(openBlock(),createBlock$1(resolveDynamicComponent(g.labelSlot),{key:0})):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString$1(g.label),1)],64))]),u.closable&&!g.disabled?(openBlock(),createBlock$1(unref(at),{key:1,icon:"CircleX",class:normalizeClass$1({"inline-block":s.value===g.value||u.closable&&!g.disabled,"hidden group-hover:inline-block":s.value!==g.value&&!g.disabled}),style:normalizeStyle$1(u.direction==="vertical"?{}:{marginLeft:"10px"}),onClick:withModifiers(m=>d(g.value),["stop"])},null,8,["class","style","onClick"])):createCommentVNode("",!0)],6)],10,nx))),128))],2),u.$slots.extra?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["flex items-center ml-auto",u.direction==="vertical"?"mt-2":""])},[renderSlot(u.$slots,"extra")],2)):createCommentVNode("",!0)],6),createBaseVNode("div",{class:normalizeClass$1([u.direction==="vertical"&&u.position==="right"?"mr-4 flex-1":"",u.direction==="vertical"&&u.position!=="right"?"ml-4 flex-1":"",u.direction!=="vertical"?"py-2":""])},[renderSlot(u.$slots,"default")],2)],2))}}),rx={key:0},lx=defineComponent({__name:"ShadcnTabItem",props:{label:{},value:{},disabled:{type:Boolean,default:!1},icon:{}},emits:["on-click"],setup(n,{emit:e}){const t=n,i=e,s=useSlots(),r=inject("activeTab"),o=inject("registerTab"),a=inject("unregisterTab"),l=d=>{t.disabled||i("on-click",d)};onMounted(()=>{o(t.label,t.value,t.disabled,t.icon,s.label,l),r.value===""&&!t.disabled&&(r.value=t.value)}),onBeforeUnmount(()=>{try{a==null||a(t.value),r.value=""}catch(d){console.error("Error cleaning up tab:",d)}});const c=computed(()=>r.value===t.value);return(d,u)=>c.value?(openBlock(),createElementBlock("div",rx,[renderSlot(d.$slots,"default")])):createCommentVNode("",!0)}}),sx={class:"relative"},ix={key:0,xmlns:"http://www.w3.org/2000/svg",width:"50%",height:"50%",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-gray-400"},tf=defineComponent({__name:"ShadcnSkeletonItem",props:{animation:{type:Boolean,default:!1},width:{},type:{default:"rect"},size:{default:"default"}},setup(n){const e=n,t=computed(()=>{switch(e.type){case"circle":return"rounded-full aspect-square";case"square":return"rounded aspect-square";case"rect":return"rounded w-full h-4";case"image":return`rounded-md ${Bo[e.size]}`}}),i=computed(()=>e.type==="rect"?"w-full":Bo[e.size]||Bo.default);return(s,r)=>(openBlock(),createElementBlock("div",sx,[createBaseVNode("div",{class:normalizeClass$1([s.animation?"animate-pulse":"",i.value])},[createBaseVNode("div",{class:normalizeClass$1(["bg-gray-200 flex justify-center items-center",t.value]),style:normalizeStyle$1({width:s.width})},[e.type==="image"?(openBlock(),createElementBlock("svg",ix,r[0]||(r[0]=[createBaseVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"},null,-1),createBaseVNode("circle",{cx:"9",cy:"9",r:"2"},null,-1),createBaseVNode("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},null,-1)]))):createCommentVNode("",!0)],6)],2)]))}}),ux={class:"space-y-4"},dx=defineComponent({__name:"ShadcnSkeleton",props:{cols:{default:1},rows:{default:4},animation:{type:Boolean,default:!1},paragraph:{}},setup(n){const e=n,t=s=>typeof s=="number"||/^\d+$/.test(s.toString())?`${s}px`:s.toString(),i=computed(()=>{if(e.paragraph){const{rows:s,width:r}=e.paragraph;return Array.from({length:s}).map((o,a)=>t(r[a]||r[r.length-1]))}else return Array.from({length:Number(e.rows)}).map(()=>e.cols===1?"100%":`${100/Number(e.cols)}%`)});return(s,r)=>(openBlock(),createElementBlock("div",ux,[renderSlot(s.$slots,"template",{},()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(i.value,(o,a)=>(openBlock(),createBlock$1(unref(tf),{key:a,width:o,animation:s.animation},null,8,["width","animation"]))),128))])]))}}),cx={class:"flex flex-col"},fx=defineComponent({__name:"ShadcnLayout",setup(n){const e=ref(!0),t=ref(!1),i=ref("left");provide("isInLayout",e),provide("hasSider",t),provide("siderPosition",i);const s=()=>{const r=document.querySelector(".shadcn-layout-sider");if(t.value=!!r,r){const o=document.querySelector(".shadcn-layout-content");o!=null&&o.contains(r)?i.value="content":i.value="left"}};return onMounted(()=>{s()}),(r,o)=>(openBlock(),createElementBlock("div",cx,[renderSlot(r.$slots,"default")]))}}),px={key:0,class:"shadcn-layout-header w-full"},hx=defineComponent({__name:"ShadcnLayoutHeader",setup(n){const e=inject("isInLayout",!1);return e||console.error("ShadcnLayoutHeader must be used inside a ShadcnLayout component."),(t,i)=>unref(e)?(openBlock(),createElementBlock("div",px,[renderSlot(t.$slots,"default")])):createCommentVNode("",!0)}}),mx={key:0,class:"shadcn-layout-content w-full"},vx=defineComponent({__name:"ShadcnLayoutContent",setup(n){const e=inject("isInLayout",!1);return e||console.warn("ShadcnLayoutContent must be placed inside ShadcnLayout."),(t,i)=>unref(e)?(openBlock(),createElementBlock("div",mx,[renderSlot(t.$slots,"default")])):createCommentVNode("",!0)}}),gx={class:"flex-1 overflow-hidden"},yx={class:"transition-opacity duration-300"},bx={class:"transition-opacity duration-300"},wx={class:"flex flex-col items-center py-2 space-y-4"},xx={class:"flex items-center text-gray-500"},_x=defineComponent({__name:"ShadcnLayoutSider",props:{width:{default:"200"},collapsedWidth:{default:"80"},collapsible:{type:Boolean,default:!0},defaultCollapsed:{type:Boolean,default:!1},trigger:{type:Boolean,default:!1}},emits:["on-collapse"],setup(n,{expose:e,emit:t}){const i=t,s=n,r=inject("isInLayout",!1),o=ref(s.defaultCollapsed),a=()=>{o.value=!o.value,i("on-collapse",o.value)};return e({collapse:()=>{o.value=!0,i("on-collapse",o.value)},expand:()=>{o.value=!1,i("on-collapse",o.value)},toggle:a,isCollapsed:o}),(l,c)=>unref(r)?(openBlock(),createElementBlock("div",{key:0,class:"shadcn-layout-sider relative flex flex-col transition-all duration-300 ease-in-out",style:normalizeStyle$1({width:o.value?`${l.collapsedWidth}px`:`${l.width}px`})},[createBaseVNode("div",gx,[createBaseVNode("div",{class:normalizeClass$1(["h-full",{"px-4 py-2":!o.value}])},[withDirectives(createBaseVNode("div",yx,[renderSlot(l.$slots,"default")],512),[[vShow,!o.value]]),withDirectives(createBaseVNode("div",bx,[renderSlot(l.$slots,"collapsed",{},()=>[createBaseVNode("div",wx,[renderSlot(l.$slots,"icon")])])],512),[[vShow,o.value]])],2)]),l.collapsible&&l.trigger?(openBlock(),createElementBlock("div",{key:0,class:"absolute top-1/2 -right-3 w-6 h-6 flex items-center justify-center bg-white border rounded-full cursor-pointer transform -translate-y-1/2 shadow-md hover:bg-gray-50",onClick:a},[createBaseVNode("div",xx,[o.value?(openBlock(),createBlock$1(unref(at),{key:0,icon:"ChevronRight",class:"h-4 w-4"})):(openBlock(),createBlock$1(unref(at),{key:1,icon:"ChevronLeft",class:"h-4 w-4"}))])])):createCommentVNode("",!0),l.collapsible&&!l.trigger?renderSlot(l.$slots,"trigger",{key:1,collapsed:o.value,toggle:a}):createCommentVNode("",!0)],4)):createCommentVNode("",!0)}}),Cx={key:0,class:"shadcn-layout-footer order-3 w-full"},kx=defineComponent({__name:"ShadcnLayoutFooter",setup(n){const e=inject("isInLayout",!1);return e||console.warn("ShadcnLayoutFooter must be placed inside ShadcnLayout."),(t,i)=>unref(e)?(openBlock(),createElementBlock("div",Cx,[renderSlot(t.$slots,"default")])):createCommentVNode("",!0)}}),$x={key:0,class:"shadcn-layout-wrapper order-2 flex flex-1"},Sx=defineComponent({__name:"ShadcnLayoutWrapper",setup(n){const e=inject("isInLayout",!1);return e||console.warn("ShadcnLayoutContainer must be placed inside ShadcnLayout."),(t,i)=>unref(e)?(openBlock(),createElementBlock("div",$x,[renderSlot(t.$slots,"default")])):createCommentVNode("",!0)}}),Vx={key:0,class:"shadcn-layout-main flex flex-col flex-1"},Ex=defineComponent({__name:"ShadcnLayoutMain",setup(n){const e=inject("isInLayout",!1);return e||console.warn("ShadcnLayoutMain must be placed inside ShadcnLayout."),(t,i)=>unref(e)?(openBlock(),createElementBlock("div",Vx,[renderSlot(t.$slots,"default")])):createCommentVNode("",!0)}}),Tx={class:"flex items-center justify-center space-x-2"},Rx={key:0,class:"text-sm text-gray-600"},Ax=["disabled"],Mx={key:0,class:"px-2 py-1"},Nx=["onClick","disabled"],Ix=["disabled"],Lx=defineComponent({__name:"ShadcnPagination",props:{modelValue:{},total:{default:100},pageSize:{default:10},maxShowPage:{default:5},prevText:{default:String(P("pagination.text.previous"))},nextText:{default:String(P("pagination.text.next"))},showTotal:{type:Boolean,default:!1},showSizer:{type:Boolean,default:!1},sizerOptions:{default:()=>[10,20,50,100]}},emits:["update:modelValue","on-change","on-prev","on-next","on-change-size"],setup(n,{emit:e}){const t=e,i=n,s=ref(Number(i.modelValue)),r=ref(Number(i.pageSize)),o=computed(()=>Math.ceil(Number(i.total)/r.value)),a=computed(()=>{const f=Number(i.maxShowPage),g=o.value,m=s.value;if(g<=f)return Array.from({length:g},(S,w)=>w+1);const _=Math.floor((f-3)/2);let v=[],C=[];if(m<=_+2)v=Array.from({length:f-2},(S,w)=>w+1),C=["...",g];else if(m>=g-_-1)v=[1,"..."],C=Array.from({length:f-2},(S,w)=>g-(f-3)+w);else{v=[1,"..."];const S=m-Math.floor((f-4)/2),w=Array.from({length:f-4},(L,I)=>S+I);return C=["...",g],[...v,...w,...C]}return[...v,...C]}),l=computed(()=>{const f=Array();return i.sizerOptions.forEach(g=>{f.push({label:String(P("pagination.text.item",{item:g})),value:g})}),f});watch(()=>i.modelValue,f=>{s.value=Number(f)}),watch(()=>i.pageSize,f=>{r.value=Number(f),s.value=1,t("update:modelValue",s.value),t("on-change",s.value)}),watch(r,f=>{t("on-change-size",f),s.value=1,t("update:modelValue",s.value),t("on-change",s.value)});const c=f=>{f>=1&&f<=o.value&&(t("update:modelValue",f),t("on-change",f))},d=()=>{if(s.value>1){const f=s.value-1;t("update:modelValue",f),t("on-prev",f)}},u=()=>{if(s.value(openBlock(),createElementBlock("div",Tx,[f.showTotal||f.$slots.showTotal?(openBlock(),createElementBlock("div",Rx,[renderSlot(f.$slots,"showTotal",{},()=>[createTextVNode(toDisplayString$1(unref(P)("pagination.text.total",{total:f.total})),1)])])):createCommentVNode("",!0),createBaseVNode("button",{onClick:d,class:normalizeClass$1(["px-2 py-1 text-xs h-8 bg-gray-100 rounded",s.value===1?"opacity-50 cursor-not-allowed":""]),disabled:s.value===1},toDisplayString$1(f.prevText),11,Ax),(openBlock(!0),createElementBlock(Fragment,null,renderList(a.value,m=>(openBlock(),createElementBlock(Fragment,{key:m},[m==="..."?(openBlock(),createElementBlock("span",Mx,"...")):(openBlock(),createElementBlock("button",{key:1,onClick:_=>c(Number(m)),class:normalizeClass$1(["px-2 py-1 text-xs rounded w-8 h-8 flex items-center justify-center",m===s.value?"bg-blue-400 text-white cursor-not-allowed":"bg-gray-100"]),disabled:m===s.value},toDisplayString$1(m),11,Nx))],64))),128)),createBaseVNode("button",{onClick:u,class:normalizeClass$1(["px-2 py-1 text-xs h-8 bg-gray-100 rounded",s.value===o.value?"opacity-50 cursor-not-allowed":""]),disabled:s.value===o.value},toDisplayString$1(f.nextText),11,Ix),f.showSizer?renderSlot(f.$slots,"sizer",{key:1},()=>[createVNode(unref(oi),{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=m=>r.value=m),class:"w-auto",options:l.value},null,8,["modelValue","options"])]):createCommentVNode("",!0)]))}}),Ox={class:"p-2 border-b flex justify-between"},Bx={class:"text-lg font-bold"},Dx={class:"flex-grow p-4 overflow-y-auto"},Px={key:0,class:"p-2 border-t"},Fx=defineComponent({__name:"ShadcnDrawer",props:{modelValue:{type:Boolean},title:{},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!1},position:{default:"right"},width:{default:300},height:{default:300}},emits:["update:modelValue","on-close"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.modelValue);watch(()=>i.modelValue,c=>{s.value=c}),watch(s,c=>{t("update:modelValue",c),t("on-close",c)});const r=()=>{s.value=!1},o=()=>{i.maskClosable&&r()},a=()=>ke(i.width),l=()=>ke(i.height);return(c,d)=>(openBlock(),createBlock$1(Transition,{"enter-active-class":"transition-opacity duration-300 ease-in-out","enter-from-class":"opacity-0","leave-active-class":"transition-opacity duration-300 ease-in-out","leave-to-class":"opacity-0"},{default:withCtx(()=>[s.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["fixed inset-0 z-50 flex",{"justify-start":c.position==="left","justify-end":c.position==="right","items-start":c.position==="top","items-end":c.position==="bottom"}])},[createBaseVNode("div",{class:"fixed inset-0 bg-black bg-opacity-50",onClick:o}),createBaseVNode("div",{class:normalizeClass$1(["bg-white shadow-lg flex flex-col transform transition-transform duration-300",{"h-full":c.position==="left"||c.position==="right","w-full":c.position==="top"||c.position==="bottom","translate-x-0":s.value&&(c.position==="left"||c.position==="right"),"translate-x-full":!s.value&&c.position==="right","-translate-x-full":!s.value&&c.position==="left","translate-y-0":s.value&&(c.position==="top"||c.position==="bottom"),"-translate-y-full":!s.value&&c.position==="top","translate-y-full":!s.value&&c.position==="bottom"}]),style:normalizeStyle$1({width:c.position==="left"||c.position==="right"?a():void 0,height:c.position==="top"||c.position==="bottom"?l():void 0})},[createBaseVNode("div",Ox,[renderSlot(c.$slots,"header",{},()=>[createBaseVNode("div",Bx,toDisplayString$1(c.title),1)]),c.closable?(openBlock(),createElementBlock("div",{key:0,class:"flex items-center cursor-pointer",onClick:r},[renderSlot(c.$slots,"close",{},()=>[d[0]||(d[0]=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5 text-gray-400 hover:text-muted-foreground"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1))])])):createCommentVNode("",!0)]),createBaseVNode("div",Dx,[renderSlot(c.$slots,"default")]),c.$slots.footer?(openBlock(),createElementBlock("footer",Px,[renderSlot(c.$slots,"footer")])):createCommentVNode("",!0)],6)],2)):createCommentVNode("",!0)]),_:3}))}}),Ux=defineComponent({__name:"ShadcnMenu",props:{modelValue:{},width:{default:200},direction:{default:"vertical"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=ref(String(t.modelValue)),r=ref(null),o=computed(()=>t.direction==="horizontal"?"flex-row items-center space-x-4":"flex-col space-y-2");return provide("menuContext",{activeKey:s,setActiveKey:a=>{s.value=a,i("update:modelValue",a)},direction:t.direction,expandedKey:r,setExpandedKey:a=>{r.value=a}}),(a,l)=>(openBlock(),createElementBlock("div",{class:"bg-white p-2",style:normalizeStyle$1({width:a.direction==="vertical"?unref(ke)(t.width):"100%"})},[createBaseVNode("div",{class:normalizeClass$1(["flex",o.value])},[renderSlot(a.$slots,"default")],2)],4))}}),zx={class:"flex items-center gap-2 min-w-0"},Wx={class:"truncate"},Hx=defineComponent({__name:"ShadcnMenuItem",props:{name:{},active:{type:Boolean,default:!1},to:{default:void 0}},emits:["on-active","on-click"],setup(n,{emit:e}){const t=n,i=e,s=inject("menuContext"),r=computed(()=>t.active||s.activeKey.value===t.name),o=computed(()=>s.direction==="horizontal"),a=s.parentName||null,l=c=>{s.setActiveKey(t.name),s.direction==="horizontal"&&s.setExpandedKey(null),i("on-active",!t.active),i("on-click",c)};return(c,d)=>(openBlock(),createBlock$1(resolveDynamicComponent(c.to?unref(wa):"div"),{link:c.to,class:normalizeClass$1(["px-3 py-2 text-sm rounded-md hover:bg-gray-100 focus:outline-none focus:bg-gray-100 cursor-pointer",{"bg-gray-100":r.value},o.value?"inline-flex":"flex"]),onClick:l,"data-name":c.name,"data-parent":unref(a)},{default:withCtx(()=>[createBaseVNode("div",zx,[renderSlot(c.$slots,"icon"),createBaseVNode("span",Wx,[renderSlot(c.$slots,"default")])]),renderSlot(c.$slots,"suffix")]),_:3},8,["link","class","data-name","data-parent"]))}}),Gx={class:"flex items-center gap-2"},qx=defineComponent({__name:"ShadcnMenuSub",props:{name:{}},setup(n){const e=n,t=inject("menuContext");provide("menuContext",{...t,parentName:e.name});const i=computed(()=>t.direction==="horizontal"),s=computed(()=>t.expandedKey.value===e.name),r=ref(!1),o=()=>{const l=document.querySelectorAll(`[data-parent="${e.name}"]`);r.value=Array.from(l).some(c=>c.dataset.name===t.activeKey.value)};watch(()=>t.activeKey.value,()=>{o()},{immediate:!0}),onMounted(()=>{o()});const a=()=>{t.expandedKey.value===e.name?(t.setExpandedKey(null),o()):t.setExpandedKey(e.name)};return(l,c)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1([i.value?"inline-block relative":"block"])},[createBaseVNode("div",{class:normalizeClass$1(["px-3 py-2 text-sm rounded-md hover:bg-gray-100 focus:outline-none focus:bg-gray-100 cursor-pointer","flex items-center justify-between gap-2",{"bg-gray-100":s.value||r.value}]),onClick:a},[createBaseVNode("div",Gx,[renderSlot(l.$slots,"icon"),createBaseVNode("span",null,[renderSlot(l.$slots,"title")])]),(openBlock(),createElementBlock("svg",{class:normalizeClass$1(["w-4 h-4 transition-transform duration-200",{"rotate-180":s.value}]),fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},c[0]||(c[0]=[createBaseVNode("path",{"clip-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","fill-rule":"evenodd"},null,-1)]),2))],2),createVNode(Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{class:normalizeClass$1(["space-y-1",i.value?"absolute left-0 mt-2.5 bg-white w-fit shadow-lg px-2 py-2 z-20":"pl-4 mt-1"])},[renderSlot(l.$slots,"default")],2),[[vShow,s.value]])]),_:3})],2))}}),jx={class:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase"},Yx=defineComponent({__name:"ShadcnMenuGroup",setup(n){const e=inject("menuContext"),t=computed(()=>e.direction==="horizontal");return(i,s)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",jx,[renderSlot(i.$slots,"title")]),createBaseVNode("div",{class:normalizeClass$1(["mt-1 px-2.5",t.value?"flex-row":"flex-col","space-y-1"])},[renderSlot(i.$slots,"default")],2)],64))}}),Kx={class:"bg-gray-50"},Jx={__name:"ShadcnTableHeader",setup(n){if(!inject("ShadcnTable",!1))throw new Error("ShadcnTableHeader must be used within ShadcnTable");return provide("ShadcnTableHeader",!0),(e,t)=>(openBlock(),createElementBlock("thead",Kx,[renderSlot(e.$slots,"default")]))}},Xx={__name:"ShadcnTableBody",setup(n){if(!inject("ShadcnTable",!1))throw new Error("ShadcnTableBody must be used within ShadcnTable");return(e,t)=>(openBlock(),createElementBlock("tbody",null,[renderSlot(e.$slots,"default")]))}},Xd=defineComponent({__name:"ShadcnTableRow",props:{label:{},key:{},slot:{},fixed:{},width:{},size:{},border:{type:Boolean},stripe:{type:Boolean,default:!1},isLastLeftFixed:{type:Boolean},isFirstRightFixed:{type:Boolean},leftOffset:{},rightOffset:{}},setup(n){if(!inject("ShadcnTable",!1))throw new Error("ShadcnTableRow must be used within ShadcnTable");return(e,t)=>(openBlock(),createElementBlock("tr",{class:normalizeClass$1(["group",e.stripe?"hover:bg-gray-100":"hover:bg-gray-50",e.stripe&&"bg-gray-50"])},[renderSlot(e.$slots,"default")],2))}});var ai=(n=>(n.small="px-2 py-2",n.default="px-4 py-4",n.large="px-6 py-6",n))(ai||{});const Zx=defineComponent({__name:"ShadcnTableColumn",props:{label:{},key:{},slot:{},fixed:{default:void 0},width:{default:"auto"},size:{default:"default"},border:{type:Boolean,default:!1},stripe:{type:Boolean},isLastLeftFixed:{type:Boolean,default:!1},isFirstRightFixed:{type:Boolean,default:!1},leftOffset:{},rightOffset:{}},setup(n){return(e,t)=>(openBlock(),createElementBlock("th",{class:normalizeClass$1(["text-left text-xs font-medium text-gray-500 tracking-wider whitespace-nowrap break-words relative",unref(ai)[e.size],e.fixed&&"sticky",e.fixed==="left"&&["bg-gray-50 z-10",e.isLastLeftFixed&&[e.border&&["after:absolute after:inset-y-0 after:border-r after:border-r-gray-200 after:right-0 after:w-[1px] after:shadow-left-side","before:absolute before:inset-y-0 before:border-r before:border-r-gray-200 before:left-0 before:w-[1px]"],"shadow-left-side"],!e.isLastLeftFixed&&"after:absolute after:inset-y-0 after:border-r-gray-200 after:right-0 after:w-[1px]"],e.fixed==="right"&&["bg-gray-50 z-10",e.isFirstRightFixed&&[e.border&&["before:absolute before:inset-y-0 before:border-l before:border-l-gray-200 before:left-0 before:w-[1px] before:shadow-right-side","after:absolute after:inset-y-0 after:border-r after:border-r-gray-200 after:right-0 after:w-[1px]"],"shadow-right-side"],!e.isFirstRightFixed&&"after:absolute after:inset-y-0 after:border-r-gray-200 after:right-0 after:w-[1px]"],e.border?"border-r border-r-gray-200":"border-b border-b-gray-200","group-hover:bg-gray-50"]),style:normalizeStyle$1({width:unref(ke)(e.width),minWidth:unref(ke)(e.width),maxWidth:unref(ke)(e.width),...e.fixed==="left"&&{left:unref(ke)(e.leftOffset)},...e.fixed==="right"&&{right:unref(ke)(e.rightOffset)}})},[renderSlot(e.$slots,"default",{},()=>[createTextVNode(toDisplayString$1(e.label),1)])],6))}}),Qx=defineComponent({__name:"ShadcnTableCell",props:{label:{},key:{},slot:{},fixed:{default:void 0},width:{default:"auto"},size:{default:"default"},border:{type:Boolean,default:!1},stripe:{type:Boolean,default:!1},isLastLeftFixed:{type:Boolean,default:!1},isFirstRightFixed:{type:Boolean,default:!1},leftOffset:{},rightOffset:{}},setup(n){if(!inject("ShadcnTable",!1))throw new Error("ShadcnTableCell must be used within ShadcnTable");return(e,t)=>(openBlock(),createElementBlock("td",{class:normalizeClass$1(["text-sm text-gray-500 whitespace-normal break-words relative",unref(ai)[e.size],e.fixed&&"sticky",e.fixed==="left"&&[e.stripe?"bg-gray-50":"bg-white",e.border&&"border-b",!e.border&&"border-b","z-10","transition-colors duration-200","group-hover:bg-gray-100",e.isLastLeftFixed&&[e.border&&["after:absolute after:inset-y-0 after:border-r after:border-r-gray-200 after:right-0 after:w-[1px] after:shadow-left-side","before:absolute before:inset-y-0 before:border-r before:border-r-gray-200 before:left-0 before:w-[1px]"],"shadow-left-side"],!e.isLastLeftFixed&&["after:absolute after:inset-y-0 after:border-r-gray-200 after:right-0 after:w-[1px]"]],e.fixed==="right"&&[e.stripe?"bg-gray-50":"bg-white",e.border&&"border-b",!e.border&&"border-b","z-10","transition-colors duration-200","group-hover:bg-gray-100",e.isFirstRightFixed&&[e.border&&["before:absolute before:inset-y-0 before:border-l before:border-l-gray-200 before:left-0 before:w-[1px] before:shadow-right-side","after:absolute after:inset-y-0 after:border-r after:border-r-gray-200 after:right-0 after:w-[1px]"],"shadow-right-side"],!e.isFirstRightFixed&&["after:absolute after:inset-y-0 after:right-0 after:w-[1px]"]],!e.fixed&&[!e.border&&"border-b",e.border&&"border-b border-l",e.stripe?"bg-gray-50":"bg-white","transition-colors duration-200","group-hover:bg-gray-100"]]),style:normalizeStyle$1({width:unref(ke)(e.width),minWidth:unref(ke)(e.width),maxWidth:unref(ke)(e.width),...e.fixed==="left"&&{left:unref(ke)(e.leftOffset)},...e.fixed==="right"&&{right:unref(ke)(e.rightOffset)}})},[renderSlot(e.$slots,"default")],6))}}),e2={class:"overflow-auto relative h-full"},t2={class:"min-w-full inline-block align-middle"},n2={class:"min-w-full divide-y divide-gray-200"},o2={key:1,class:"text-red-500"},a2=defineComponent({__name:"ShadcnTable",props:{columns:{},data:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},width:{default:"100%"},height:{default:"auto"},minHeight:{default:300},size:{default:"default"}},emits:["on-row-click"],setup(n,{emit:e}){provide("ShadcnTable",!0);const t=e,i=n,s=useSlots(),r=g=>!!s[g],o=g=>{if(g.slot&&!r(g.slot))throw new Error(`The slot "${g.slot}" is required for column "${g.label}" but not provided.`);return""},a=computed(()=>{const g=Array(),m=Array(),_=Array();for(const v of i.columns)v.fixed==="left"?g.push(v):v.fixed==="right"?_.push(v):m.push(v);return[...g,...m,..._]}),l=g=>{if(a.value[g].fixed!=="left")return!1;const m=a.value[g+1];return!m||m.fixed!=="left"},c=g=>{if(a.value[g].fixed!=="right")return!1;const m=a.value[g-1];return!m||m.fixed!=="right"},d=g=>{if(!a.value[g].fixed||a.value[g].fixed!=="left")return 0;let m=0;for(let _=0;_{if(!a.value[g].fixed||a.value[g].fixed!=="right")return 0;let m=0;for(let _=a.value.length-1;_>g;_--)m+=gn.toNumber(a.value[_].width);return m},f=(g,m)=>{t("on-row-click",g,m)};return(g,m)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["w-full border-gray-200 relative",g.border&&"border"]),style:normalizeStyle$1({width:unref(ke)(g.width),height:unref(ke)(g.height),minHeight:unref(ke)(g.minHeight)})},[createBaseVNode("div",e2,[createBaseVNode("div",t2,[createBaseVNode("table",n2,[renderSlot(g.$slots,"default",{},()=>[createVNode(Jx,null,{default:withCtx(()=>[createVNode(Xd,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.value,(_,v)=>(openBlock(),createBlock$1(Zx,{key:_.key,label:_.label,border:g.border,fixed:_.fixed,width:_.width,"left-offset":d(v),"right-offset":u(v),isLastLeftFixed:l(v),isFirstRightFixed:c(v),size:g.size},null,8,["label","border","fixed","width","left-offset","right-offset","isLastLeftFixed","isFirstRightFixed","size"]))),128))]),_:1})]),_:1}),createVNode(Xx,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(g.data,(_,v)=>(openBlock(),createBlock$1(Xd,{key:String(v),stripe:g.stripe&&v%2===1,onClick:C=>f(_,v)},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.value,(C,S)=>(openBlock(),createBlock$1(Qx,{key:C.key,border:g.border,fixed:C.fixed,stripe:g.stripe&&v%2===1,width:C.width,"left-offset":d(S),"right-offset":u(S),isLastLeftFixed:l(S),isFirstRightFixed:c(S),size:g.size},{default:withCtx(()=>[C.slot?(openBlock(),createElementBlock(Fragment,{key:0},[r(C.slot)?renderSlot(g.$slots,C.slot,{key:0,row:_,index:v}):(openBlock(),createElementBlock("span",o2,toDisplayString$1(o(C)),1))],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString$1(_[String(C.key)]),1)],64))]),_:2},1032,["border","fixed","stripe","width","left-offset","right-offset","isLastLeftFixed","isFirstRightFixed","size"]))),128))]),_:2},1032,["stripe","onClick"]))),128))]),_:3})])])])])],6))}}),r2={"aria-label":"breadcrumb",class:"flex"},l2=["data-breadcrumb-id"],s2=defineComponent({__name:"ShadcnBreadcrumb",props:{separator:{default:"/"}},setup(n){provide("breadcrumbSeparator",n.separator),provide("isBreadcrumb",!0);const e=ref(`breadcrumb-${Pr()}`);provide("breadcrumbId",e);const t=ref(0);provide("getCurrentIndex",()=>(t.value+=1,t.value-1));const i=ref(0);return onMounted(()=>{typeof document<"u"&&(i.value=document.querySelectorAll(`[data-breadcrumb-parent="${e.value}"]`).length)}),provide("totalItems",i),watch(i,()=>t.value=0),(s,r)=>(openBlock(),createElementBlock("nav",r2,[createBaseVNode("div",{class:"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground","data-breadcrumb-id":e.value},[renderSlot(s.$slots,"default")],8,l2)]))}}),i2=["data-breadcrumb-parent"],u2={key:0,class:"text-gray-200"},d2=defineComponent({__name:"ShadcnBreadcrumbItem",props:{href:{}},setup(n){const e=inject("breadcrumbSeparator"),t=inject("breadcrumbId");if(!t)throw new Error(`ShadcnBreadcrumbItem has invalid parent id ${t}`);if(!inject("isBreadcrumb",!1))throw new Error("ShadcnBreadcrumbItem must be used within ShadcnBreadcrumb");const i=inject("totalItems",ref(0)),s=inject("getCurrentIndex",()=>0)(),r=computed(()=>s===i.value-1);return(o,a)=>(openBlock(),createElementBlock("div",{class:"inline-flex items-center gap-1.5","data-breadcrumb-parent":unref(t)},[(openBlock(),createBlock$1(resolveDynamicComponent(o.href?"a":"span"),{href:o.href,class:normalizeClass$1(["transition-colors hover:text-foreground",o.href?"cursor-pointer":"cursor-default",r.value&&"font-medium text-foreground"])},{default:withCtx(()=>[renderSlot(o.$slots,"default")]),_:3},8,["href","class"])),r.value?createCommentVNode("",!0):(openBlock(),createElementBlock("span",u2,toDisplayString$1(unref(e)),1))],8,i2))}}),c2={class:"flex items-center w-full"},f2={class:"relative w-full h-2"},p2={key:0},h2=["min","max","step","disabled"],m2=defineComponent({__name:"ShadcnSlider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},showTip:{type:Boolean,default:!1},showStep:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.modelValue),r=computed(()=>Number(i.min)??0),o=computed(()=>Number(i.max)??100),a=computed(()=>(Number(s.value)-r.value)/(o.value-r.value)*100),l=computed(()=>{const d=Array(),u=o.value-r.value,f=Number(i.step),g=Math.floor(u/f);for(let m=1;mi.modelValue,d=>s.value=Number(d));const c=()=>{i.disabled||(t("update:modelValue",s.value),t("on-change",s.value))};return(d,u)=>(openBlock(),createElementBlock("div",c2,[createBaseVNode("div",f2,[createBaseVNode("div",{class:normalizeClass$1(["absolute w-full h-full rounded",d.disabled?"bg-gray-100":"bg-gray-200"])},null,2),createBaseVNode("div",{class:normalizeClass$1(["absolute h-full rounded z-[1]",d.disabled?"bg-gray-300":"bg-blue-500"]),style:normalizeStyle$1(`width: ${a.value}%`)},null,6),d.showStep?(openBlock(),createElementBlock("div",p2,[(openBlock(!0),createElementBlock(Fragment,null,renderList(l.value,(f,g)=>(openBlock(),createElementBlock("div",{key:g,class:normalizeClass$1(["absolute bg-white top-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full z-[2]",d.disabled?"bg-gray-300":"bg-gray-400"]),style:normalizeStyle$1(`left: ${f}%`)},null,6))),128))])):createCommentVNode("",!0),withDirectives(createBaseVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=f=>s.value=f),type:"range",class:normalizeClass$1(["absolute w-full h-full opacity-0 z-[3]",d.disabled?"cursor-not-allowed":"cursor-pointer"]),min:r.value,max:o.value,step:d.step,disabled:d.disabled,onInput:c},null,42,h2),[[vModelText,s.value]]),createBaseVNode("div",{class:normalizeClass$1(["absolute w-4 h-4 rounded-full top-1/2 -translate-y-1/2 transition-colors z-[2] pointer-events-none border-2",d.disabled?"bg-gray-50 border-gray-300":"bg-white border-blue-500 group-hover:bg-blue-50"]),style:normalizeStyle$1(`left: calc(${a.value}% - 0.5rem)`)},null,6)]),d.showTip?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass$1(["ml-3 text-sm",d.disabled?"text-gray-400":"text-gray-500"])},toDisplayString$1(s.value),3)):createCommentVNode("",!0)]))}}),v2=defineComponent({__name:"ShadcnForm",props:{modelValue:{}},emits:["update:modelValue","on-submit","on-error"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=reactive({model:{...i.modelValue},items:new Map,errors:new Map});watch(()=>i.modelValue,d=>Object.assign(r.model,d),{deep:!0});const o=async d=>{const u=r.items.get(d);if(!u)return!0;try{const{isValid:f,errorMessage:g}=await u.validate();return f?(r.errors.delete(d),!0):(r.errors.set(d,g||"Validation failed"),!1)}catch(f){return r.errors.set(d,f.message),!1}},a=async()=>(await Promise.all(Array.from(r.items.keys()).map(o))).every(Boolean),l=async()=>{await a()?s("on-submit",{...r.model}):s("on-error",Object.fromEntries(r.errors))},c=()=>{r.model={},r.errors.clear(),s("update:modelValue",{})};return provide("formContext",{model:r.model,errors:r.errors,updateModel:(d,u)=>{r.model[d]=u,s("update:modelValue",{...r.model})},registerFormItem:d=>{r.items.set(d.name,d),d.name in r.model||(r.model[d.name]=i.modelValue[d.name]??"")},unregisterFormItem:d=>r.items.delete(d),validateField:o}),e({validate:a,reset:c}),(d,u)=>(openBlock(),createElementBlock("form",{onSubmit:withModifiers(l,["prevent"]),class:"space-y-4"},[renderSlot(d.$slots,"default")],32))}}),g2={class:"space-y-2"},y2={class:"flex items-center"},b2=["for"],w2={key:1,class:"ml-auto"},x2={class:"text-sm text-muted-foreground"},_2={class:"relative"},C2={key:0,class:"text-sm text-red-500"},k2=defineComponent({__name:"ShadcnFormItem",props:{name:{},label:{},description:{},rules:{},validateOnBlur:{type:Boolean,default:!0}},setup(n){const e=n,t=ref(""),i=inject("formContext"),s=(a,l)=>{var c,d;if(!l||!a)return;if(Array.isArray(a.value))return a.value;const u=l.match(/^(\w+)\[(\d+)\]\.(\w+)$/);if(u){const[f,g,m,_]=u;return(d=(c=a[g])==null?void 0:c[Number(m)])==null?void 0:d[_]}return l.includes(".")?l.split(".").reduce((f,g)=>f==null?void 0:f[g],a):a[l]},r=async()=>{if(!e.rules)return{isValid:!0};const a=s(i.model,e.name);for(const l of e.rules){if(l.required&&gn.isEmpty(a))return{isValid:!1,errorMessage:l.message||"This field is required"};let c=String(a||"").length;if(a instanceof Array&&(c=a.length),l.min!==void 0&&cl.max)return{isValid:!1,errorMessage:l.message||`Maximum length is ${l.max}`};if(l.pattern&&!l.pattern.test(String(a||"")))return{isValid:!1,errorMessage:l.message||"Invalid format"};if(l.validator)try{if(!await l.validator(a))return{isValid:!1,errorMessage:l.message||"Validation failed"}}catch(d){return{isValid:!1,errorMessage:d.message}}}return{isValid:!0}},o=async()=>{if(e.validateOnBlur){const{isValid:a,errorMessage:l}=await r();a?t.value="":t.value=l||""}};return provide(`form-item-${e.name}`,{onBlur:o,name:e.name}),onMounted(()=>{i==null||i.registerFormItem({name:e.name,validate:r,rules:e.rules})}),onUnmounted(()=>{i==null||i.unregisterFormItem(e.name)}),watch(()=>{var a;return(a=i==null?void 0:i.errors)==null?void 0:a.get(e.name)},a=>t.value=a||""),(a,l)=>(openBlock(),createElementBlock("div",g2,[createBaseVNode("div",y2,[a.label?(openBlock(),createElementBlock("label",{key:0,class:"text-sm text-gray-500 font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",for:a.name},toDisplayString$1(a.label),9,b2)):createCommentVNode("",!0),a.description?(openBlock(),createElementBlock("div",w2,[createBaseVNode("p",x2,[createVNode(unref(Po),{content:a.description},{default:withCtx(()=>[createVNode(unref(at),{icon:"HelpCircle"})]),_:1},8,["content"])])])):createCommentVNode("",!0)]),createBaseVNode("div",_2,[renderSlot(a.$slots,"default"),t.value?(openBlock(),createElementBlock("span",C2,toDisplayString$1(t.value),1)):createCommentVNode("",!0)])]))}}),$2={class:"relative"},S2=defineComponent({__name:"ShadcnTimeline",props:{split:{type:Boolean,default:!1}},setup(n){const e=n,t=ref(new Set),i=o=>{t.value.add(o)},s=o=>{t.value.delete(o)},r=ref(0);return provide("getCurrentIndex",()=>(r.value+=1,r.value-1)),provide("timelineContext",{addItem:i,removeItem:s,items:t.value,split:e.split}),(o,a)=>(openBlock(),createElementBlock("div",$2,[renderSlot(o.$slots,"default")]))}}),V2={key:0,class:"w-1/2"},E2={key:0,class:"pr-4 text-right"},T2={key:1,class:"w-1/2"},R2={key:0,class:"pl-4 text-left"},A2=defineComponent({__name:"ShadcnTimelineItem",setup(n){const e=Symbol(`timeline-item-${Pr()}`),t=inject("timelineContext",{items:new Set,addItem:()=>{},removeItem:()=>{},split:!1});if(!t)throw new Error("ShadcnTimelineItem must be used within ShadcnTimeline");onMounted(()=>{t.addItem(e)}),onUnmounted(()=>{t.removeItem(e)});const i=inject("getCurrentIndex",()=>0)(),s=computed(()=>i===t.items.size-1),r=computed(()=>t.split?"justify-between":""),o=computed(()=>"my-2"),a=computed(()=>t.split?"h-full":"min-h-8 h-full"),l=computed(()=>"mb-4");return(c,d)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["relative flex",r.value])},[unref(t).split?(openBlock(),createElementBlock("div",V2,[unref(i)%2===0?(openBlock(),createElementBlock("div",E2,[renderSlot(c.$slots,"default")])):createCommentVNode("",!0)])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["relative flex flex-col items-center",unref(t).split?"":"absolute left-0"])},[createBaseVNode("div",{class:normalizeClass$1(["flex items-center",o.value])},[renderSlot(c.$slots,"dot",{},()=>[d[0]||(d[0]=createBaseVNode("div",{class:"w-4 h-4 rounded-full bg-blue-400 relative"},[createBaseVNode("div",{class:"absolute w-3 h-3 rounded-full top-0.5 left-0.5 bg-white"})],-1))])],2),s.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["bg-blue-400 w-0.5",a.value])},null,2))],2),unref(t).split?(openBlock(),createElementBlock("div",T2,[unref(i)%2!==0?(openBlock(),createElementBlock("div",R2,[renderSlot(c.$slots,"default")])):createCommentVNode("",!0)])):createCommentVNode("",!0),unref(t).split?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:2,class:normalizeClass$1(["pl-8",l.value])},[renderSlot(c.$slots,"default")],2))],2))}}),M2={class:normalizeClass$1(["inline-flex items-center gap-1"])},N2={key:0,class:"w-4 h-4 text-red-500"},I2={key:1,class:"w-4 h-4 text-green-500"},L2=defineComponent({__name:"ShadcnTrend",props:{value:{default:0},reverse:{type:Boolean,default:!1},textColor:{type:Boolean,default:!1}},setup(n){const e=n,t=computed(()=>e.reverse?e.value<0:e.value>0);return(i,s)=>(openBlock(),createElementBlock("div",M2,[createBaseVNode("div",{class:normalizeClass$1(["text-xs",i.textColor?[t.value?"text-red-500":"text-green-500"]:"text-gray-500"])},[renderSlot(i.$slots,"default",{},()=>[createTextVNode(toDisplayString$1(i.value),1)])],2),t.value?(openBlock(),createElementBlock("div",N2,[renderSlot(i.$slots,"rise",{},()=>[s[0]||(s[0]=createBaseVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[createBaseVNode("path",{d:"M23 6l-9.5 9.5-5-5L1 18"}),createBaseVNode("path",{d:"M17 6h6v6"})],-1))])])):(openBlock(),createElementBlock("div",I2,[renderSlot(i.$slots,"descend",{},()=>[s[1]||(s[1]=createBaseVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[createBaseVNode("path",{d:"M23 18l-9.5-9.5-5 5L1 6"}),createBaseVNode("path",{d:"M17 18h6v-6"})],-1))])]))]))}}),O2={class:"h-full w-full flex items-center justify-center"},B2={class:"flex flex-col items-center justify-center px-4 py-2"},D2={class:"mb-6"},P2={key:0,class:"w-24 h-24",viewBox:"0 0 24 24",fill:"none"},F2={key:1,class:"w-24 h-24",viewBox:"0 0 24 24",fill:"none"},U2={key:2,class:"w-24 h-24",viewBox:"0 0 24 24",fill:"none"},z2={key:3,class:"w-24 h-24",viewBox:"0 0 24 24",fill:"none"},W2={class:"text-2xl font-bold text-gray-900 mb-2"},H2={class:"text-base text-gray-500 mb-6 text-center max-w-md"},G2={class:"flex gap-4"},q2=defineComponent({__name:"ShadcnException",props:{type:{default:"404"},title:{},description:{}},setup(n){const e={401:{type:"UNAUTHORIZED",title:String(P("exception.text.401.title")),description:String(P("exception.text.401.description"))},403:{type:"FORBIDDEN",title:String(P("exception.text.403.title")),description:String(P("exception.text.403.description"))},404:{type:"NOT_FOUND",title:String(P("exception.text.404.title")),description:String(P("exception.text.404.description"))},500:{type:"INTERNAL_SERVER_ERROR",title:String(P("exception.text.500.title")),description:String(P("exception.text.500.description"))}},t=n,i=computed(()=>e[t.type].title),s=computed(()=>e[t.type].description);return(r,o)=>(openBlock(),createElementBlock("div",O2,[createBaseVNode("div",B2,[createBaseVNode("div",D2,[renderSlot(r.$slots,"icon",{},()=>[r.type==="401"?(openBlock(),createElementBlock("svg",P2,o[0]||(o[0]=[createBaseVNode("circle",{cx:"12",cy:"12",r:"10",class:"stroke-gray-200","stroke-width":"1.5"},null,-1),createBaseVNode("path",{d:"M8 11v-1a4 4 0 0 1 8 0v1M10 14a2 2 0 1 0 4 0",class:"stroke-gray-400","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))):r.type==="404"?(openBlock(),createElementBlock("svg",F2,o[1]||(o[1]=[createBaseVNode("circle",{cx:"12",cy:"12",r:"10",class:"stroke-gray-200","stroke-width":"1.5"},null,-1),createBaseVNode("path",{d:"M9 10h.01M15 10h.01",class:"stroke-gray-400","stroke-width":"2","stroke-linecap":"round"},null,-1),createBaseVNode("path",{d:"M9 15c.5-1.5 1.79-2 3-2s2.5.5 3 2",class:"stroke-gray-400","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))):r.type==="403"?(openBlock(),createElementBlock("svg",U2,o[2]||(o[2]=[createBaseVNode("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",class:"stroke-gray-200","stroke-width":"1.5"},null,-1),createBaseVNode("path",{d:"M12 10v5M10 12h4",class:"stroke-gray-400","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))):r.type==="500"?(openBlock(),createElementBlock("svg",z2,o[3]||(o[3]=[createBaseVNode("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",class:"stroke-gray-200","stroke-width":"1.5"},null,-1),createBaseVNode("path",{d:"M12 9v4M12 17h.01",class:"stroke-gray-400","stroke-width":"1.5","stroke-linecap":"round"},null,-1)]))):createCommentVNode("",!0)])]),createBaseVNode("h1",W2,toDisplayString$1(r.title||i.value),1),createBaseVNode("p",H2,toDisplayString$1(r.description||s.value),1),createBaseVNode("div",G2,[renderSlot(r.$slots,"actions",{},()=>[createVNode(unref(Nr),{type:"primary"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("exception.action.backHome")),1)]),_:1})])])])]))}}),j2={class:"border rounded-md border-gray-200"},Y2=defineComponent({__name:"ShadcnCollapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e;return provide("expandedItems",toRef(t,"modelValue")),provide("accordion",toRef(t,"accordion")),provide("toggleItem",s=>{const r=[...t.modelValue],o=r.indexOf(s);t.accordion?(i("update:modelValue",o===-1?[s]:[]),i("on-change",{name:s,value:o===-1?[s]:[]})):(o===-1?r.push(s):r.splice(o,1),i("update:modelValue",r),i("on-change",{name:s,value:r}))}),(s,r)=>(openBlock(),createElementBlock("div",j2,[renderSlot(s.$slots,"default")]))}}),K2={class:"collapse-item border-b last:border-b-0 border-gray-200"},J2={class:"text-sm font-medium"},X2={class:"px-4 py-2 text-sm text-gray-600"},Z2=defineComponent({__name:"ShadcnCollapseItem",props:{title:{},name:{}},setup(n){const e=n,t=inject("expandedItems"),i=inject("toggleItem"),s=ref(!1);onMounted(()=>{if(!t||!i){console.error("ShadcnCollapseItem must be used inside ShadcnCollapse");return}s.value=!0});const r=computed(()=>t?t.value.includes(e.name):!1),o=()=>{s.value&&(i==null||i(e.name))};return(a,l)=>(openBlock(),createElementBlock("div",K2,[createBaseVNode("div",{class:normalizeClass$1(["flex justify-between items-center px-4 py-2 cursor-pointer hover:bg-gray-50 bg-gray-50"]),onClick:o},[renderSlot(a.$slots,"title",{},()=>[createBaseVNode("h3",J2,toDisplayString$1(a.title),1)]),createVNode(unref(at),{icon:"ChevronDown",class:normalizeClass$1(["h-4 w-4 text-gray-500 transition-transform duration-200",{"transform rotate-180":r.value}])},null,8,["class"])]),createVNode(Transition,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"transform scale-y-95 opacity-0","enter-to-class":"transform scale-y-100 opacity-100","leave-active-class":"transition duration-200 ease-out","leave-from-class":"transform scale-y-100 opacity-100","leave-to-class":"transform scale-y-95 opacity-0"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",X2,[renderSlot(a.$slots,"default")],512),[[vShow,r.value]])]),_:3})]))}});class Zd{static hexToRgb(e){e=e.replace("#",""),e.length===3&&(e=e.split("").map(r=>r+r).join(""));const t=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),s=parseInt(e.substring(4,6),16);if(isNaN(t)||isNaN(i)||isNaN(s))throw new Error("Invalid hex color");return{r:t,g:i,b:s}}static rgbToHex(e){const t=i=>{const s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return"#"+t(e.r)+t(e.g)+t(e.b)}static rgbToHsl(e){const t=e.r/255,i=e.g/255,s=e.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s);let a=0,l=0;const c=(r+o)/2;if(r!==o){const d=r-o;switch(l=c>.5?d/(2-r-o):d/(r+o),r){case t:a=(i-s)/d+(i(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?u+(f-u)*6*g:g<.5?f:g<.6666666666666666?u+(f-u)*(.6666666666666666-g)*6:u),c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;r=l(d,c,t+1/3),o=l(d,c,t),a=l(d,c,t-1/3)}return{r:Math.round(r*255),g:Math.round(o*255),b:Math.round(a*255)}}static adjustBrightness(e,t){const i=this.hexToRgb(e),s=this.rgbToHsl(i);return s.l=Math.max(0,Math.min(100,s.l+t)),this.rgbToHex(this.hslToRgb(s))}static validateHexColor(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}}function Q2(n){if(!Zd.validateHexColor(n))throw new Error("Invalid color format. Please use hex color (e.g., #FF0000)");return Zd.adjustBrightness(n,-10)}const e_=defineComponent({__name:"ShadcnTag",props:{text:{},name:{},type:{default:"default"},border:{type:Boolean,default:!1},size:{default:"default"},closable:{type:Boolean,default:!1},color:{}},emits:["on-close","update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=r=>{r.preventDefault(),i("on-close",t.name||t.text),i("update:modelValue",!1)};return(r,o)=>{const a=resolveComponent("ShadcnIcon");return openBlock(),createElementBlock("div",{class:normalizeClass$1(["inline-flex items-center rounded-sm text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",unref(kc)[r.type],r.border&&"border",r.border&&unref($c)[r.type],[r.type==="default"?"text-gray-800":"text-white"],[r.color&&"text-white"],unref(Rc)[r.size]]),style:normalizeStyle$1([r.color&&{backgroundColor:r.color},r.color&&r.border&&{borderColor:unref(Q2)(r.color)}])},[renderSlot(r.$slots,"default",{},()=>[createTextVNode(toDisplayString$1(r.text),1)]),r.closable?(openBlock(),createBlock$1(a,{key:0,icon:"X",class:normalizeClass$1(["ml-2 h-4 w-4 cursor-pointer"]),onClick:withModifiers(s,["stop"]),onKeydown:withKeys(s,["enter"])})):createCommentVNode("",!0)],6)}}}),t_={class:"w-full bg-background border-t"},n_={class:"container mx-auto px-4 py-8"},o_={class:"grid grid-cols-2 md:grid-cols-4 gap-8 pb-8"},a_={class:"col-span-2 md:col-span-1"},r_={class:"flex items-center gap-2 mb-4"},l_={class:"text-lg font-semibold"},s_={class:"text-sm text-muted-foreground"},i_={class:"font-semibold mb-2"},u_={class:"inline-flex items-center gap-2"},d_={class:"pt-8 border-t"},c_={class:"flex flex-col md:flex-row justify-between items-center gap-4"},f_={class:"text-sm text-muted-foreground"},p_={class:"flex items-center gap-4"},h_={class:"sr-only"},m_=defineComponent({__name:"ShadcnGlobalFooter",props:{company:{default:"Devlive Community"},description:{default:"The Devlive Software Foundation is a community of developers who are passionate about creating innovative software solutions."},links:{default:()=>[]},socials:{default:()=>[]}},setup(n){return(e,t)=>(openBlock(),createElementBlock("footer",t_,[createBaseVNode("div",n_,[createBaseVNode("div",o_,[createBaseVNode("div",a_,[createBaseVNode("div",r_,[renderSlot(e.$slots,"logo",{},()=>[t[0]||(t[0]=createBaseVNode("div",{class:"w-8 h-8 bg-gray-200 rounded-md"},null,-1))]),createBaseVNode("span",l_,toDisplayString$1(e.company),1)]),createBaseVNode("p",s_,toDisplayString$1(e.description),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(e.links,(i,s)=>(openBlock(),createElementBlock("div",{key:`group-${s}`,class:"flex flex-col gap-2"},[createBaseVNode("h3",i_,toDisplayString$1(i.title),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(i.links,(r,o)=>(openBlock(),createBlock$1(unref(wa),{key:`group-${s}-link-${o}`,class:"text-sm text-muted-foreground transition-colors flex items-center gap-2",link:r.href,external:r.external,target:r.target},{default:withCtx(()=>[createBaseVNode("div",u_,[r.icon?(openBlock(),createBlock$1(unref(at),{key:0,class:"w-5 h-5",icon:r.icon},null,8,["icon"])):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString$1(r.label),1)])]),_:2},1032,["link","external","target"]))),128))]))),128))]),createBaseVNode("div",d_,[createBaseVNode("div",c_,[createBaseVNode("div",f_,[renderSlot(e.$slots,"copyright",{},()=>[createTextVNode(" © "+toDisplayString$1(new Date().getFullYear())+" "+toDisplayString$1(e.company)+". All rights reserved. ",1)])]),createBaseVNode("div",p_,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.socials,(i,s)=>(openBlock(),createBlock$1(unref(wa),{key:`social-${s}`,link:i.href,external:"",target:"_blank",class:"text-muted-foreground hover:text-foreground transition-colors"},{default:withCtx(()=>[i.icon?(openBlock(),createBlock$1(unref(at),{key:0,icon:i.icon,class:"w-5 h-5"},null,8,["icon"])):createCommentVNode("",!0),createBaseVNode("span",h_,toDisplayString$1(i.label),1)]),_:2},1032,["link"]))),128))])])])])]))}}),v_={class:"flex flex-1 items-center gap-2"},g_={class:"flex items-center gap-2"},y_=defineComponent({__name:"ShadcnToolbarFooter",props:{modelValue:{type:Boolean,default:!0},autoHide:{type:Boolean,default:!1},autoHideDelay:{default:3e3},hideOnScroll:{type:Boolean,default:!0},scrollStopDelay:{default:600},fullWidth:{type:Boolean,default:!1}},emits:["update:modelValue","on-cancel","on-ok"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.modelValue);let r=null,o=null,a=0,l=ref(!1);watch(()=>i.modelValue,m=>{s.value=m});const c=()=>{r&&clearTimeout(r),r=setTimeout(()=>{s.value=!1,t("update:modelValue",s.value)},i.autoHideDelay)},d=()=>{l.value&&(l.value=!1,s.value=!0,t("update:modelValue",s.value))},u=()=>{if(!i.hideOnScroll)return;o&&clearTimeout(o);const m=window.scrollY||document.documentElement.scrollTop,_=m>a;l.value=!0,_&&s.value&&(s.value=!1,t("update:modelValue",s.value)),o=setTimeout(()=>{d()},i.scrollStopDelay),a=m},f=()=>{s.value=!1,t("on-cancel"),t("update:modelValue",s.value)},g=()=>{s.value=!1,t("on-ok"),t("update:modelValue",s.value)};return onMounted(()=>{i.hideOnScroll&&(window.addEventListener("scroll",u,{passive:!0}),a=window.scrollY||document.documentElement.scrollTop),i.autoHide&&s.value&&c()}),onBeforeUnmount(()=>{i.hideOnScroll&&window.removeEventListener("scroll",u),r&&clearTimeout(r),o&&clearTimeout(o)}),(m,_)=>s.value?(openBlock(),createElementBlock("footer",{key:0,class:normalizeClass$1(["fixed bottom-0 left-0 right-0 z-50 border-t bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60","transform transition-transform duration-200 ease-in-out",s.value?"translate-y-0":"translate-y-full"])},[createBaseVNode("div",{class:normalizeClass$1(["flex h-16 items-center gap-4 px-4",m.fullWidth?void 0:"container"])},[createBaseVNode("div",v_,[renderSlot(m.$slots,"left")]),createBaseVNode("div",g_,[renderSlot(m.$slots,"right",{},()=>[createVNode(unref(Nr),{type:"danger",onClick:f},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("toolbar.text.cancel")),1)]),_:1}),createVNode(unref(Nr),{type:"primary",onClick:g},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("toolbar.text.ok")),1)]),_:1})])])],2)],2)):createCommentVNode("",!0)}}),b_={key:0,class:"relative w-full h-full"},w_={class:"relative z-10"},x_=defineComponent({__name:"ShadcnWatermark",props:{content:{default:"Devlive Community"},width:{default:120},height:{default:64},gapX:{default:100},gapY:{default:100},rotate:{default:-22},fontSize:{default:8},fontColor:{default:"rgba(0, 0, 0, 0.15)"},fontFamily:{default:"sans-serif"},opacity:{default:1},antiTamperLayers:{default:2},fontWeight:{default:400},zIndex:{default:9},fullscreen:{type:Boolean,default:!1}},setup(n){const e=n,t=computed(()=>{const r=Array.isArray(e.content)?e.content:[e.content],o=r.map((a,l)=>`${a}`).join("");return` + + + ${o} + + + `}),i=defineComponent({setup(){return()=>h$1("div",{class:["pointer-events-none select-none",e.fullscreen?"fixed":"absolute","inset-0"],style:{opacity:e.opacity,zIndex:e.zIndex},"aria-hidden":!0},[h$1("div",{class:"absolute inset-0",style:{backgroundImage:`url('data:image/svg+xml,${encodeURIComponent(t.value)}')`,backgroundRepeat:"repeat",backgroundSize:`${e.gapX+e.width}px ${e.gapY+e.height}px`}}),...[...Array(e.antiTamperLayers)].map((r,o)=>h$1("div",{key:o,class:"absolute inset-0",style:{backgroundImage:`url('data:image/svg+xml,${encodeURIComponent(t.value)}')`,backgroundRepeat:"repeat",backgroundSize:`${e.gapX+e.width}px ${e.gapY+e.height}px`,transform:`translate(${o*.1}px, ${o*.1}px)`}}))])}});let s=null;return onMounted(()=>{s=new MutationObserver(o=>{o.forEach(a=>{(a.type==="childList"||a.type==="attributes")&&a.target.dispatchEvent(new Event("watermark-changed"))})});const r=document.querySelector(".watermark-container");r&&s.observe(r,{attributes:!0,childList:!0,subtree:!0})}),onUnmounted(()=>{s&&s.disconnect()}),(r,o)=>r.$slots.default?(openBlock(),createElementBlock("div",b_,[createBaseVNode("div",w_,[renderSlot(r.$slots,"default")]),createVNode(unref(i))])):r.fullscreen?(openBlock(),createBlock$1(unref(i),{key:1})):createCommentVNode("",!0)}}),__={class:"inline-block"},io=defineComponent({__name:"ShadcnHighlight",props:{text:{},highlight:{},caseSensitive:{type:Boolean,default:!1}},setup(n){const e=n,t=computed(()=>Array.isArray(e.highlight)?e.highlight:[e.highlight]),i=computed(()=>{let s=[{text:e.text,isMatch:!1}];return t.value.forEach(r=>{if(!r)return;const o=[];s.forEach(a=>{if(a.isMatch){o.push(a);return}const l=e.caseSensitive?a.text.toLowerCase():a.text,c=e.caseSensitive?r.toLowerCase():r;let d=0,u=l.indexOf(c);for(;u!==-1;)u>d&&o.push({text:a.text.slice(d,u),isMatch:!1}),o.push({text:a.text.slice(u,u+c.length),isMatch:!0}),d=u+c.length,u=l.indexOf(c,d);d(openBlock(),createElementBlock("div",__,[(openBlock(!0),createElementBlock(Fragment,null,renderList(i.value,(o,a)=>(openBlock(),createElementBlock("span",{key:a,class:normalizeClass$1([o.isMatch?"bg-yellow-200 dark:bg-yellow-800 rounded px-1 mx-0.5":void 0])},toDisplayString$1(o.text),3))),128))]))}});var Lo=(n=>(n.left="left",n.right="right",n.top="top",n.bottom="bottom",n))(Lo||{});const C_={key:0,class:"py-1"},k_={key:1,class:"py-1"},$_=defineComponent({__name:"ShadcnDropdown",props:{trigger:{default:"click"},position:{default:Lo.left}},emits:["on-open","on-close","on-click-outside"],setup(n,{emit:e}){const t=e,i=n,s=ref(!1),r=ref(null),o=ref(null);let a=null;const l=async()=>{if(!r.value||!s.value)return;await nextTick$1();const S=r.value.getBoundingClientRect(),w=document.querySelector(".fixed");if(w)switch(i.position){case Lo.left:w.style.left=`${S.left}px`,w.style.top=`${S.bottom+4}px`;break;case Lo.right:w.style.right=`${window.innerWidth-S.right}px`,w.style.top=`${S.bottom+4}px`;break;case Lo.top:w.style.left=`${S.left}px`,w.style.bottom=`${window.innerHeight-S.top+4}px`;break;case Lo.bottom:w.style.left=`${S.left}px`,w.style.top=`${S.bottom+4}px`;break}},c=computed(()=>"min-w-[8rem]"),d=computed(()=>({})),u=async S=>{s.value=!s.value,s.value&&await l(),t("on-open",s.value)},f=async()=>{s.value=!0,await l(),t("on-open",s.value)},g=()=>{s.value=!1,t("on-close",s.value)},m=()=>{i.trigger==="hover"&&(a=setTimeout(()=>{g()},100))},_=()=>{a&&(clearTimeout(a),a=null)},v=()=>{i.trigger==="hover"&&g()},C=S=>{if(r.value&&!r.value.contains(S.target)){const w=document.querySelector(".fixed");w&&!w.contains(S.target)&&s.value&&(g(),t("on-click-outside",!0))}};return provide("closeDropdown",g),onMounted(()=>{document.addEventListener("click",C),window.addEventListener("scroll",l),window.addEventListener("resize",l)}),onUnmounted(()=>{document.removeEventListener("click",C),window.removeEventListener("scroll",l),window.removeEventListener("resize",l),a&&clearTimeout(a)}),(S,w)=>(openBlock(),createElementBlock("div",{ref_key:"dropdownRef",ref:r,class:"relative inline-block"},[createBaseVNode("div",{onClick:w[0]||(w[0]=L=>S.trigger==="click"&&u()),onMouseenter:w[1]||(w[1]=L=>S.trigger==="hover"&&f()),onMouseleave:w[2]||(w[2]=L=>S.trigger==="hover"&&m()),class:"inline-flex items-center justify-center cursor-pointer"},[renderSlot(S.$slots,"trigger")],32),(openBlock(),createBlock$1(Teleport,{to:"body"},[createVNode(Transition,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:withCtx(()=>[s.value?(openBlock(),createElementBlock("div",{key:0,ref_key:"menuRef",ref:o,onMouseenter:w[3]||(w[3]=L=>S.trigger==="hover"&&_()),onMouseleave:w[4]||(w[4]=L=>S.trigger==="hover"&&v()),class:normalizeClass$1(["fixed z-50 min-w-[8rem] rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",c.value]),style:normalizeStyle$1(d.value)},[S.$slots.list?(openBlock(),createElementBlock("div",C_,[renderSlot(S.$slots,"list",{close:g})])):(openBlock(),createElementBlock("div",k_,[renderSlot(S.$slots,"default",{close:g})]))],38)):createCommentVNode("",!0)]),_:3})]))],512))}}),S_={key:0,class:"h-px my-1 bg-gray-100"},V_=["id"],E_=defineComponent({__name:"ShadcnDropdownItem",props:{name:{default:Pr()},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},divided:{type:Boolean}},emits:["on-click"],setup(n,{emit:e}){const t=e,i=inject("closeDropdown"),s=n,r=o=>{s.disabled||(t("on-click",o),i())};return(o,a)=>(openBlock(),createElementBlock(Fragment,null,[o.divided?(openBlock(),createElementBlock("div",S_)):createCommentVNode("",!0),createBaseVNode("div",{onClick:r,id:o.name,class:normalizeClass$1(["block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900",o.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",o.active?"bg-gray-100 text-gray-900":""])},[renderSlot(o.$slots,"default")],10,V_)],64))}});function T_(n){if(n==null||typeof n=="boolean")return!1;if(n===1/0||n===-1/0)return!0;if(typeof n=="number")return!isNaN(n)&&isFinite(n);const e=String(n).trim();if(e==="")return!1;if(e.startsWith("0x")||e.startsWith("0X"))return/^0[xX][0-9a-fA-F]+$/.test(e);if(e.startsWith("0b")||e.startsWith("0B"))return/^0[bB][01]+$/.test(e);if(e.startsWith("0o")||e.startsWith("0O"))return/^0[oO][0-7]+$/.test(e);if(!/^[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?$/.test(e))return!1;const t=Number(e);return!isNaN(t)&&isFinite(t)}function xs(n){return T_(n)}const R_={class:"relative"},A_=["value","disabled","placeholder"],M_={key:1,class:"ml-1 flex flex-col -my-1"},N_=defineComponent({__name:"ShadcnNumber",props:{modelValue:{},name:{},size:{default:"default"},type:{default:"primary"},disabled:{type:Boolean,default:!1},placeholder:{},min:{default:-1/0},max:{default:1/0},clearable:{type:Boolean,default:!1},showControl:{type:Boolean,default:!0},formatter:{type:Function,default:n=>n.toString()},parser:{type:Function,default:n=>Number(n)}},emits:["update:modelValue","on-change","on-blur","on-clear"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.modelValue),r=ref(xs(i.modelValue)),o=ref(!1),a=computed(()=>!r.value||s.value===null||s.value===void 0?s.value:i.formatter?i.formatter(Number(s.value)):s.value),l=inject(`form-item-${i.name}`,null);watch(()=>i.modelValue,C=>{if(r.value=xs(C),xs(C)){const S=Number(C),w=Number(i.min??-1/0),L=Number(i.max??1/0);(SL)&&(r.value=!1)}s.value=C});const c=C=>{if(i.parser&&typeof C=="string")try{C=i.parser(C)}catch(S){console.error("Failed to parse value:",S),r.value=!1;return}t("update:modelValue",C),t("on-change",C)},d=()=>{i.disabled||(o.value=!0)},u=()=>{o.value=!1},f=C=>{const S=C.target.value;s.value=S,c(S)},g=C=>{const S=C.target.value;s.value=S,c(S),t("on-blur",S),l&&l.onBlur()},m=()=>{c(null),t("on-clear",null)},_=()=>{if(r.value){const C=Number(s.value)+1;C<=Number(i.max)&&c(C)}},v=()=>{if(r.value){const C=Number(s.value)-1;C>=Number(i.min)&&c(C)}};return(C,S)=>(openBlock(),createElementBlock("div",R_,[createBaseVNode("div",{class:normalizeClass$1(["flex items-center justify-between border rounded p-3 pr-1.5",unref(Oo)[C.size],unref(ho)[C.type],{"cursor-pointer":!C.disabled,"cursor-not-allowed opacity-50 bg-gray-100":C.disabled}]),onMouseover:d,onMouseleave:u},[createBaseVNode("input",{class:normalizeClass$1(["w-full outline-none text-sm",!r.value&&a.value&&"line-through"]),type:"text",value:a.value,disabled:C.disabled,placeholder:C.placeholder,onInput:f,onBlur:g},null,42,A_),C.clearable&&a.value&&o.value?(openBlock(),createElementBlock("div",{key:0,class:"flex items-center",onClick:m},[renderSlot(C.$slots,"clear",{},()=>[S[0]||(S[0]=createBaseVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-3 h-3 p-0.5 rounded-full bg-gray-200 text-gray-400 hover:bg-gray-300 hover:text-muted-foreground"},[createBaseVNode("path",{d:"M5 19L19 5M5 5l14 14",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))])])):createCommentVNode("",!0),C.showControl?(openBlock(),createElementBlock("div",M_,[createBaseVNode("div",{class:normalizeClass$1(["h-3 flex items-center justify-center",{"cursor-pointer rounded":!C.disabled&&r.value&&Number(s.value)=Number(i.max)}]),onClick:_},[renderSlot(C.$slots,"add",{},()=>[S[1]||(S[1]=createBaseVNode("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-2.5 h-2.5 text-gray-400 hover:text-muted-foreground mt-1"},[createBaseVNode("path",{d:"M13 8H3M8 3v10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))])],2),createBaseVNode("div",{class:normalizeClass$1(["h-3 flex items-center justify-center",{"cursor-pointer rounded":!C.disabled&&r.value&&Number(s.value)>Number(i.min),"cursor-not-allowed opacity-50":!r.value||Number(s.value)<=Number(i.min)}]),onClick:v},[renderSlot(C.$slots,"minus",{},()=>[S[2]||(S[2]=createBaseVNode("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-2.5 h-2.5 text-gray-400 hover:text-muted-foreground"},[createBaseVNode("path",{d:"M13 8H3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1))])],2)])):createCommentVNode("",!0)],34)]))}}),I_={key:0},L_={key:0,class:"absolute top-0 left-0 bottom-0 bg-gray-200",style:{left:"0.75em",width:"1px"}},O_={key:1,class:"absolute top-0 left-0 bottom-0 bg-gray-200",style:{left:"2.3em",width:"1px"}},B_={key:2,class:"absolute top-1/2 left-0 bg-gray-200",style:{left:"2.35em",width:"0.8em",height:"1px"}},D_={key:0,class:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},P_={key:1},F_={key:1,class:"inline-block w-6"},U_={key:1,class:"relative inline-block min-w-full"},z_=defineComponent({__name:"ShadcnTreeNode",props:{node:{},level:{},selectedValues:{default:()=>[]},checkable:{type:Boolean,default:!1},cascade:{type:Boolean,default:!1},showLine:{type:Boolean},loadData:{type:Function,default:void 0}},emits:["on-expand","on-node-click","on-load"],setup(n,{emit:e}){const t=e,i=n,s=ref(!1),r=ref(!1),o=computed(()=>i.node.children&&i.node.children.length>0),a=computed(()=>o.value||i.node.isLeaf===!1),l=computed(()=>i.selectedValues.includes(i.node.value)),c=computed(()=>{var _,v;if(!o.value||!i.cascade)return!1;const C=((_=i.node.children)==null?void 0:_.some(w=>i.selectedValues.includes(w.value)))??!1,S=((v=i.node.children)==null?void 0:v.every(w=>i.selectedValues.includes(w.value)))??!1;return C&&!S&&!l.value}),d=computed({get(){return i.selectedValues.includes(i.node.value)?i.node.value:""},set(){t("on-node-click",i.node)}});watch(()=>i.selectedValues,_=>{_.includes(i.node.value)&&o.value&&(s.value=!0)},{immediate:!0});const u=async _=>{if(_.stopPropagation(),!o.value&&i.node.isLeaf===!1&&!s.value&&i.loadData){r.value=!0;try{i.loadData(i.node,v=>{i.node.children=v,r.value=!1,s.value=!0})}catch(v){console.error("Failed to load children:",v),r.value=!1}}else s.value=!s.value;t("on-expand",i.node)},f=_=>t("on-expand",_),g=()=>{i.node.disabled||i.checkable||t("on-node-click",i.node)},m=_=>t("on-node-click",_);return(_,v)=>{const C=resolveComponent("ShadcnTreeNode",!0);return openBlock(),createElementBlock("div",{class:"relative py-0.5",style:normalizeStyle$1(_.level>0?{paddingLeft:"1.5em"}:void 0)},[_.showLine?(openBlock(),createElementBlock("div",I_,[_.level>0?(openBlock(),createElementBlock("div",L_)):createCommentVNode("",!0),_.level>0&&!o.value?(openBlock(),createElementBlock("div",O_)):createCommentVNode("",!0),_.level>0&&!o.value?(openBlock(),createElementBlock("div",B_)):createCommentVNode("",!0)])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["inline-flex items-center py-0.5 px-1.5 rounded-sm whitespace-nowrap",{"bg-gray-200":l.value&&!_.showLine},{"hover:bg-gray-100":!l.value&&!_.showLine},{"cursor-not-allowed":_.node.disabled},{"cursor-pointer":!_.node.disabled}]),onClick:g},[a.value?(openBlock(),createElementBlock("button",{key:0,class:"inline-flex w-4 h-4 items-center justify-center mr-2 text-gray-500 hover:text-gray-700",onClick:withModifiers(u,["stop"])},[r.value?(openBlock(),createElementBlock("svg",D_,v[1]||(v[1]=[createBaseVNode("circle",{class:"opacity-10",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),createBaseVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(openBlock(),createElementBlock("div",P_,[s.value?renderSlot(_.$slots,"collapse",{key:1},()=>[v[3]||(v[3]=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"w-4 h-4 transition-transform rotate-90"},[createBaseVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1))]):renderSlot(_.$slots,"expand",{key:0},()=>[v[2]||(v[2]=createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"w-4 h-4 transition-transform"},[createBaseVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1))])]))])):(openBlock(),createElementBlock("span",F_)),_.checkable?(openBlock(),createBlock$1(unref(Qc),{key:2,modelValue:d.value,"onUpdate:modelValue":v[0]||(v[0]=S=>d.value=S),size:"small",class:"inline-block",value:_.node.value,disabled:_.node.disabled,indeterminate:_.cascade&&c.value},null,8,["modelValue","value","disabled","indeterminate"])):createCommentVNode("",!0),renderSlot(_.$slots,"label",{node:_.node,level:_.level,isSelected:l.value},()=>[createBaseVNode("span",{class:normalizeClass$1(["inline-block text-sm whitespace-nowrap",{"hover:bg-gray-100 px-2 py-0.5 hover:rounded-sm":_.showLine&&!_.node.disabled},{"text-gray-500 px-2":_.node.disabled&&_.showLine},{"text-gray-500":_.node.disabled&&!_.showLine},{"bg-gray-100 rounded-sm":l.value&&_.showLine}])},toDisplayString$1(_.node.label),3)])],2),o.value&&s.value?(openBlock(),createElementBlock("div",U_,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_.node.children,S=>(openBlock(),createBlock$1(C,{key:S.value,node:S,level:_.level+1,"selected-values":_.selectedValues,checkable:_.checkable,cascade:_.cascade,"show-line":_.showLine,"load-data":_.loadData,onOnExpand:f,onOnNodeClick:m},{label:withCtx(w=>[renderSlot(_.$slots,"label",mergeProps({ref_for:!0},w))]),expand:withCtx(w=>[renderSlot(_.$slots,"expand",mergeProps({ref_for:!0},w))]),collapse:withCtx(w=>[renderSlot(_.$slots,"collapse",mergeProps({ref_for:!0},w))]),_:2},1032,["node","level","selected-values","checkable","cascade","show-line","load-data"]))),128))])):createCommentVNode("",!0)],4)}}}),W_={class:"w-full"},H_=defineComponent({__name:"ShadcnTree",props:{modelValue:{default:()=>[]},data:{default:()=>[]},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},cascade:{type:Boolean,default:!1},showLine:{type:Boolean,default:!1},loadData:{type:Function,default:void 0}},emits:["update:modelValue","on-expand","on-node-click","on-load"],setup(n,{emit:e}){const t=e,i=n,s=ref([]);watch(()=>i.modelValue,d=>{s.value=d??[]});const r=d=>t("on-expand",d),o=d=>{let u=[];return d.children&&d.children.length>0&&d.children.forEach(f=>{u.push(f.value),u=u.concat(o(f))}),u},a=(d,u,f)=>{let g=[];for(const m of d)if(m.children&&m.children.length>0){if(m.children.some(v=>v.value===u))return f&&g.push(f),g.push(m),g;const _=a(m.children,u,m);if(_.length>0)return f&&g.push(f),g=g.concat(_),g}return g},l=(d,u)=>!d.children||d.children.length===0?!0:d.children.every(f=>f.children&&f.children.length>0?l(f,u):u.includes(f.value)),c=d=>{if(!i.checkable){const g=i.modelValue.indexOf(d.value);let m;g===-1?i.multiple?m=[...i.modelValue,d.value]:m=[d.value]:(m=i.modelValue.slice(),m.splice(g,1)),t("update:modelValue",m),t("on-node-click",d);return}let u=[...i.modelValue];const f=u.indexOf(d.value);if(!i.cascade)f===-1?i.multiple?u=[...u,d.value]:u=[d.value]:u.splice(f,1);else if(f===-1)u.push(d.value),o(d).forEach(g=>{u.includes(g)||u.push(g)}),a(i.data,d.value).forEach(g=>{l(g,u)&&!u.includes(g.value)&&u.push(g.value)});else{u.splice(f,1);const g=o(d);u=u.filter(m=>!g.includes(m)),a(i.data,d.value).forEach(m=>{const _=u.indexOf(m.value);_!==-1&&u.splice(_,1)})}t("update:modelValue",u),t("on-node-click",d)};return(d,u)=>(openBlock(),createElementBlock("div",W_,[(openBlock(!0),createElementBlock(Fragment,null,renderList(d.data,f=>(openBlock(),createBlock$1(z_,{key:f.value,node:f,level:0,"selected-values":d.modelValue,checkable:d.checkable,cascade:d.cascade,"show-line":d.showLine,loadData:d.loadData,onOnExpand:r,onOnNodeClick:c},{label:withCtx(g=>[renderSlot(d.$slots,"label",mergeProps({ref_for:!0},g))]),expand:withCtx(g=>[renderSlot(d.$slots,"expand",mergeProps({ref_for:!0},g))]),collapse:withCtx(g=>[renderSlot(d.$slots,"collapse",mergeProps({ref_for:!0},g))]),_:2},1032,["node","selected-values","checkable","cascade","show-line","loadData"]))),128))]))}});var nf=(n=>(n.h1="text-4xl lg:text-5xl",n.h2="text-3xl lg:text-4xl",n.h3="text-2xl lg:text-3xl",n.h4="text-xl lg:text-2xl",n.h5="text-lg lg:text-xl",n.h6="text-base lg:text-lg",n.p="text-base lg:text-lg",n.span="text-base lg:text-lg",n.label="text-base lg:text-lg",n.small="text-sm lg:text-base",n.code="relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",n.pre="overflow-x-auto rounded-lg bg-muted p-2 font-mono text-sm",n))(nf||{});const G_=defineComponent({__name:"ShadcnText",props:{type:{default:"p"},color:{},colorType:{default:"default"},strong:{type:Boolean,default:!1},italic:{type:Boolean,default:!1},underline:{type:Boolean,default:!1},deleted:{type:Boolean,default:!1}},setup(n){return(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["inline-flex",!e.color&&unref(mo)[e.colorType],e.strong&&"font-semibold",e.italic&&"italic",e.underline&&"underline",e.deleted&&"line-through",e.type&&unref(nf)[e.type]]),style:normalizeStyle$1([e.color&&{color:e.color}])},[renderSlot(e.$slots,"default")],6))}}),q_=defineComponent({__name:"ShadcnGradientText",props:{from:{default:"red"},to:{default:"blue"},deg:{default:100},options:{}},setup(n){return(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["bg-clip-text text-transparent inline-block "]),style:normalizeStyle$1({backgroundImage:e.options?`linear-gradient(${e.options})`:`linear-gradient(${e.deg}deg, ${e.from}, ${e.to})`})},[renderSlot(e.$slots,"default")],4))}}),j_=defineComponent({__name:"ShadcnContextMenu",props:{modelValue:{type:Boolean,default:!1},position:{default:void 0}},emits:["update:modelValue","on-open","on-close"],setup(n,{emit:e}){const t=e,i=n,s=ref({x:0,y:0}),r=ref(null),o=ref(null);watch(()=>i.position,f=>{f&&(s.value=f)},{immediate:!0});const a=computed(()=>{const f=i.position||s.value;if(!r.value)return{left:ke(f.x),top:ke(f.y)};const g=r.value.getBoundingClientRect(),m=g.width,_=g.height,v=window.innerWidth,C=window.innerHeight;let S=f.x,w=f.y;return S+m>v&&(S=v-m-10),S<0&&(S=8),w+_>C&&(w=C-_-8),w<0&&(w=8),{left:ke(S),top:ke(w)}}),l=f=>{i.position||(f.preventDefault(),s.value={x:f.clientX,y:f.clientY},t("update:modelValue",!0),t("on-open",!0))},c=()=>{t("update:modelValue",!1),t("on-close",!1)};provide("closeMenu",c);const d=f=>{r.value&&!r.value.contains(f.target)&&c()},u=()=>{i.modelValue&&c()};return onMounted(()=>{document.addEventListener("click",d),window.addEventListener("resize",u)}),onUnmounted(()=>{document.removeEventListener("click",d),window.removeEventListener("resize",u)}),(f,g)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode("div",{ref_key:"triggerRef",ref:o,onContextmenu:withModifiers(l,["prevent"])},[renderSlot(f.$slots,"trigger")],544),(openBlock(),createBlock$1(Teleport,{to:"body"},[f.modelValue?(openBlock(),createElementBlock("div",{key:0,ref_key:"menuRef",ref:r,class:"fixed min-w-[8rem] z-50 bg-white rounded-md shadow-lg border border-gray-200 p-1",style:normalizeStyle$1(a.value)},[renderSlot(f.$slots,"default")],4)):createCommentVNode("",!0)]))],64))}}),Y_=defineComponent({__name:"ShadcnContextMenuItem",props:{label:{},disabled:{type:Boolean,default:!1}},emits:["on-click"],setup(n,{emit:e}){const t=n,i=inject("closeMenu"),s=e,r=()=>{t.disabled||(s("on-click"),i())};return(o,a)=>(openBlock(),createElementBlock("div",{onClick:r,class:normalizeClass$1(["relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-gray-100 focus:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{"opacity-50 cursor-not-allowed":o.disabled}])},[renderSlot(o.$slots,"default")],2))}}),K_=defineComponent({__name:"ShadcnContextMenuSub",props:{label:{},disabled:{type:Boolean,default:!1}},setup(n){const e=n,t=ref(!1),i=ref(null),s=ref({x:0,y:0}),r=computed(()=>({position:"fixed",left:s.value.x?ke(s.value.x):"100%",top:s.value.y?ke(s.value.y):"0"})),o=async()=>{var d;if(!i.value||!t.value)return;await nextTick$1();const u=(d=i.value.parentElement)==null?void 0:d.getBoundingClientRect(),f=i.value.getBoundingClientRect(),g=window.innerWidth,m=window.innerHeight;if(!u)return;let _=u.right+4,v=u.top;_+f.width>g&&(_=u.left-f.width-4),v<0&&(v=4),v+f.height>m&&(v=m-f.height-4),s.value={x:_,y:v}},a=()=>{e.disabled||(t.value=!0,o())},l=()=>{e.disabled||(t.value=!1)},c=()=>{t.value&&o()};return watch(t,d=>{d&&o()}),onMounted(()=>{window.addEventListener("resize",c)}),onBeforeUnmount(()=>{window.removeEventListener("resize",c)}),(d,u)=>(openBlock(),createElementBlock("div",{class:"relative",onMouseenter:a,onMouseleave:l},[createBaseVNode("div",{class:normalizeClass$1(["relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-gray-100 focus:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{"opacity-50 cursor-not-allowed":d.disabled}])},[renderSlot(d.$slots,"title",{},()=>[createTextVNode(toDisplayString$1(d.label),1)]),u[0]||(u[0]=createBaseVNode("svg",{class:"ml-auto h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1))],2),createVNode(Transition,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition ease-in duration-150","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 translate-y-1"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{ref_key:"subMenuRef",ref:i,class:"absolute min-w-[8rem] rounded-md border bg-white p-1 shadow-md",style:normalizeStyle$1(r.value)},[renderSlot(d.$slots,"default")],4),[[vShow,t.value]])]),_:3})],32))}}),J_={key:0,class:"text-lg font-semibold leading-none tracking-tight border-b px-3 py-2"},X_={class:"text-center break-words px-3 py-2"},Z_={key:1,class:"border-t px-3 py-2"},Q_=defineComponent({__name:"ShadcnHoverCard",props:{content:{},position:{default:"top"},arrow:{type:Boolean,default:!0},delay:{default:0},maxWidth:{default:"250px"}},setup(n){const e=n,t=ref(!1),i=ref(null),s=ref(null),r=ref({}),o=ref({}),a=ref(!1),l=ref(null),c=computed(()=>ke(e.maxWidth)),d=computed(()=>[...{top:["bottom-[-5px]","left-1/2","-translate-x-1/2","rotate-45","border-r","border-b"],bottom:["top-[-5px]","left-1/2","-translate-x-1/2","rotate-45","border-l","border-t"],left:["right-[-5px]","top-1/2","-translate-y-1/2","rotate-45","border-t","border-r"],right:["left-[-5px]","top-1/2","-translate-y-1/2","rotate-45","border-b","border-l"]}[e.position]]),u=()=>{l.value!==null&&(clearTimeout(l.value),l.value=null)},f=()=>{u(),t.value||setTimeout(()=>{t.value=!0,nextTick$1(S)},e.delay)},g=()=>{u(),l.value=setTimeout(()=>{a.value||(t.value=!1)},50)},m=()=>{u(),a.value=!0},_=()=>{a.value=!1,g()},v=()=>{g()};watch(a,L=>{!L&&!t.value&&u()});const C={top:(L,I)=>zc(L,I,8),bottom:(L,I)=>Wc(L,I,8),left:(L,I)=>Hc(L,I,8,e.position),right:(L,I)=>Gc(L,I,8,e.position)},S=async()=>{var L;if(!s.value||!i.value)return;const I=i.value.getBoundingClientRect();await nextTick$1();const N=s.value.getBoundingClientRect();r.value=((L=C[e.position])==null?void 0:L.call(C,I,N))||{}},w=()=>{t.value&&S()};return onMounted(()=>{window.addEventListener("resize",w)}),onUnmounted(()=>{window.removeEventListener("resize",w),u()}),(L,I)=>(openBlock(),createElementBlock("div",{class:"relative inline-block",onMouseenter:f,onMouseleave:v},[createBaseVNode("div",{ref_key:"tooltipTrigger",ref:i},[renderSlot(L.$slots,"default")],512),(openBlock(),createBlock$1(Teleport,{to:"body"},[createVNode(Transition,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:withCtx(()=>[t.value?(openBlock(),createElementBlock("div",{key:0,ref_key:"tooltipContent",ref:s,class:"fixed z-[100] text-sm text-black rounded border border-gray-200 bg-white shadow-lg",style:normalizeStyle$1([r.value,{maxWidth:c.value}]),onMouseenter:m,onMouseleave:_},[L.$slots.title?(openBlock(),createElementBlock("div",J_,[renderSlot(L.$slots,"title")])):createCommentVNode("",!0),renderSlot(L.$slots,"content",{},()=>[createBaseVNode("div",X_,toDisplayString$1(L.content),1)]),L.$slots.footer?(openBlock(),createElementBlock("div",Z_,[renderSlot(L.$slots,"footer")])):createCommentVNode("",!0),L.arrow?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass$1(["absolute w-2.5 h-2.5 bg-white border-inherit",d.value]),style:normalizeStyle$1(o.value)},null,6)):createCommentVNode("",!0)],36)):createCommentVNode("",!0)]),_:3})]))],32))}}),eC=["aria-checked","data-state","disabled"],tC=defineComponent({__name:"ShadcnToggle",props:{modelValue:{},value:{},disabled:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=inject("toggleGroup",null),r=computed(()=>(s==null?void 0:s.size.value)??t.size),o=computed(()=>(s==null?void 0:s.disabled.value)??t.disabled),a=computed(()=>{var c;return s?((c=s.modelValue.value)==null?void 0:c.includes(t.value))??!1:t.modelValue===t.value}),l=c=>{if(c.preventDefault(),c.stopPropagation(),!o.value)if(s){const d=s.modelValue.value||[];let u;a.value?u=d.filter(f=>f!==t.value):s.multiple.value?u=[...d,t.value]:u=[t.value],s.onChange(u)}else{const d=a.value?null:t.value;i("update:modelValue",d),i("on-change",d)}};return(c,d)=>(openBlock(),createElementBlock("button",{"aria-checked":a.value,"data-state":a.value?"checked":"unchecked",disabled:o.value,class:normalizeClass$1(["inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","px-1 py-1",a.value&&"bg-accent text-accent-foreground",{"cursor-pointer":!o.value,"cursor-not-allowed opacity-50":o.value},...c.$attrs.class?[c.$attrs.class]:[unref(ti)[r.value]]]),onClick:l},[renderSlot(c.$slots,"default")],10,eC))}}),nC=defineComponent({__name:"ShadcnToggleGroup",props:{modelValue:{},disabled:{type:Boolean,default:!1},size:{default:"default"},multiple:{type:Boolean,default:!1},orientation:{default:"horizontal"}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=e,i=n;return provide("toggleGroup",{modelValue:computed(()=>i.modelValue||[]),disabled:computed(()=>i.disabled),size:computed(()=>i.size),multiple:computed(()=>i.multiple),orientation:computed(()=>i.orientation),onChange:s=>{t("update:modelValue",s),t("on-change",s)}}),(s,r)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["flex gap-2",s.orientation==="vertical"?"flex-col items-start":"flex-row items-center"]),role:"group"},[renderSlot(s.$slots,"default",{disabled:s.disabled,size:s.size})],2))}}),oC={class:"w-full h-full flex items-center justify-center"},aC={key:0,class:"text-base"},rC={key:1,class:"space-y-2 w-full"},lC={class:"text-sm"},sC={class:"text-sm"},iC={class:"text-sm whitespace-pre-wrap"},uC={class:"text-sm"},dC={class:"text-sm"},cC={class:"text-sm"},fC={class:"text-sm"},pC={class:"text-sm"},hC={class:"text-sm"},mC={class:"flex items-center space-x-1"},vC={key:2,class:"text-gray-500"},gC={key:3,class:"text-gray-500"},of=defineComponent({__name:"ShadcnDataBuilderRenderer",props:{type:{},configure:{}},setup(n){const e=n,t=(s,r)=>{var o;if(!e.configure)return null;const a=e.configure.find(c=>c.group===s);if(!a)return null;const l=(o=a.items)==null?void 0:o.find(c=>c.label===r);return l==null?void 0:l.value},i=s=>s?"•".repeat(s.length):"";return(s,r)=>{var o;const a=resolveComponent("ShadcnIcon");return openBlock(),createElementBlock("div",oC,[s.type==="text"?(openBlock(),createElementBlock("div",aC,toDisplayString$1(t("Text Group","Text Component")),1)):s.type==="image"?(openBlock(),createElementBlock("div",rC,[createBaseVNode("div",lC,toDisplayString$1(t("Text Group","Text Component")),1),createBaseVNode("div",sC,"Number: "+toDisplayString$1(t("Text Group","Number Component")),1),createBaseVNode("div",iC,toDisplayString$1(t("Text Group","Textarea Component")),1),createBaseVNode("div",uC,"Password: "+toDisplayString$1(i(t("Text Group","Password Component"))),1),createBaseVNode("div",dC," Switch: "+toDisplayString$1(t("Text Group","Switch Component")?"On":"Off"),1),createBaseVNode("div",cC," Selected: "+toDisplayString$1(t("Text Group","Radio Component")),1),createBaseVNode("div",fC," Checked: "+toDisplayString$1((o=t("Text Group","Checkbox Component"))==null?void 0:o.join(", ")),1),createBaseVNode("div",pC," Selected: "+toDisplayString$1(t("Text Group","Select Component")),1),createBaseVNode("div",hC," Value: "+toDisplayString$1(t("Text Group","Slider Component")),1),createBaseVNode("div",mC,[(openBlock(),createElementBlock(Fragment,null,renderList(5,l=>createVNode(a,{key:l,icon:"Star",class:normalizeClass$1(l<=t("Text Group","Rate Component")?"text-yellow-400":"text-gray-300"),size:"16"},null,8,["class"])),64))])])):s.type==="chart"?(openBlock(),createElementBlock("div",vC,"Chart Component")):(openBlock(),createElementBlock("div",gC,"Unknown Component Type"))])}}}),yC={class:"flex-1 relative flex flex-col"},bC={key:0,class:"h-12 border-b border-gray-200 bg-white px-4 flex items-center justify-between shrink-0 select-none"},wC={class:"flex items-center space-x-4"},xC={class:"flex items-center space-x-2"},_C={class:"flex items-center space-x-2"},CC={class:"text-sm"},kC={class:"flex items-center space-x-4"},$C={key:0,class:"absolute left-0 ml-0.5 top-0 w-full flex sticky"},SC={class:"h-5 bg-white border-b border-gray-200 flex-1 relative sticky top-0 z-10"},VC={class:"relative h-full"},EC={class:"relative w-full"},TC={style:{"writing-mode":"vertical-rl","text-orientation":"upright"}},RC={key:0,class:"absolute right-0 top-1/2 transform -translate-y-1/2 h-px w-2 bg-gray-300"},AC=["data-component-id","onMousedown"],MC=["onClick"],NC=["onMousedown"],IC=["onMousedown"],LC=["onMousedown"],OC=["onMousedown"],BC=["onMousedown"],DC=["onMousedown"],PC=["onMousedown"],FC=["onMousedown"],af=defineComponent({__name:"ShadcnDataBuilderCanvas",props:{selectedId:{},showGrid:{type:Boolean,default:!0},snapToGrid:{type:Boolean,default:!0},gridSize:{default:20},showRuler:{type:Boolean,default:!0},width:{default:1920},height:{default:1080},showToolbar:{type:Boolean,default:!0},isCenter:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},canvasStyle:{default:()=>({backgroundColor:"#ffffff",backgroundImage:"",opacity:1})},showGuidelines:{type:Boolean,default:!1}},emits:["update:components","select","update:selectedId"],setup(n,{expose:e,emit:t}){const i=t,s=n,r=ref(null),o=ref(null),a=ref([]),l=ref(1),c=ref(s.showGrid),d=ref(s.snapToGrid),u=ref(s.showRuler),f=ref(s.resize),g=ref({width:s.width,height:s.height}),m=ref(s.gridSize),_=computed({get:()=>s.selectedId,set:Te=>{i("update:selectedId",Te)}}),v=ref(!1),C=ref({x:0,y:0}),S=ref(!1),w=ref(""),L=ref({x:0,y:0}),I=ref({width:0,height:0,x:0,y:0}),N=ref(null),R=ref(s.showGuidelines),T=computed(()=>a.value.find(Te=>Te.id===_.value)),A=computed(()=>{const Te=u.value?20:0;return{width:`${g.value.width+Te}px`,height:`${g.value.height+Te}px`,transform:`scale(${l.value})`,transformOrigin:"0 0"}}),F=computed(()=>{const{backgroundColor:Te,backgroundImage:xe,opacity:ze}=s.canvasStyle||{};return{backgroundColor:Te||"#ffffff",backgroundImage:xe?`url(${xe})`:"none",opacity:ze||1}}),B=computed(()=>{const Te=u.value?20:0;return{display:c.value?"block":"none",backgroundSize:`${m.value}px ${m.value}px`,backgroundImage:"linear-gradient(#f0f0f0 1px, transparent 1px), linear-gradient(90deg, #f0f0f0 1px, transparent 1px)",backgroundPosition:"0 0",left:`${Te}px`,top:`${Te}px`,width:`${g.value.width}px`,height:`${g.value.height}px`,position:"absolute"}});watch(()=>s.gridSize,Te=>{if(m.value=Te,d.value&&a.value.length>0){const xe=a.value.map(ze=>({...ze,x:Math.round(ze.x/Te)*Te,y:Math.round(ze.y/Te)*Te,width:Te*5,height:Te*3}));a.value=xe,i("update:components",xe)}},{immediate:!0});const W=Te=>{const xe=u.value?20:0,ze={left:`${xe+Te.x}px`,top:`${xe+Te.y}px`,width:ke(Te.width),height:ke(Te.height),zIndex:Te.zIndex||1};if(Te.configure){const Qe=Te.configure.find(qe=>qe.key==="style");if(Qe!=null&&Qe.items){const qe=Qe.items.reduce((Le,je)=>{if(je.value!==void 0){const le=je.key||je.label.replace(/(?:^\w|[A-Z]|\b\w)/g,(Ie,$e)=>$e===0?Ie.toLowerCase():Ie.toUpperCase()).replace(/\s+/g,"");let pe=je.value;if(je.formatter&&typeof je.formatter=="function")try{pe=je.formatter(je.value)}catch(Ie){console.error("Formatter function error:",Ie)}Le[le]=pe}return Le},{});return{...ze,...qe}}}return ze},G=Te=>{Te==="in"&&l.value<2?l.value+=.1:Te==="out"&&l.value>.2&&(l.value-=.1)},j=Te=>{Te.deltaY<0?G("in"):G("out")},K=Te=>d.value?{x:Math.round(Te.x/m.value)*m.value,y:Math.round(Te.y/m.value)*m.value}:Te,ee=Te=>{if(!o.value)return{x:0,y:0};const xe=o.value.getBoundingClientRect(),ze=u.value?20:0,Qe=(Te.clientX-xe.left-ze)/l.value,qe=(Te.clientY-xe.top-ze)/l.value;return{x:Math.max(0,Math.min(Qe,g.value.width)),y:Math.max(0,Math.min(qe,g.value.height))}},U=(Te,xe)=>{Te.stopPropagation(),i("select",xe),v.value=!0;const ze=ee(Te);C.value={x:ze.x-xe.x,y:ze.y-xe.y},document.addEventListener("mousemove",q),document.addEventListener("mouseup",Q)},q=Te=>{var xe,ze;if(!v.value)return;const Qe=ee(Te),qe=a.value.find(ye=>ye.id===_.value);if(!qe)return;let Le=Qe.x-(((xe=C.value)==null?void 0:xe.x)||0),je=Qe.y-(((ze=C.value)==null?void 0:ze.y)||0);if(d.value){const ye=K({x:Le,y:je});Le=ye.x,je=ye.y}const le=g.value.width-qe.width,pe=g.value.height-qe.height;Le=Math.max(0,Math.min(le,Le)),je=Math.max(0,Math.min(pe,je));const Ie=u.value?20:0;N.value={x:Le+Ie,y:je+Ie};const $e=a.value.map(ye=>ye.id===_.value?{...ye,x:Le,y:je}:ye);a.value=$e,i("update:components",$e)},Q=()=>{v.value=!1,N.value=null,document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",Q)},ce=Te=>{const xe=Te.dataTransfer.getData("componentType"),ze=Te.dataTransfer.getData("componentLabel"),Qe=Te.dataTransfer.getData("transferId"),qe=JSON.parse(Te.dataTransfer.getData("componentConfigure")||"{}"),Le=Ue=>{if(!window.__componentFunctionsMap||!Qe)return Ue;const He=window.__componentFunctionsMap.get(Qe);return He?Ue.map((Ve,Oe)=>({...Ve,items:Ve.items.map((ot,et)=>{var nt;const lt=(nt=He[Oe])==null?void 0:nt.items[et];return{...ot,formatter:lt==null?void 0:lt.formatter}})})):Ue};if(!xe)return;const je=ee(Te),le=m.value*5,pe=m.value*3,Ie=g.value.width-le,$e=g.value.height-pe,ye=K({x:Math.min(Ie,Math.max(0,je.x)),y:Math.min($e,Math.max(0,je.y))}),Re=[...a.value,{id:Date.now(),type:xe,label:ze,x:ye.x,y:ye.y,width:le,height:pe,zIndex:a.value.length+1,configure:Le(qe)}];window.__componentFunctionsMap&&window.__componentFunctionsMap.delete(Qe),a.value=Re,i("update:components",Re)},ie=Te=>{const xe=Te.target;a.value.some(ze=>!!xe.closest(`[data-component-id="${ze.id}"]`))||(_.value=void 0,i("select",void 0),i("update:selectedId",void 0))},Ce=(Te,xe,ze)=>{Te.preventDefault(),S.value=!0,w.value=ze;const Qe=ee(Te);L.value={x:Qe.x,y:Qe.y},I.value={width:xe.width,height:xe.height,x:xe.x,y:xe.y},document.addEventListener("mousemove",ae),document.addEventListener("mouseup",be)},ae=Te=>{if(!S.value)return;const xe=ee(Te),ze=xe.x-L.value.x,Qe=xe.y-L.value.y;if(!a.value.find(Ie=>Ie.id===_.value))return;let qe=I.value.width,Le=I.value.height,je=I.value.x,le=I.value.y;switch(w.value){case"e":qe=Math.max(m.value,I.value.width+ze);break;case"w":qe=Math.max(m.value,I.value.width-ze),je=I.value.x+ze;break;case"s":Le=Math.max(m.value,I.value.height+Qe);break;case"n":Le=Math.max(m.value,I.value.height-Qe),le=I.value.y+Qe;break;case"se":qe=Math.max(m.value,I.value.width+ze),Le=Math.max(m.value,I.value.height+Qe);break;case"sw":qe=Math.max(m.value,I.value.width-ze),Le=Math.max(m.value,I.value.height+Qe),je=I.value.x+ze;break;case"ne":qe=Math.max(m.value,I.value.width+ze),Le=Math.max(m.value,I.value.height-Qe),le=I.value.y+Qe;break;case"nw":qe=Math.max(m.value,I.value.width-ze),Le=Math.max(m.value,I.value.height-Qe),je=I.value.x+ze,le=I.value.y+Qe;break}d.value&&(qe=Math.round(qe/m.value)*m.value,Le=Math.round(Le/m.value)*m.value,je=Math.round(je/m.value)*m.value,le=Math.round(le/m.value)*m.value),qe=Math.min(qe,g.value.width-je),Le=Math.min(Le,g.value.height-le),je=Math.max(0,Math.min(je,g.value.width-qe)),le=Math.max(0,Math.min(le,g.value.height-Le));const pe=a.value.map(Ie=>Ie.id===_.value?{...Ie,width:qe,height:Le,x:je,y:le}:Ie);a.value=pe,i("update:components",pe)},be=()=>{S.value=!1,document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",be)},De=Te=>{const xe=a.value.filter(ze=>ze.id!==Te.id);a.value=xe,_.value===Te.id&&(_.value=void 0,i("select",void 0)),i("update:components",xe)};return onMounted(()=>{if(r.value&&o.value){const Te=r.value;if(s.isCenter){const xe=o.value;Te.scrollLeft=(xe.offsetWidth*l.value-Te.offsetWidth)/2,Te.scrollTop=(xe.offsetHeight*l.value-Te.offsetHeight)/2}else Te.scrollLeft=0,Te.scrollTop=0}}),onUnmounted(()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",Q),document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",be),window.__componentFunctionsMap&&window.__componentFunctionsMap.clear()}),e({updateComponent:Te=>{const xe=a.value.findIndex(ze=>ze.id===Te.id);if(xe>-1){const ze=[...a.value];ze[xe]=Te,a.value=ze,i("update:components",ze)}}}),(Te,xe)=>{const ze=resolveComponent("ShadcnNumber"),Qe=resolveComponent("ShadcnIcon"),qe=resolveComponent("ShadcnCheckbox");return openBlock(),createElementBlock("div",yC,[Te.showToolbar?(openBlock(),createElementBlock("div",bC,[createBaseVNode("div",wC,[createBaseVNode("div",xC,[createVNode(ze,{modelValue:g.value.width,"onUpdate:modelValue":xe[0]||(xe[0]=Le=>g.value.width=Le),class:"w-32",placeholder:unref(P)("dataBuilder.placeholder.width")},null,8,["modelValue","placeholder"]),xe[11]||(xe[11]=createBaseVNode("span",{class:"text-gray-400"},"x",-1)),createVNode(ze,{modelValue:g.value.height,"onUpdate:modelValue":xe[1]||(xe[1]=Le=>g.value.height=Le),class:"w-32",placeholder:unref(P)("dataBuilder.placeholder.height")},null,8,["modelValue","placeholder"])]),createBaseVNode("div",_C,[createBaseVNode("div",{class:"p-1 hover:bg-gray-100 cursor-pointer rounded-full",onClick:xe[2]||(xe[2]=Le=>G("out"))},[createVNode(Qe,{icon:"Minus",class:"h-4 w-4"})]),createBaseVNode("span",CC,toDisplayString$1(Math.round(l.value*100))+"%",1),createBaseVNode("div",{class:"p-1 hover:bg-gray-100 cursor-pointer rounded-full",onClick:xe[3]||(xe[3]=Le=>G("in"))},[createVNode(Qe,{icon:"Plus",class:"h-4 w-4"})])])]),createBaseVNode("div",kC,[createVNode(qe,{modelValue:c.value,"onUpdate:modelValue":xe[4]||(xe[4]=Le=>c.value=Le),value:!0},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataBuilder.text.showGrid")),1)]),_:1},8,["modelValue"]),createVNode(qe,{modelValue:d.value,"onUpdate:modelValue":xe[5]||(xe[5]=Le=>d.value=Le),value:!0},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataBuilder.text.snapToGrid")),1)]),_:1},8,["modelValue"]),createVNode(qe,{modelValue:u.value,"onUpdate:modelValue":xe[6]||(xe[6]=Le=>u.value=Le),value:!0},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataBuilder.text.showRuler")),1)]),_:1},8,["modelValue"]),createVNode(qe,{modelValue:f.value,"onUpdate:modelValue":xe[7]||(xe[7]=Le=>f.value=Le),value:!0},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataBuilder.text.dragResize")),1)]),_:1},8,["modelValue"]),createVNode(qe,{modelValue:R.value,"onUpdate:modelValue":xe[8]||(xe[8]=Le=>R.value=Le),value:!0},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataBuilder.text.showGuidelines")),1)]),_:1},8,["modelValue"])])])):createCommentVNode("",!0),createBaseVNode("div",{ref_key:"containerRef",ref:r,class:"flex-1 overflow-auto bg-gray-50 relative",onWheel:withModifiers(j,["ctrl","prevent"])},[createBaseVNode("div",{ref_key:"canvasRef",ref:o,class:normalizeClass$1(["absolute bg-white shadow-md",{"border border-gray-200":c.value}]),style:normalizeStyle$1([A.value,F.value]),onDragover:xe[10]||(xe[10]=withModifiers(()=>{},["prevent"])),onDrop:ce,onClick:ie},[createBaseVNode("div",{class:"absolute inset-0",style:normalizeStyle$1(B.value)},null,4),u.value?(openBlock(),createElementBlock("div",$C,[xe[13]||(xe[13]=createBaseVNode("div",{class:"w-5 h-5 bg-white border-gray-200 z-10 sticky left-0 top-0"},null,-1)),createBaseVNode("div",SC,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Math.ceil(g.value.width/100)+(g.value.width%100===0?1:0),Le=>(openBlock(),createElementBlock("div",{class:"absolute h-full",key:Le,style:normalizeStyle$1({left:`${(Le-1)*100}px`})},[createBaseVNode("div",VC,[createBaseVNode("span",{class:normalizeClass$1(["absolute text-xs text-gray-400 bottom-0.5",[Le===Math.ceil(g.value.width/100)+(g.value.width%100===0?1:0)?"right-1 translate-x-0":"left-1/2 -translate-x-1/2"]])},toDisplayString$1((Le-1)*100),3),xe[12]||(xe[12]=createBaseVNode("div",{class:"absolute bottom-0 w-px h-2 bg-gray-300 right-0.5"},null,-1))])],4))),128))])])):createCommentVNode("",!0),u.value?(openBlock(),createElementBlock("div",{key:1,class:"absolute left-0 top-5 w-5 bg-white border-r border-gray-200 sticky",style:normalizeStyle$1({height:unref(ke)(g.value.height)})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Math.ceil(g.value.height/100)+(g.value.height%100===0?1:0),Le=>(openBlock(),createElementBlock("div",{class:"absolute w-full",key:Le,style:normalizeStyle$1({top:`${(Le-1)*100}px`})},[createBaseVNode("div",EC,[createBaseVNode("div",{class:normalizeClass$1(["absolute text-xs text-gray-400 left-0.5 transform",[Le===Math.ceil(g.value.height/100)+(g.value.height%100===0?1:0)?"bottom-0 translate-y-0":"top-1/2 -translate-y-1/2"]])},[createBaseVNode("span",TC,toDisplayString$1((Le-1)*100),1)],2),Le!==1?(openBlock(),createElementBlock("div",RC)):createCommentVNode("",!0)])],4))),128))],4)):createCommentVNode("",!0),v.value&&R.value?(openBlock(),createElementBlock(Fragment,{key:2},[N.value?(openBlock(),createElementBlock("div",{key:0,class:"absolute top-0 w-px bg-blue-500 pointer-events-none",style:normalizeStyle$1({left:`${N.value.x}px`,height:`${s.height}px`,opacity:.5,zIndex:1e3})},null,4)):createCommentVNode("",!0),N.value&&T.value?(openBlock(),createElementBlock("div",{key:1,class:"absolute top-0 w-px bg-blue-500 pointer-events-none",style:normalizeStyle$1({left:`${N.value.x+T.value.width}px`,height:`${s.height}px`,opacity:.5,zIndex:1e3})},null,4)):createCommentVNode("",!0),N.value?(openBlock(),createElementBlock("div",{key:2,class:"absolute left-0 h-px bg-blue-500 pointer-events-none",style:normalizeStyle$1({top:`${N.value.y}px`,width:"100%",opacity:.5,zIndex:1e3})},null,4)):createCommentVNode("",!0),N.value&&T.value?(openBlock(),createElementBlock("div",{key:3,class:"absolute left-0 h-px bg-blue-500 pointer-events-none",style:normalizeStyle$1({top:`${N.value.y+T.value.height}px`,width:"100%",opacity:.5,zIndex:1e3})},null,4)):createCommentVNode("",!0)],64)):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(a.value,Le=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["absolute bg-white border-2 flex items-center justify-center select-none group",[_.value===Le.id?"border-blue-500 shadow-lg":"border-gray-200 hover:border-gray-300",v.value?"cursor-move":"cursor-default"]]),key:Le.id,"data-component-id":Le.id,style:normalizeStyle$1(W(Le)),onMousedown:je=>U(je,Le)},[renderSlot(Te.$slots,Le.type,{component:Le,configure:Le.configure,isSelected:_.value===Le.id},()=>[createVNode(of,{type:Le.type,configure:Le.configure},null,8,["type","configure"])]),_.value===Le.id?(openBlock(),createElementBlock("div",{key:0,class:"absolute -top-6 -right-4 w-5 h-5 bg-red-500 rounded-full flex items-center justify-center cursor-pointer hover:bg-red-600 shadow-sm z-10",onMousedown:xe[9]||(xe[9]=withModifiers(()=>{},["stop"])),onClick:withModifiers(je=>De(Le),["stop"])},[createVNode(Qe,{icon:"X",class:"text-white",size:"15"})],40,MC)):createCommentVNode("",!0),f.value&&_.value===Le.id?(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-nw-resize -top-1 -left-1",onMousedown:withModifiers(je=>Ce(je,Le,"nw"),["stop"])},null,40,NC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-ne-resize -top-1 -right-1",onMousedown:withModifiers(je=>Ce(je,Le,"ne"),["stop"])},null,40,IC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-sw-resize -bottom-1 -left-1",onMousedown:withModifiers(je=>Ce(je,Le,"sw"),["stop"])},null,40,LC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-se-resize -bottom-1 -right-1",onMousedown:withModifiers(je=>Ce(je,Le,"se"),["stop"])},null,40,OC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-n-resize -top-1 left-1/2 -translate-x-1/2",onMousedown:withModifiers(je=>Ce(je,Le,"n"),["stop"])},null,40,BC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-s-resize -bottom-1 left-1/2 -translate-x-1/2",onMousedown:withModifiers(je=>Ce(je,Le,"s"),["stop"])},null,40,DC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-w-resize -left-1 top-1/2 -translate-y-1/2",onMousedown:withModifiers(je=>Ce(je,Le,"w"),["stop"])},null,40,PC),createBaseVNode("div",{class:"absolute w-2 h-2 bg-white border-2 border-blue-500 rounded-sm cursor-e-resize -right-1 top-1/2 -translate-y-1/2",onMousedown:withModifiers(je=>Ce(je,Le,"e"),["stop"])},null,40,FC)],64)):createCommentVNode("",!0)],46,AC))),128))],38)],544)])}}}),UC={class:"text-lg font-medium mb-4"},zC={class:"space-y-2 px-5 py-2"},WC=["onDragstart"],rf=defineComponent({__name:"ShadcnDataBuilderPanel",props:{width:{default:200},items:{default:()=>[]}},setup(n){const e=(t,i)=>{t.dataTransfer.setData("componentType",i.type),t.dataTransfer.setData("componentLabel",i.label);const s=`transfer_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;t.dataTransfer.setData("transferId",s);const r=o=>o.map(a=>({...a,items:a.items.map(l=>({...l,formatter:l.formatter}))}));if(i.configure){const o=r(i.configure);t.dataTransfer.setData("componentConfigure",JSON.stringify(i.configure)),window.__componentFunctionsMap||(window.__componentFunctionsMap=new Map),window.__componentFunctionsMap.set(s,o)}};return(t,i)=>{const s=resolveComponent("ShadcnCard");return openBlock(),createElementBlock("div",{class:"bg-white border-r border-gray-200",style:normalizeStyle$1({width:unref(ke)(t.width)})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.items,r=>(openBlock(),createElementBlock("div",UC,[createVNode(s,{class:"rounded-none",border:!1,title:r.group},{default:withCtx(()=>[createBaseVNode("div",zC,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.children,o=>(openBlock(),createElementBlock("div",{class:"p-3 bg-gray-50 border border-gray-200 rounded cursor-move text-center hover:bg-gray-100 transition-colors",draggable:"true",key:o.type,onDragstart:a=>e(a,o)},[renderSlot(t.$slots,"label",{item:o},()=>[createTextVNode(toDisplayString$1(o.label),1)])],40,WC))),128))])]),_:2},1032,["title"])]))),256))],4)}}}),HC={class:"text-sm font-medium mb-2"},GC={key:1},qC={class:"flex items-center space-x-2"},jC={class:"flex items-center space-x-2"},YC={class:"text-xs text-right"},lf=defineComponent({__name:"ShadcnDataBuilderConfigure",props:{width:{default:200},selectedComponent:{default:void 0},canvasWidth:{default:1920},canvasHeight:{default:1080},canvasStyle:{default:{backgroundColor:"#ffffff",backgroundImage:"",opacity:1}},gridSize:{default:20},snapToGrid:{type:Boolean,default:!0}},emits:["update"],setup(n,{emit:e}){var t,i,s;const r=e,o=n,a=ref({x:0,y:0,width:0,height:0}),l=computed(()=>o.gridSize),c=computed(()=>o.gridSize),d=computed(()=>o.canvasWidth),u=computed(()=>o.canvasHeight),f=computed(()=>o.canvasWidth-a.value.width),g=computed(()=>o.canvasHeight-a.value.height),m=ref({backgroundColor:((t=o.canvasStyle)==null?void 0:t.backgroundColor)||"#ffffff",backgroundImage:((i=o.canvasStyle)==null?void 0:i.backgroundImage)||"",opacity:((s=o.canvasStyle)==null?void 0:s.opacity)??1});watch(()=>o.selectedComponent,L=>{L&&(a.value={x:L.x,y:L.y,width:L.width,height:L.height})},{deep:!0});const _=(L,I,N)=>Math.min(Math.max(parseInt(L)||0,I),N),v=(L,I,N)=>Math.min(Math.max(parseInt(L)||I,I),N),C=()=>{if(!o.selectedComponent)return;const L={...a.value,x:_(a.value.x,0,f.value),y:_(a.value.y,0,g.value)};a.value=L,r("update",{...o.selectedComponent,...L})},S=()=>{if(!o.selectedComponent)return;const L={...a.value,width:v(a.value.width,l.value,d.value),height:v(a.value.height,c.value,u.value)};L.x+L.width>o.canvasWidth&&(L.x=o.canvasWidth-L.width),L.y+L.height>o.canvasHeight&&(L.y=o.canvasHeight-L.height),a.value=L,r("update",{...o.selectedComponent,...L})},w=()=>{r("update",{type:"canvas-style",data:{...m.value}})};return(L,I)=>{const N=resolveComponent("ShadcnNumber"),R=resolveComponent("ShadcnFormItem"),T=resolveComponent("ShadcnCol"),A=resolveComponent("ShadcnRow"),F=resolveComponent("ShadcnTabItem"),B=resolveComponent("ShadcnInput"),W=resolveComponent("ShadcnSwitch"),G=resolveComponent("ShadcnRadio"),j=resolveComponent("ShadcnRadioGroup"),K=resolveComponent("ShadcnCheckbox"),ee=resolveComponent("ShadcnCheckboxGroup"),U=resolveComponent("ShadcnSelectOption"),q=resolveComponent("ShadcnSelect"),Q=resolveComponent("ShadcnSlider"),ce=resolveComponent("ShadcnRate"),ie=resolveComponent("ShadcnTab");return openBlock(),createElementBlock("div",{class:"bg-white border-l border-gray-200 py-4 pl-4 select-none",style:normalizeStyle$1({width:unref(ke)(L.width)})},[createBaseVNode("div",HC,toDisplayString$1(unref(P)("dataBuilder.text.configureCenter")),1),createVNode(ie,{direction:"vertical",position:"right"},{default:withCtx(()=>[L.selectedComponent?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(F,{label:unref(P)("dataBuilder.text.basicConfigure"),value:"basic_configure"},{default:withCtx(()=>[createVNode(A,{gutter:10},{default:withCtx(()=>[createVNode(T,{span:"6",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.xCoordinate"),name:"x"},{default:withCtx(()=>[createVNode(N,{modelValue:a.value.x,"onUpdate:modelValue":I[0]||(I[0]=Ce=>a.value.x=Ce),min:0,max:f.value,onOnChange:C},null,8,["modelValue","max"])]),_:1},8,["label"])]),_:1}),createVNode(T,{span:"6",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.yCoordinate"),name:"y"},{default:withCtx(()=>[createVNode(N,{modelValue:a.value.y,"onUpdate:modelValue":I[1]||(I[1]=Ce=>a.value.y=Ce),min:0,max:g.value,onOnChange:C},null,8,["modelValue","max"])]),_:1},8,["label"])]),_:1}),createVNode(T,{span:"6",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.width"),name:"width"},{default:withCtx(()=>[createVNode(N,{modelValue:a.value.width,"onUpdate:modelValue":I[2]||(I[2]=Ce=>a.value.width=Ce),min:l.value,max:d.value,onOnChange:S},null,8,["modelValue","min","max"])]),_:1},8,["label"])]),_:1}),createVNode(T,{span:"6",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.height"),name:"height"},{default:withCtx(()=>[createVNode(N,{modelValue:a.value.height,"onUpdate:modelValue":I[3]||(I[3]=Ce=>a.value.height=Ce),min:c.value,max:u.value,onOnChange:S},null,8,["modelValue","min","max"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["label"]),L.selectedComponent.configure?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(L.selectedComponent.configure,Ce=>(openBlock(),createBlock$1(F,{key:Ce.group,label:Ce.group,value:`${Ce.group}_configure`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Ce.items,ae=>(openBlock(),createBlock$1(R,{class:"my-4",key:ae.label,name:ae.label,description:ae.description,label:ae.label},{default:withCtx(()=>[ae.type==="number"?(openBlock(),createBlock$1(N,{key:0,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,name:ae.label,placeholder:ae.placeholder,max:ae.max,clearable:ae.clearable,min:ae.min,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","name","placeholder","max","clearable","min"])):ae.type==="textarea"?(openBlock(),createBlock$1(B,{key:1,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,type:"textarea",disabled:ae.disabled,"word-count":ae.wordCount,"max-count":ae.maxCount,placeholder:ae.placeholder,name:ae.label,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","word-count","max-count","placeholder","name"])):ae.type==="password"?(openBlock(),createBlock$1(B,{key:2,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,type:"password",disabled:ae.disabled,placeholder:ae.placeholder,name:ae.label,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder","name"])):ae.type==="switch"?(openBlock(),createBlock$1(W,{key:3,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,"true-value":ae.trueValue,"false-value":ae.falseValue,name:ae.label,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","true-value","false-value","name"])):ae.type==="radio"?(openBlock(),createBlock$1(j,{key:4,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,onOnChange:C},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(ae.options,be=>(openBlock(),createBlock$1(G,{key:be,value:be.value,disabled:be.disabled},{default:withCtx(()=>[createTextVNode(toDisplayString$1(be.label),1)]),_:2},1032,["value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):ae.type==="checkbox"?(openBlock(),createBlock$1(ee,{key:5,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,onOnChange:C},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(ae.options,be=>(openBlock(),createBlock$1(K,{key:be,value:be.value,disabled:be.disabled},{default:withCtx(()=>[createTextVNode(toDisplayString$1(be.label),1)]),_:2},1032,["value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):ae.type==="select"?(openBlock(),createBlock$1(q,{key:6,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,placeholder:ae.placeholder,name:ae.label,onOnChange:C},{options:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(ae.options,be=>(openBlock(),createBlock$1(U,{key:be.value,disabled:be.disabled,label:be.label,value:be.value},null,8,["disabled","label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","placeholder","name"])):ae.type==="slider"?(openBlock(),createBlock$1(Q,{key:7,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,max:ae.max,min:ae.min,"show-step":ae.showStep,"show-tip":ae.showTip,step:ae.step,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","max","min","show-step","show-tip","step"])):ae.type==="rate"?(openBlock(),createBlock$1(ce,{key:8,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,max:ae.max,min:ae.min,"allow-half":ae.allowHalf,"show-text":ae.showText,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","max","min","allow-half","show-text"])):(openBlock(),createBlock$1(B,{key:9,modelValue:ae.value,"onUpdate:modelValue":be=>ae.value=be,disabled:ae.disabled,placeholder:ae.placeholder,name:ae.label,onOnChange:C},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder","name"]))]),_:2},1032,["name","description","label"]))),128))]),_:2},1032,["label","value"]))),128)):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",GC,[createVNode(F,{label:unref(P)("dataBuilder.text.basicConfigure"),value:"basic_configure"},{default:withCtx(()=>[createVNode(A,{gutter:10},{default:withCtx(()=>[createVNode(T,{span:"12",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.backgroundColor"),name:"backgroundColor"},{default:withCtx(()=>[createBaseVNode("div",qC,[withDirectives(createBaseVNode("input",{type:"color",class:"p-0 border border-gray-200 rounded cursor-pointer","onUpdate:modelValue":I[4]||(I[4]=Ce=>m.value.backgroundColor=Ce),onChange:w},null,544),[[vModelText,m.value.backgroundColor]]),createVNode(B,{modelValue:m.value.backgroundColor,"onUpdate:modelValue":I[5]||(I[5]=Ce=>m.value.backgroundColor=Ce),size:"small",onOnChange:w},null,8,["modelValue"])])]),_:1},8,["label"])]),_:1}),createVNode(T,{span:"12",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.backgroundImage"),name:"backgroundImage"},{default:withCtx(()=>[createVNode(B,{modelValue:m.value.backgroundImage,"onUpdate:modelValue":I[6]||(I[6]=Ce=>m.value.backgroundImage=Ce),placeholder:unref(P)("dataBuilder.placeholder.backgroundImage"),onOnChange:w},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1}),createVNode(T,{span:"12",class:"my-2"},{default:withCtx(()=>[createVNode(R,{label:unref(P)("dataBuilder.text.opacity"),name:"opacity"},{default:withCtx(()=>[createBaseVNode("div",jC,[createVNode(Q,{modelValue:m.value.opacity,"onUpdate:modelValue":I[7]||(I[7]=Ce=>m.value.opacity=Ce),class:"mr-1",min:"0",max:"1",step:"0.1",onOnChange:w},null,8,["modelValue"]),createBaseVNode("div",YC,toDisplayString$1(Math.round(m.value.opacity*100))+"%",1)])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["label"])]))]),_:1})],4)}}}),KC={class:"flex w-full h-full"},JC=defineComponent({__name:"ShadcnDataBuilderEditor",props:{panelWidth:{default:200},configWidth:{default:200},items:{default:()=>[]},showGrid:{type:Boolean,default:!0},snapToGrid:{type:Boolean,default:!0},gridSize:{default:20},showRuler:{type:Boolean,default:!0},width:{default:1920},height:{default:1080},showToolbar:{type:Boolean,default:!0},isCenter:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},canvasStyle:{default:()=>({})},showGuidelines:{type:Boolean,default:!1}},emits:["update-config"],setup(n,{emit:e}){const t=e,i=n,s=ref([]),r=ref(void 0),o=ref(),a=ref(i.canvasStyle),l=computed(()=>s.value.find(g=>g.id===r.value)),c=g=>{g&&(r.value=g.id)},d=g=>{var m;const _={items:s.value,canvasStyle:{}};"data"in g?(a.value=g.data,_.canvasStyle=g.data):(m=o.value)==null||m.updateComponent(g),t("update-config",_)},u=()=>f(),f=()=>{t("update-config",{width:i.width,height:i.height,items:s.value,canvasStyle:a.value})};return watch(a,()=>{f()},{deep:!0}),watch(s,()=>{f()},{immediate:!0}),(g,m)=>(openBlock(),createElementBlock("div",KC,[createVNode(rf,{width:g.panelWidth,items:g.items},{label:withCtx(_=>[renderSlot(g.$slots,"panel-label",normalizeProps(guardReactiveProps(_)))]),_:3},8,["width","items"]),createVNode(af,{components:s.value,"onUpdate:components":[m[0]||(m[0]=_=>s.value=_),u],ref_key:"contentRef",ref:o,"selected-id":r.value,"show-grid":g.showGrid,"snap-to-grid":g.snapToGrid,"grid-size":g.gridSize,"show-ruler":g.showRuler,width:g.width,height:g.height,"show-toolbar":g.showToolbar,"is-center":g.isCenter,resize:g.resize,"canvas-style":a.value,"show-guidelines":g.showGuidelines,onSelect:c,"onUpdate:selectedId":m[1]||(m[1]=_=>r.value=_)},createSlots({_:2},[renderList(g.$slots,(_,v)=>({name:v,fn:withCtx(C=>[renderSlot(g.$slots,v,normalizeProps(guardReactiveProps(C)))])}))]),1032,["components","selected-id","show-grid","snap-to-grid","grid-size","show-ruler","width","height","show-toolbar","is-center","resize","canvas-style","show-guidelines"]),createVNode(lf,{"selected-component":l.value,"canvas-width":g.width,"canvas-height":g.height,"grid-size":g.gridSize,"canvas-style":a.value,width:g.configWidth,"snap-to-grid":g.snapToGrid,onUpdate:d},null,8,["selected-component","canvas-width","canvas-height","grid-size","canvas-style","width","snap-to-grid"])]))}}),XC=defineComponent({__name:"ShadcnDataBuilderView",props:{width:{default:1920},height:{default:1080},canvasStyle:{default:()=>({})},items:{default:()=>[]}},setup(n){const e=n,t=computed(()=>{const{backgroundColor:s,backgroundImage:r,opacity:o}=e.canvasStyle||{};return{width:ke(e.width),height:ke(e.height),backgroundColor:s||"#ffffff",backgroundImage:r?`url(${r})`:"none",opacity:o??1}}),i=s=>{const r={left:ke(s.x),top:ke(s.y),width:ke(s.width),height:ke(s.height),zIndex:s.zIndex||1};if(s.configure){const o=s.configure.find(a=>a.key==="style");if(o!=null&&o.items){const a=o.items.reduce((l,c)=>{if(c.value!==void 0){const d=c.key||c.label.replace(/(?:^\w|[A-Z]|\b\w)/g,(f,g)=>g===0?f.toLowerCase():f.toUpperCase()).replace(/\s+/g,"");let u=c.value;if(c.formatter&&typeof c.formatter=="function")try{u=c.formatter(c.value)}catch(f){console.error("Formatter function error:",f)}l[d]=u}return l},{});return{...r,...a}}}return r};return(s,r)=>(openBlock(),createElementBlock("div",{class:"relative bg-white shadow-md",style:normalizeStyle$1(t.value)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(s.items,o=>(openBlock(),createElementBlock("div",{class:"absolute bg-white border-2 border-gray-200 flex items-center justify-center",key:o.id,style:normalizeStyle$1(i(o))},[renderSlot(s.$slots,o.type,{component:o,configure:o.configure},()=>[createVNode(of,{type:o.type,configure:o.configure},null,8,["type","configure"])])],4))),128))],4))}});function sf(n,e){return function(){return n.apply(e,arguments)}}const{toString:ZC}=Object.prototype,{getPrototypeOf:ri}=Object,Fr=(n=>e=>{const t=ZC.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),bn=n=>(n=n.toLowerCase(),e=>Fr(e)===n),Ur=n=>e=>typeof e===n,{isArray:jo}=Array,_a=Ur("undefined");function QC(n){return n!==null&&!_a(n)&&n.constructor!==null&&!_a(n.constructor)&&Zt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const uf=bn("ArrayBuffer");function ek(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&uf(n.buffer),e}const tk=Ur("string"),Zt=Ur("function"),df=Ur("number"),zr=n=>n!==null&&typeof n=="object",nk=n=>n===!0||n===!1,kr=n=>{if(Fr(n)!=="object")return!1;const e=ri(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ok=bn("Date"),ak=bn("File"),rk=bn("Blob"),lk=bn("FileList"),sk=n=>zr(n)&&Zt(n.pipe),ik=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Zt(n.append)&&((e=Fr(n))==="formdata"||e==="object"&&Zt(n.toString)&&n.toString()==="[object FormData]"))},uk=bn("URLSearchParams"),[dk,ck,fk,pk]=["ReadableStream","Request","Response","Headers"].map(bn),hk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sa(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let i,s;if(typeof n!="object"&&(n=[n]),jo(n))for(i=0,s=n.length;i0;)if(s=t[i],e===s.toLowerCase())return s;return null}const co=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ff=n=>!_a(n)&&n!==co;function Ps(){const{caseless:n}=ff(this)&&this||{},e={},t=(i,s)=>{const r=n&&cf(e,s)||s;kr(e[r])&&kr(i)?e[r]=Ps(e[r],i):kr(i)?e[r]=Ps({},i):jo(i)?e[r]=i.slice():e[r]=i};for(let i=0,s=arguments.length;i(Sa(e,(s,r)=>{t&&Zt(s)?n[r]=sf(s,t):n[r]=s},{allOwnKeys:i}),n),vk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),gk=(n,e,t,i)=>{n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},yk=(n,e,t,i)=>{let s,r,o;const a={};if(e=e||{},n==null)return e;do{for(s=Object.getOwnPropertyNames(n),r=s.length;r-- >0;)o=s[r],(!i||i(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&ri(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},bk=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const i=n.indexOf(e,t);return i!==-1&&i===t},wk=n=>{if(!n)return null;if(jo(n))return n;let e=n.length;if(!df(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},xk=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&ri(Uint8Array)),_k=(n,e)=>{const t=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=t.next())&&!i.done;){const s=i.value;e.call(n,s[0],s[1])}},Ck=(n,e)=>{let t;const i=[];for(;(t=n.exec(e))!==null;)i.push(t);return i},kk=bn("HTMLFormElement"),$k=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),Qd=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),Sk=bn("RegExp"),pf=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),i={};Sa(t,(s,r)=>{let o;(o=e(s,r,n))!==!1&&(i[r]=o||s)}),Object.defineProperties(n,i)},Vk=n=>{pf(n,(e,t)=>{if(Zt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=n[t];if(Zt(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Ek=(n,e)=>{const t={},i=s=>{s.forEach(r=>{t[r]=!0})};return jo(n)?i(n):i(String(n).split(e)),t},Tk=()=>{},Rk=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,_s="abcdefghijklmnopqrstuvwxyz",ec="0123456789",hf={DIGIT:ec,ALPHA:_s,ALPHA_DIGIT:_s+_s.toUpperCase()+ec},Ak=(n=16,e=hf.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;n--;)t+=e[Math.random()*i|0];return t};function Mk(n){return!!(n&&Zt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Nk=n=>{const e=new Array(10),t=(i,s)=>{if(zr(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[s]=i;const r=jo(i)?[]:{};return Sa(i,(o,a)=>{const l=t(o,s+1);!_a(l)&&(r[a]=l)}),e[s]=void 0,r}}return i};return t(n,0)},Ik=bn("AsyncFunction"),Lk=n=>n&&(zr(n)||Zt(n))&&Zt(n.then)&&Zt(n.catch),mf=((n,e)=>n?setImmediate:e?((t,i)=>(co.addEventListener("message",({source:s,data:r})=>{s===co&&r===t&&i.length&&i.shift()()},!1),s=>{i.push(s),co.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Zt(co.postMessage)),Ok=typeof queueMicrotask<"u"?queueMicrotask.bind(co):typeof process<"u"&&process.nextTick||mf,ue={isArray:jo,isArrayBuffer:uf,isBuffer:QC,isFormData:ik,isArrayBufferView:ek,isString:tk,isNumber:df,isBoolean:nk,isObject:zr,isPlainObject:kr,isReadableStream:dk,isRequest:ck,isResponse:fk,isHeaders:pk,isUndefined:_a,isDate:ok,isFile:ak,isBlob:rk,isRegExp:Sk,isFunction:Zt,isStream:sk,isURLSearchParams:uk,isTypedArray:xk,isFileList:lk,forEach:Sa,merge:Ps,extend:mk,trim:hk,stripBOM:vk,inherits:gk,toFlatObject:yk,kindOf:Fr,kindOfTest:bn,endsWith:bk,toArray:wk,forEachEntry:_k,matchAll:Ck,isHTMLForm:kk,hasOwnProperty:Qd,hasOwnProp:Qd,reduceDescriptors:pf,freezeMethods:Vk,toObjectSet:Ek,toCamelCase:$k,noop:Tk,toFiniteNumber:Rk,findKey:cf,global:co,isContextDefined:ff,ALPHABET:hf,generateString:Ak,isSpecCompliantForm:Mk,toJSONObject:Nk,isAsyncFn:Ik,isThenable:Lk,setImmediate:mf,asap:Ok};function We(n,e,t,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}ue.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ue.toJSONObject(this.config),code:this.code,status:this.status}}});const vf=We.prototype,gf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{gf[n]={value:n}});Object.defineProperties(We,gf);Object.defineProperty(vf,"isAxiosError",{value:!0});We.from=(n,e,t,i,s,r)=>{const o=Object.create(vf);return ue.toFlatObject(n,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),We.call(o,n.message,e,t,i,s),o.cause=n,o.name=n.name,r&&Object.assign(o,r),o};const Bk=null;function Fs(n){return ue.isPlainObject(n)||ue.isArray(n)}function yf(n){return ue.endsWith(n,"[]")?n.slice(0,-2):n}function tc(n,e,t){return n?n.concat(e).map(function(i,s){return i=yf(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function Dk(n){return ue.isArray(n)&&!n.some(Fs)}const Pk=ue.toFlatObject(ue,{},null,function(n){return/^is[A-Z]/.test(n)});function Wr(n,e,t){if(!ue.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=ue.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!ue.isUndefined(m[g])});const i=t.metaTokens,s=t.visitor||c,r=t.dots,o=t.indexes,a=(t.Blob||typeof Blob<"u"&&Blob)&&ue.isSpecCompliantForm(e);if(!ue.isFunction(s))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(ue.isDate(g))return g.toISOString();if(!a&&ue.isBlob(g))throw new We("Blob is not supported. Use a Buffer instead.");return ue.isArrayBuffer(g)||ue.isTypedArray(g)?a&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function c(g,m,_){let v=g;if(g&&!_&&typeof g=="object"){if(ue.endsWith(m,"{}"))m=i?m:m.slice(0,-2),g=JSON.stringify(g);else if(ue.isArray(g)&&Dk(g)||(ue.isFileList(g)||ue.endsWith(m,"[]"))&&(v=ue.toArray(g)))return m=yf(m),v.forEach(function(C,S){!(ue.isUndefined(C)||C===null)&&e.append(o===!0?tc([m],S,r):o===null?m:m+"[]",l(C))}),!1}return Fs(g)?!0:(e.append(tc(_,m,r),l(g)),!1)}const d=[],u=Object.assign(Pk,{defaultVisitor:c,convertValue:l,isVisitable:Fs});function f(g,m){if(!ue.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(g),ue.forEach(g,function(_,v){(!(ue.isUndefined(_)||_===null)&&s.call(e,_,ue.isString(v)?v.trim():v,m,u))===!0&&f(_,m?m.concat(v):[v])}),d.pop()}}if(!ue.isObject(n))throw new TypeError("data must be an object");return f(n),e}function nc(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function li(n,e){this._pairs=[],n&&Wr(n,this,e)}const bf=li.prototype;bf.append=function(n,e){this._pairs.push([n,e])};bf.toString=function(n){const e=n?function(t){return n.call(this,t,nc)}:nc;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};function Fk(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wf(n,e,t){if(!e)return n;const i=t&&t.encode||Fk;ue.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let r;if(s?r=s(e,t):r=ue.isURLSearchParams(e)?e.toString():new li(e,t).toString(i),r){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class oc{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ue.forEach(this.handlers,function(t){t!==null&&e(t)})}}const xf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uk=typeof URLSearchParams<"u"?URLSearchParams:li,zk=typeof FormData<"u"?FormData:null,Wk=typeof Blob<"u"?Blob:null,Hk={isBrowser:!0,classes:{URLSearchParams:Uk,FormData:zk,Blob:Wk},protocols:["http","https","file","blob","url","data"]},si=typeof window<"u"&&typeof document<"u",Us=typeof navigator=="object"&&navigator||void 0,Gk=si&&(!Us||["ReactNative","NativeScript","NS"].indexOf(Us.product)<0),qk=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jk=si&&window.location.href||"http://localhost",Yk=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:si,hasStandardBrowserEnv:Gk,hasStandardBrowserWebWorkerEnv:qk,navigator:Us,origin:jk},Symbol.toStringTag,{value:"Module"})),Lt={...Yk,...Hk};function Kk(n,e){return Wr(n,new Lt.classes.URLSearchParams,Object.assign({visitor:function(t,i,s,r){return Lt.isNode&&ue.isBuffer(t)?(this.append(i,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Jk(n){return ue.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Xk(n){const e={},t=Object.keys(n);let i;const s=t.length;let r;for(i=0;i=t.length;return o=!o&&ue.isArray(s)?s.length:o,l?(ue.hasOwnProp(s,o)?s[o]=[s[o],i]:s[o]=i,!a):((!s[o]||!ue.isObject(s[o]))&&(s[o]=[]),e(t,i,s[o],r)&&ue.isArray(s[o])&&(s[o]=Xk(s[o])),!a)}if(ue.isFormData(n)&&ue.isFunction(n.entries)){const t={};return ue.forEachEntry(n,(i,s)=>{e(Jk(i),s,t,0)}),t}return null}function Zk(n,e,t){if(ue.isString(n))try{return(e||JSON.parse)(n),ue.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(n)}const Va={transitional:xf,adapter:["xhr","http","fetch"],transformRequest:[function(n,e){const t=e.getContentType()||"",i=t.indexOf("application/json")>-1,s=ue.isObject(n);if(s&&ue.isHTMLForm(n)&&(n=new FormData(n)),ue.isFormData(n))return i?JSON.stringify(_f(n)):n;if(ue.isArrayBuffer(n)||ue.isBuffer(n)||ue.isStream(n)||ue.isFile(n)||ue.isBlob(n)||ue.isReadableStream(n))return n;if(ue.isArrayBufferView(n))return n.buffer;if(ue.isURLSearchParams(n))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let r;if(s){if(t.indexOf("application/x-www-form-urlencoded")>-1)return Kk(n,this.formSerializer).toString();if((r=ue.isFileList(n))||t.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Wr(r?{"files[]":n}:n,o&&new o,this.formSerializer)}}return s||i?(e.setContentType("application/json",!1),Zk(n)):n}],transformResponse:[function(n){const e=this.transitional||Va.transitional,t=e&&e.forcedJSONParsing,i=this.responseType==="json";if(ue.isResponse(n)||ue.isReadableStream(n))return n;if(n&&ue.isString(n)&&(t&&!this.responseType||i)){const s=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(n)}catch(r){if(s)throw r.name==="SyntaxError"?We.from(r,We.ERR_BAD_RESPONSE,this,null,this.response):r}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Lt.classes.FormData,Blob:Lt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ue.forEach(["delete","get","head","post","put","patch"],n=>{Va.headers[n]={}});const Qk=ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),e$=n=>{const e={};let t,i,s;return n&&n.split(` +`).forEach(function(r){s=r.indexOf(":"),t=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!t||e[t]&&Qk[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},ac=Symbol("internals");function ma(n){return n&&String(n).trim().toLowerCase()}function $r(n){return n===!1||n==null?n:ue.isArray(n)?n.map($r):String(n)}function t$(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(n);)e[i[1]]=i[2];return e}const n$=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Cs(n,e,t,i,s){if(ue.isFunction(i))return i.call(this,e,t);if(s&&(e=t),!!ue.isString(e)){if(ue.isString(i))return e.indexOf(i)!==-1;if(ue.isRegExp(i))return i.test(e)}}function o$(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function a$(n,e){const t=ue.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+t,{value:function(s,r,o){return this[i].call(this,e,s,r,o)},configurable:!0})})}class Gt{constructor(e){e&&this.set(e)}set(e,t,i){const s=this;function r(a,l,c){const d=ma(l);if(!d)throw new Error("header name must be a non-empty string");const u=ue.findKey(s,d);(!u||s[u]===void 0||c===!0||c===void 0&&s[u]!==!1)&&(s[u||l]=$r(a))}const o=(a,l)=>ue.forEach(a,(c,d)=>r(c,d,l));if(ue.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ue.isString(e)&&(e=e.trim())&&!n$(e))o(e$(e),t);else if(ue.isHeaders(e))for(const[a,l]of e.entries())r(l,a,i);else e!=null&&r(t,e,i);return this}get(e,t){if(e=ma(e),e){const i=ue.findKey(this,e);if(i){const s=this[i];if(!t)return s;if(t===!0)return t$(s);if(ue.isFunction(t))return t.call(this,s,i);if(ue.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ma(e),e){const i=ue.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||Cs(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let s=!1;function r(o){if(o=ma(o),o){const a=ue.findKey(i,o);a&&(!t||Cs(i,i[a],a,t))&&(delete i[a],s=!0)}}return ue.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let i=t.length,s=!1;for(;i--;){const r=t[i];(!e||Cs(this,this[r],r,e,!0))&&(delete this[r],s=!0)}return s}normalize(e){const t=this,i={};return ue.forEach(this,(s,r)=>{const o=ue.findKey(i,r);if(o){t[o]=$r(s),delete t[r];return}const a=e?o$(r):String(r).trim();a!==r&&delete t[r],t[a]=$r(s),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ue.forEach(this,(i,s)=>{i!=null&&i!==!1&&(t[s]=e&&ue.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(s=>i.set(s)),i}static accessor(e){const t=(this[ac]=this[ac]={accessors:{}}).accessors,i=this.prototype;function s(r){const o=ma(r);t[o]||(a$(i,r),t[o]=!0)}return ue.isArray(e)?e.forEach(s):s(e),this}}Gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ue.reduceDescriptors(Gt.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(i){this[t]=i}}});ue.freezeMethods(Gt);function ks(n,e){const t=this||Va,i=e||t,s=Gt.from(i.headers);let r=i.data;return ue.forEach(n,function(o){r=o.call(t,r,s.normalize(),e?e.status:void 0)}),s.normalize(),r}function Cf(n){return!!(n&&n.__CANCEL__)}function Yo(n,e,t){We.call(this,n??"canceled",We.ERR_CANCELED,e,t),this.name="CanceledError"}ue.inherits(Yo,We,{__CANCEL__:!0});function kf(n,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?n(t):e(new We("Request failed with status code "+t.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function r$(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function l$(n,e){n=n||10;const t=new Array(n),i=new Array(n);let s=0,r=0,o;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),c=i[r];o||(o=l),t[s]=a,i[s]=l;let d=r,u=0;for(;d!==s;)u+=t[d++],d=d%n;if(s=(s+1)%n,s===r&&(r=(r+1)%n),l-o{t=l,s=null,r&&(clearTimeout(r),r=null),n.apply(null,a)};return[(...a)=>{const l=Date.now(),c=l-t;c>=i?o(a,l):(s=a,r||(r=setTimeout(()=>{r=null,o(s)},i-c)))},()=>s&&o(s)]}const Lr=(n,e,t=3)=>{let i=0;const s=l$(50,250);return s$(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,l=o-i,c=s(l),d=o<=a;i=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&d?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(u)},t)},rc=(n,e)=>{const t=n!=null;return[i=>e[0]({lengthComputable:t,total:n,loaded:i}),e[1]]},lc=n=>(...e)=>ue.asap(()=>n(...e)),i$=Lt.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,Lt.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(Lt.origin),Lt.navigator&&/(msie|trident)/i.test(Lt.navigator.userAgent)):()=>!0,u$=Lt.hasStandardBrowserEnv?{write(n,e,t,i,s,r){const o=[n+"="+encodeURIComponent(e)];ue.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),ue.isString(i)&&o.push("path="+i),ue.isString(s)&&o.push("domain="+s),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function d$(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function c$(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function $f(n,e){return n&&!d$(e)?c$(n,e):e}const sc=n=>n instanceof Gt?{...n}:n;function vo(n,e){e=e||{};const t={};function i(c,d,u,f){return ue.isPlainObject(c)&&ue.isPlainObject(d)?ue.merge.call({caseless:f},c,d):ue.isPlainObject(d)?ue.merge({},d):ue.isArray(d)?d.slice():d}function s(c,d,u,f){if(ue.isUndefined(d)){if(!ue.isUndefined(c))return i(void 0,c,u,f)}else return i(c,d,u,f)}function r(c,d){if(!ue.isUndefined(d))return i(void 0,d)}function o(c,d){if(ue.isUndefined(d)){if(!ue.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function a(c,d,u){if(u in e)return i(c,d);if(u in n)return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,d,u)=>s(sc(c),sc(d),u,!0)};return ue.forEach(Object.keys(Object.assign({},n,e)),function(c){const d=l[c]||s,u=d(n[c],e[c],c);ue.isUndefined(u)&&d!==a||(t[c]=u)}),t}const Sf=n=>{const e=vo({},n);let{data:t,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:r,headers:o,auth:a}=e;e.headers=o=Gt.from(o),e.url=wf($f(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(ue.isFormData(t)){if(Lt.hasStandardBrowserEnv||Lt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...d]=l?l.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...d].join("; "))}}if(Lt.hasStandardBrowserEnv&&(i&&ue.isFunction(i)&&(i=i(e)),i||i!==!1&&i$(e.url))){const c=s&&r&&u$.read(r);c&&o.set(s,c)}return e},f$=typeof XMLHttpRequest<"u",p$=f$&&function(n){return new Promise(function(e,t){const i=Sf(n);let s=i.data;const r=Gt.from(i.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=i,c,d,u,f,g;function m(){f&&f(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let _=new XMLHttpRequest;_.open(i.method.toUpperCase(),i.url,!0),_.timeout=i.timeout;function v(){if(!_)return;const S=Gt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),w={data:!o||o==="text"||o==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:S,config:n,request:_};kf(function(L){e(L),m()},function(L){t(L),m()},w),_=null}"onloadend"in _?_.onloadend=v:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(v)},_.onabort=function(){_&&(t(new We("Request aborted",We.ECONNABORTED,n,_)),_=null)},_.onerror=function(){t(new We("Network Error",We.ERR_NETWORK,n,_)),_=null},_.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||xf;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),t(new We(S,w.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,n,_)),_=null},s===void 0&&r.setContentType(null),"setRequestHeader"in _&&ue.forEach(r.toJSON(),function(S,w){_.setRequestHeader(w,S)}),ue.isUndefined(i.withCredentials)||(_.withCredentials=!!i.withCredentials),o&&o!=="json"&&(_.responseType=i.responseType),l&&([u,g]=Lr(l,!0),_.addEventListener("progress",u)),a&&_.upload&&([d,f]=Lr(a),_.upload.addEventListener("progress",d),_.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(c=S=>{_&&(t(!S||S.type?new Yo(null,n,_):S),_.abort(),_=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const C=r$(i.url);if(C&&Lt.protocols.indexOf(C)===-1){t(new We("Unsupported protocol "+C+":",We.ERR_BAD_REQUEST,n));return}_.send(s||null)})},h$=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let i=new AbortController,s;const r=function(c){if(!s){s=!0,a();const d=c instanceof Error?c:this.reason;i.abort(d instanceof We?d:new Yo(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,r(new We(`timeout ${e} of ms exceeded`,We.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>ue.asap(a),l}},m$=function*(n,e){let t=n.byteLength;if(t{const s=v$(n,e);let r=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:d}=await s.next();if(c){a(),l.close();return}let u=d.byteLength;if(t){let f=r+=u;t(f)}l.enqueue(new Uint8Array(d))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},Hr=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Vf=Hr&&typeof ReadableStream=="function",y$=Hr&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Ef=(n,...e)=>{try{return!!n(...e)}catch{return!1}},b$=Vf&&Ef(()=>{let n=!1;const e=new Request(Lt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),uc=64*1024,zs=Vf&&Ef(()=>ue.isReadableStream(new Response("").body)),Or={stream:zs&&(n=>n.body)};Hr&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Or[e]&&(Or[e]=ue.isFunction(n[e])?t=>t[e]():(t,i)=>{throw new We(`Response type '${e}' is not supported`,We.ERR_NOT_SUPPORT,i)})})})(new Response);const w$=async n=>{if(n==null)return 0;if(ue.isBlob(n))return n.size;if(ue.isSpecCompliantForm(n))return(await new Request(Lt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(ue.isArrayBufferView(n)||ue.isArrayBuffer(n))return n.byteLength;if(ue.isURLSearchParams(n)&&(n=n+""),ue.isString(n))return(await y$(n)).byteLength},x$=async(n,e)=>ue.toFiniteNumber(n.getContentLength())??w$(e),_$=Hr&&(async n=>{let{url:e,method:t,data:i,signal:s,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:d,withCredentials:u="same-origin",fetchOptions:f}=Sf(n);c=c?(c+"").toLowerCase():"text";let g=h$([s,r&&r.toAbortSignal()],o),m;const _=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let v;try{if(l&&b$&&t!=="get"&&t!=="head"&&(v=await x$(d,i))!==0){let I=new Request(e,{method:"POST",body:i,duplex:"half"}),N;if(ue.isFormData(i)&&(N=I.headers.get("content-type"))&&d.setContentType(N),I.body){const[R,T]=rc(v,Lr(lc(l)));i=ic(I.body,uc,R,T)}}ue.isString(u)||(u=u?"include":"omit");const C="credentials"in Request.prototype;m=new Request(e,{...f,signal:g,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:i,duplex:"half",credentials:C?u:void 0});let S=await fetch(m);const w=zs&&(c==="stream"||c==="response");if(zs&&(a||w&&_)){const I={};["status","statusText","headers"].forEach(A=>{I[A]=S[A]});const N=ue.toFiniteNumber(S.headers.get("content-length")),[R,T]=a&&rc(N,Lr(lc(a),!0))||[];S=new Response(ic(S.body,uc,R,()=>{T&&T(),_&&_()}),I)}c=c||"text";let L=await Or[ue.findKey(Or,c)||"text"](S,n);return!w&&_&&_(),await new Promise((I,N)=>{kf(I,N,{data:L,headers:Gt.from(S.headers),status:S.status,statusText:S.statusText,config:n,request:m})})}catch(C){throw _&&_(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,n,m),{cause:C.cause||C}):We.from(C,C&&C.code,n,m)}}),Ws={http:Bk,xhr:p$,fetch:_$};ue.forEach(Ws,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const dc=n=>`- ${n}`,C$=n=>ue.isFunction(n)||n===null||n===!1,Tf={getAdapter:n=>{n=ue.isArray(n)?n:[n];const{length:e}=n;let t,i;const s={};for(let r=0;r`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since : +`+r.map(dc).join(` +`):" "+dc(r[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Ws};function $s(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Yo(null,n)}function cc(n){return $s(n),n.headers=Gt.from(n.headers),n.data=ks.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Tf.getAdapter(n.adapter||Va.adapter)(n).then(function(e){return $s(n),e.data=ks.call(n,n.transformResponse,e),e.headers=Gt.from(e.headers),e},function(e){return Cf(e)||($s(n),e&&e.response&&(e.response.data=ks.call(n,n.transformResponse,e.response),e.response.headers=Gt.from(e.response.headers))),Promise.reject(e)})}const Rf="1.7.8",Gr={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Gr[n]=function(t){return typeof t===n||"a"+(e<1?"n ":" ")+n}});const fc={};Gr.transitional=function(n,e,t){function i(s,r){return"[Axios v"+Rf+"] Transitional option '"+s+"'"+r+(t?". "+t:"")}return(s,r,o)=>{if(n===!1)throw new We(i(r," has been removed"+(e?" in "+e:"")),We.ERR_DEPRECATED);return e&&!fc[r]&&(fc[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),n?n(s,r,o):!0}};Gr.spelling=function(n){return(e,t)=>(console.warn(`${t} is likely a misspelling of ${n}`),!0)};function k$(n,e,t){if(typeof n!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let s=i.length;for(;s-- >0;){const r=i[s],o=e[r];if(o){const a=n[r],l=a===void 0||o(a,r,n);if(l!==!0)throw new We("option "+r+" must be "+l,We.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new We("Unknown option "+r,We.ERR_BAD_OPTION)}}const Sr={assertOptions:k$,validators:Gr},Cn=Sr.validators;class po{constructor(e){this.defaults=e,this.interceptors={request:new oc,response:new oc}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+=` +`+r):i.stack=r}catch{}}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=vo(this.defaults,t);const{transitional:i,paramsSerializer:s,headers:r}=t;i!==void 0&&Sr.assertOptions(i,{silentJSONParsing:Cn.transitional(Cn.boolean),forcedJSONParsing:Cn.transitional(Cn.boolean),clarifyTimeoutError:Cn.transitional(Cn.boolean)},!1),s!=null&&(ue.isFunction(s)?t.paramsSerializer={serialize:s}:Sr.assertOptions(s,{encode:Cn.function,serialize:Cn.function},!0)),Sr.assertOptions(t,{baseUrl:Cn.spelling("baseURL"),withXsrfToken:Cn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&ue.merge(r.common,r[t.method]);r&&ue.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),t.headers=Gt.concat(o,r);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let d,u=0,f;if(!l){const m=[cc.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,c),f=m.length,d=Promise.resolve(t);u{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](s);i._listeners=null}),this.promise.then=s=>{let r;const o=new Promise(a=>{i.subscribe(a),r=a}).then(s);return o.cancel=function(){i.unsubscribe(r)},o},e(function(s,r,o){i.reason||(i.reason=new Yo(s,r,o),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=i=>{e.abort(i)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ii(function(t){e=t}),cancel:e}}}function $$(n){return function(e){return n.apply(null,e)}}function S$(n){return ue.isObject(n)&&n.isAxiosError===!0}const Hs={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Hs).forEach(([n,e])=>{Hs[e]=n});function Af(n){const e=new po(n),t=sf(po.prototype.request,e);return ue.extend(t,po.prototype,e,{allOwnKeys:!0}),ue.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Af(vo(n,i))},t}const ht=Af(Va);ht.Axios=po;ht.CanceledError=Yo;ht.CancelToken=ii;ht.isCancel=Cf;ht.VERSION=Rf;ht.toFormData=Wr;ht.AxiosError=We;ht.Cancel=ht.CanceledError;ht.all=function(n){return Promise.all(n)};ht.spread=$$;ht.isAxiosError=S$;ht.mergeConfig=vo;ht.AxiosHeaders=Gt;ht.formToJSON=n=>_f(ue.isHTMLForm(n)?new FormData(n):n);ht.getAdapter=Tf.getAdapter;ht.HttpStatusCode=Hs;ht.default=ht;const V$={class:"w-full"},E$=["disabled","accept","multiple"],T$={class:"text-center"},R$=["innerHTML"],A$={class:"mt-1 text-xs text-gray-500"},M$={key:0,class:"mt-4 space-y-2"},N$={class:"flex items-center gap-2 flex-1"},I$={key:0,class:"h-5 w-5 text-blue-500 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},L$={key:1,class:"h-5 w-5 text-green-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},O$={key:2,class:"h-5 w-5 text-red-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},B$={key:3,class:"h-5 w-5 text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},D$={class:"flex-1"},P$={class:"flex items-center justify-between"},F$={class:"text-sm font-medium text-gray-700"},U$={class:"text-xs text-gray-500"},z$={key:0,class:"w-full mt-2"},W$={class:"w-full bg-gray-200 rounded-full h-1.5"},H$={class:"text-xs text-gray-500"},G$={key:1,class:"text-xs text-red-500 mt-1"},q$={key:2,class:"text-xs text-green-500 mt-1"},j$=["disabled","onClick"],Y$=defineComponent({__name:"ShadcnUpload",props:{accept:{default:"*"},description:{},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},action:{},headers:{},data:{},name:{default:"file"},withCredentials:{type:Boolean,default:!1},beforeUpload:{}},emits:["update:files","on-change","on-success","on-error","on-progress"],setup(n,{emit:e}){const t=n,i=e,s=ref(null),r=ref(!1),o=ref([]),a=new Map,l=()=>Date.now()+"_"+Math.random().toString(36).slice(2,9),c=()=>{var S;(S=s.value)==null||S.click()},d=()=>{r.value=!0},u=()=>{r.value=!1},f=S=>{if(r.value=!1,t.disabled)return;const w=Array.from(S.dataTransfer.files);m(w)},g=S=>{const w=Array.from(S.target.files);m(w),S.target.value=""},m=async S=>{for(const w of S){if(t.beforeUpload&&!await t.beforeUpload(w))continue;const L={uid:l(),name:w.name,size:w.size,status:"ready",percent:0,raw:w};t.multiple?o.value.push(L):o.value=[L],_(L)}},_=async S=>{const w=new FormData;w.append(t.name,S.raw),t.data&&Object.entries(t.data).forEach(([I,N])=>{w.append(I,N)});const L=o.value.findIndex(I=>I.uid===S.uid);L!==-1&&(o.value[L]={...o.value[L],status:"uploading",percent:0});try{const I=ht.post(t.action,w,{headers:{"Content-Type":"multipart/form-data",...t.headers},withCredentials:t.withCredentials,onUploadProgress:T=>{if(T.total){const A=Math.round(T.loaded*100/T.total),F=o.value.findIndex(B=>B.uid===S.uid);F!==-1&&(o.value[F]={...o.value[F],percent:A}),i("on-progress",{percent:A},S)}}});a.set(S.uid,I);const N=await I,R=o.value.findIndex(T=>T.uid===S.uid);R!==-1&&(o.value[R]={...o.value[R],status:"success",response:N.data}),i("on-success",N.data,S)}catch(I){const N=o.value.findIndex(R=>R.uid===S.uid);N!==-1&&(o.value[N]={...o.value[N],status:"error",error:I.message}),i("on-error",I,S)}finally{a.delete(S.uid),i("update:files",o.value),i("on-change",o.value)}},v=S=>{const w=o.value.findIndex(L=>L.uid===S.uid);if(w!==-1){if(S.status==="uploading"){const L=a.get(S.uid);L!=null&&L.cancel&&L.cancel(),a.delete(S.uid)}o.value.splice(w,1),i("update:files",o.value),i("on-change",o.value)}},C=S=>{if(S===0)return"0 Bytes";const w=1024,L=["Bytes","KB","MB","GB"],I=Math.floor(Math.log(S)/Math.log(w));return parseFloat((S/Math.pow(w,I)).toFixed(2))+" "+L[I]};return(S,w)=>(openBlock(),createElementBlock("div",V$,[createBaseVNode("div",{class:normalizeClass$1(["w-full rounded-lg border border-dashed p-4","flex flex-col items-center justify-center gap-4",r.value?"border-blue-500 bg-blue-50":"border-gray-200",S.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onDragover:withModifiers(d,["prevent"]),onDragleave:withModifiers(u,["prevent"]),onDrop:withModifiers(f,["prevent"]),onClick:w[0]||(w[0]=L=>!S.disabled&&c())},[createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",disabled:S.disabled,accept:S.accept,multiple:S.multiple,onChange:g},null,40,E$),w[1]||(w[1]=createBaseVNode("div",{class:"rounded-full bg-gray-100 p-3"},[createBaseVNode("svg",{class:"h-6 w-6 text-gray-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})])],-1)),createBaseVNode("div",T$,[createBaseVNode("p",{class:"text-sm font-medium text-gray-600",innerHTML:unref(P)("upload.text.placeholder")},null,8,R$),createBaseVNode("p",A$,toDisplayString$1(S.description||unref(P)("upload.text.description")),1)])],34),o.value.length>0?(openBlock(),createElementBlock("div",M$,[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.value,L=>(openBlock(),createElementBlock("div",{class:"flex items-center justify-between rounded-md border p-3",key:L.uid},[createBaseVNode("div",N$,[L.status==="uploading"?(openBlock(),createElementBlock("svg",I$,w[2]||(w[2]=[createBaseVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),createBaseVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):L.status==="success"?(openBlock(),createElementBlock("svg",L$,w[3]||(w[3]=[createBaseVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"},null,-1)]))):L.status==="error"?(openBlock(),createElementBlock("svg",O$,w[4]||(w[4]=[createBaseVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1)]))):(openBlock(),createElementBlock("svg",B$,w[5]||(w[5]=[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)]))),createBaseVNode("div",D$,[createBaseVNode("div",P$,[createBaseVNode("p",F$,toDisplayString$1(L.name),1),createBaseVNode("p",U$,toDisplayString$1(C(L.size)),1)]),L.status==="uploading"?(openBlock(),createElementBlock("div",z$,[createBaseVNode("div",W$,[createBaseVNode("div",{class:"bg-blue-600 h-1.5 rounded-full transition-all duration-300",style:normalizeStyle$1({width:`${L.percent}%`})},null,4)]),createBaseVNode("span",H$,toDisplayString$1(L.percent)+"%",1)])):createCommentVNode("",!0),L.status==="error"?(openBlock(),createElementBlock("p",G$,toDisplayString$1(L.error||unref(P)("upload.text.error")),1)):createCommentVNode("",!0),L.status==="success"?(openBlock(),createElementBlock("p",q$,toDisplayString$1(unref(P)("upload.text.success")),1)):createCommentVNode("",!0)])]),createBaseVNode("button",{class:"text-gray-500 hover:text-gray-700 ml-3",disabled:S.disabled,onClick:withModifiers(I=>v(L),["stop"])},w[6]||(w[6]=[createBaseVNode("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]),8,j$)]))),128))])):createCommentVNode("",!0)]))}}),va={timestamp:[/^(\d{4}-\d{2}-\d{2}[\sT]\d{2}:\d{2}:\d{2}(?:[.,]\d{3})?(?:Z)?)/,/(\d{4}[-\/.]\d{2}[-\/.]\d{2}\s+\d{2}:\d{2}:\d{2}(?:[.,]\d{3})?)/,/(\d{2}[-:.]\d{2}[-:.]\d{2}(?:[.,]\d{3})?)/,/(\w{3}\s+\d{1,2}\s+(?:\d{4}\s+)?\d{2}:\d{2}:\d{2})/,/(\d{4}年\d{2}月\d{2}日\s*\d{2}:\d{2}:\d{2})/,/(\d{13,14})/,/@timestamp\[([^\]]+)\]/,/"@timestamp":"([^"]+)"/,/(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|[+-]\d{2}:?\d{2}))/,/\b(\d{10})\b/],level:[/\b(TRACE|DEBUG|INFO|NOTICE|WARN(?:ING)?|ERROR|CRITICAL|ALERT|FATAL|EMERGENCY|EMERG|CRIT|ERR|SEVERE)\b/i,/[\[\(<](TRACE|DEBUG|INFO|NOTICE|WARN(?:ING)?|ERROR|CRITICAL|ALERT|FATAL|EMERGENCY|EMERG|CRIT|ERR|SEVERE)[\]\)>]/i,/\b(LOG|PRINT|OUTPUT|CUSTOM|VERBOSE|FINE|FINER|FINEST|CONFIG|OFF)\b/i,/([!✓✗✘■□▲△▼▽►◄★☆●○])/,/@level\[([^\]]+)\]/,/"level":"([^"]+)"/,/<(\d{1,3})>/],thread:[/[\[\(](.*?)[\]\)]/,/\b(?:thread|process|tid|pid|worker)[:\-]?\s*(\S+)/i,/(?:T|Thread|TID)[-#](\d+)\b/i,/\b(main|background|worker-\d+|pool-\d+-thread-\d+|async-\d+)\b/i,/@thread\[([^\]]+)\]/,/PID[:\-]?(\d+)[\s,]*TID[:\-]?(\d+)/i,/"thread(?:Name|Id)?":"([^"]+)"/,/goroutine\s+(\d+)\s+\[/],logger:[/(?:[\]\)]|^)\s*([\w.$@\-_]+(?:\.[\w$@\-_]+)*)/,/\b((?:[\w-]+\.){2,}[\w-]+)\b/,/\bclass\s+([\w.$]+)\b/i,/\b((?:\/[\w-]+)+|(?:\\[\w-]+)+)\b/,/@logger\[([^\]]+)\]/,/\b([\w-]+:[\w-]+(?::[\w-]+)*)\b/,/"logger(?:Name)?":"([^"]+)"/,/\[([\w-]+\/[\w-]+)\]/],file:[/\[([^[\]]+\.[a-zA-Z0-9]+(?::\d+)?)\]/,/\(([^()]+\.[a-zA-Z0-9]+(?::\d+)?)\)/,/(?:at\s+)?([^:\s]+\.[a-zA-Z0-9]+):(\d+)(?::(\d+))?/,/(?:\/[\w\-\.]+)+\/([^:\s]+)(?::\d+)?/,/@file\[([^\]]+)\]/,/\b([\w.-]+):(\d+)(?::(\d+))?\b/,/"(?:file|fileName|source)":"([^"]+)"/,/(\w+\.go:\d+)/]},K$={TRACE:"TRACE",FINEST:"TRACE",FINER:"TRACE",FINE:"DEBUG",DEBUG:"DEBUG",VERBOSE:"DEBUG",CONFIG:"INFO",INFO:"INFO",NOTICE:"INFO",LOG:"INFO",PRINT:"INFO",OUTPUT:"INFO",CUSTOM:"INFO",WARN:"WARN",WARNING:"WARN",ERROR:"ERROR",ERR:"ERROR",SEVERE:"ERROR",CRITICAL:"ERROR",CRIT:"ERROR",ALERT:"ERROR",FATAL:"FATAL",EMERGENCY:"FATAL",EMERG:"FATAL",OFF:"OFF"};class qr{constructor(e,t,i){Pt(this,"patterns"),Pt(this,"levelNormalization"),Pt(this,"options"),Pt(this,"cache"),this.patterns=e||{timestamp:[/^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d{3})/,...va.timestamp||[]],level:[...va.level||[]],thread:[...va.thread||[]],logger:[...va.logger||[]],file:[...va.file||[]]},this.levelNormalization={...K$,...t},this.options={timezone:"UTC",multiline:!1,stackTrace:!1,jsonFormat:!1,keepOriginalTimestamp:!0,autoFillTimestamp:!1,...i},this.cache=new Map}findMatch(e,t,i=!0){if(!e||e.length===0)return{value:"",remaining:t};for(const s of e){const r=t.match(s);if(r){const o=r[1],a=i?t.replace(r[0],""):t;return{value:o,remaining:a}}}return{value:"",remaining:t}}cleanText(e){return e?e.replace(/[\[\](){}「」【】]/g,"").replace(/\s+/g," ").trim():""}parseJson(e){try{const t=JSON.parse(e);return{timestamp:t["@timestamp"]||t.timestamp||t.time,level:t.level||t.severity,thread:t.thread||t.threadName||t.threadId,logger:t.logger||t.loggerName||t.category,file:t.file||t.fileName||t.source,message:t.message||t.msg||t.text}}catch{return null}}parseStackTrace(e){const t=/^\s+at\s+.+|^Caused by:.+|^\s*(?:[\w\s.]+Exception|\w+Error):.+/,i=[];for(const s of e)t.test(s)&&i.push(s.trim());return i}adjustTimezone(e){if(this.options.keepOriginalTimestamp||!e)return e;try{const t=new Date(e);return this.options.timezone?t.toLocaleString("en-US",{timeZone:this.options.timezone}):t.toISOString()}catch{return e}}formatTimestamp(e){if(this.options.autoFillTimestamp&&!e)return new Date().toISOString();if(this.options.keepOriginalTimestamp)return e;const t=e.match(/^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}),(\d{3})$/);if(t){const[i,s,r]=t;return this.adjustTimezone(new Date(s.replace(" ","T")+"."+r+"Z").toISOString())}return/^\d{13,14}$/.test(e)?this.adjustTimezone(new Date(parseInt(e)).toISOString()):this.adjustTimezone(e)}parse(e){const t=this.cache.get(e);if(t)return t;let i=e.split(/\r?\n/),s=i[0],r=s,o={};if(this.options.jsonFormat){const l=this.parseJson(s);l&&(o=l)}if(!o.timestamp){const l=this.findMatch(this.patterns.timestamp,r);if(o.timestamp=this.adjustTimezone(this.formatTimestamp(l.value)),r=l.remaining,this.options.separator){const c=this.options.separator instanceof RegExp?this.options.separator.source:this.options.separator,d=r.split(c);if(d.length>=3){const[u,f,g,...m]=d;o.level=f,o.thread=g,r=m.join(c)}}if(!o.level){const c=this.findMatch(this.patterns.level,r);o.level=this.levelNormalization[c.value.toUpperCase()]||"INFO",r=c.remaining}if(!o.thread){const c=this.findMatch(this.patterns.thread,r);o.thread=c.value||"main",r=c.remaining}if(!o.logger){const c=this.findMatch(this.patterns.logger,r);o.logger=c.value||null,r=c.remaining}if(!o.file){const c=this.findMatch(this.patterns.file,r);o.file=c.value,r=c.remaining}o.message=this.cleanText(r)}if(this.options.stackTrace&&i.length>1){const l=this.parseStackTrace(i.slice(1));l.length>0&&(o.message=`${o.message} +${l.join(` +`)}`)}if(this.options.multiline&&i.length>1){const l=i.slice(1).filter(c=>!this.findMatch(this.patterns.timestamp,c).value).join(` +`);l&&(o.message=`${o.message} +${l}`)}const a={timestamp:o.timestamp||(this.options.autoFillTimestamp?new Date().toISOString():""),level:(o.level||"INFO").trim(),thread:this.cleanText(o.thread||"main"),logger:this.cleanText(o.logger||null),file:this.cleanText(o.file||""),message:this.cleanText(o.message||e)};return this.cache.size<1e4&&this.cache.set(e,a),a}parseMultipleLines(e){const t=[];for(let i=0;ithis.parse(r));t.push(...s),this.cache.size>5e3&&this.cache.clear()}return t}learnFromExample(e,t){if(console.debug("Learning from example",e),t.timestamp){const i=t.timestamp.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp("^("+i.replace(/\d+/g,"\\d+")+")");this.patterns.timestamp=[s,...this.patterns.timestamp||[]]}if(t.level){const i=new RegExp(`\\b(${t.level})\\b`,"i");this.patterns.level=[i,...this.patterns.level||[]]}if(t.thread){const i=new RegExp(`\\b(${t.thread})\\b`);this.patterns.thread=[i,...this.patterns.thread||[]]}if(t.logger){const i=new RegExp(`\\b(${t.logger.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})\\b`);this.patterns.logger=[i,...this.patterns.logger||[]]}if(t.file){const i=new RegExp(`\\b(${t.file.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})\\b`);this.patterns.file=[i,...this.patterns.file||[]]}}}function J$(n,e,t){return new qr(t,void 0,{...e,multiline:!0}).parseMultipleLines(n)}const X$={class:"w-full font-mono text-sm"},Z$={key:0,class:"flex items-center gap-2 p-2"},Q$={class:"min-w-full inline-block"},eS={class:"inline-block min-w-full px-4 space-x-2"},tS={key:0},nS={key:2,class:"text-gray-500"},oS={key:3,class:"text-gray-700"},aS={key:4,class:"text-gray-500"},rS={key:5},lS=defineComponent({__name:"ShadcnLogger",props:{items:{default:()=>[]},highlightConfig:{default:()=>({WARN:"rgb(234 179 8)",ERROR:"rgb(239 68 68)",DEBUG:"rgb(107 114 128)",TRACE:"rgb(156 163 175)"})},height:{default:200},toolbar:{type:Boolean,default:!1},caseSensitive:{type:Boolean,default:!1},customPatterns:{default:void 0}},setup(n){const e=n,t=ref(""),i=ref(""),s=computed(()=>J$(e.items,void 0,e.customPatterns?e.customPatterns:void 0)),r=computed(()=>s.value.filter(o=>{const a=!t.value||o.level===t.value,l=!i.value||(e.caseSensitive?Object.values(o).some(c=>String(c).toLowerCase().includes(i.value.toLowerCase())):Object.values(o).some(c=>String(c).includes(i.value)));return a&&l}));return(o,a)=>{const l=resolveComponent("ShadcnSelectOption"),c=resolveComponent("ShadcnInput");return openBlock(),createElementBlock("div",X$,[o.toolbar?(openBlock(),createElementBlock("div",Z$,[createVNode(unref(oi),{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value=d),class:"w-32"},{options:withCtx(()=>[createVNode(l,{value:"",label:unref(P)("logger.text.allLevel")},null,8,["label"]),(openBlock(!0),createElementBlock(Fragment,null,renderList(Object.keys(o.highlightConfig),d=>(openBlock(),createBlock$1(l,{label:d,value:d},null,8,["label","value"]))),256))]),_:1},8,["modelValue"]),createVNode(c,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=d=>i.value=d),class:"flex-1",placeholder:unref(P)("logger.placeholder.search")},null,8,["modelValue","placeholder"])])):createCommentVNode("",!0),createBaseVNode("div",{class:"overflow-y-auto",style:normalizeStyle$1({height:`${unref(ke)(o.height)}`,maxHeight:`${unref(ke)(o.height)}`})},[createBaseVNode("div",Q$,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(d,u)=>(openBlock(),createElementBlock("div",{class:"whitespace-pre py-1 hover:bg-gray-100 w-full block",key:u},[createBaseVNode("div",eS,[renderSlot(o.$slots,"content",{item:d},()=>[d.timestamp?(openBlock(),createElementBlock("span",tS,[createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.timestamp,highlight:i.value},null,8,["case-sensitive","text","highlight"])])):createCommentVNode("",!0),d.level?(openBlock(),createElementBlock("span",{key:1,style:normalizeStyle$1({color:o.highlightConfig[d.level]})},[createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.level,highlight:i.value},null,8,["case-sensitive","text","highlight"])],4)):createCommentVNode("",!0),d.thread?(openBlock(),createElementBlock("span",nS,[a[2]||(a[2]=createTextVNode(" [")),createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.thread,highlight:i.value},null,8,["case-sensitive","text","highlight"]),a[3]||(a[3]=createTextVNode("] "))])):createCommentVNode("",!0),d.logger?(openBlock(),createElementBlock("span",oS,[createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.logger,highlight:i.value},null,8,["case-sensitive","text","highlight"])])):createCommentVNode("",!0),d.file?(openBlock(),createElementBlock("span",aS,[a[4]||(a[4]=createTextVNode(" [")),createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.file,highlight:i.value},null,8,["case-sensitive","text","highlight"]),a[5]||(a[5]=createTextVNode("] "))])):createCommentVNode("",!0),d.message?(openBlock(),createElementBlock("span",rS,[createVNode(unref(io),{"case-sensitive":o.caseSensitive,text:d.message,highlight:i.value},null,8,["case-sensitive","text","highlight"])])):createCommentVNode("",!0)])])]))),128))])],4)])}}}),sS={class:"relative overflow-hidden"},iS=defineComponent({__name:"ShadcnScrollbar",props:{height:{default:300},position:{default:"right"}},setup(n){return(e,t)=>(openBlock(),createElementBlock("div",sS,[createBaseVNode("div",{class:normalizeClass$1(["overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-gray-300",e.position==="left"?"[direction:rtl] pl-4 [&>*]:text-left [&>*]:[direction:ltr]":"pr-4"]),style:normalizeStyle$1({height:`${unref(ke)(e.height)}`,maxHeight:`${unref(ke)(e.height)}`})},[renderSlot(e.$slots,"default")],6)]))}}),uS={key:0},dS={class:"text-2xl font-bold"},cS={class:"mb-2"},fS={class:"space-x-2"},pS={class:"grid grid-cols-4 gap-4 text-center"},hS={class:"relative flex flex-col"},mS={key:0,class:"absolute -top-1 -right-1 flex h-3 w-3"},vS={class:"text-sm mt-2"},gS={class:"flex flex-col"},yS={class:"text-sm mt-2"},bS={class:"flex flex-col"},wS={class:"text-sm mt-2"},xS={class:"flex flex-col"},_S={class:"text-sm mt-2"},CS={key:0,class:"mt-4 h-2 bg-gray-200 rounded-full overflow-hidden"},kS={key:1,class:"mt-2 text-sm flex justify-between"},$S={class:"text-gray-500"},SS=defineComponent({__name:"ShadcnCountDown",props:{progress:{},time:{},simple:{type:Boolean,default:!1},title:{},toolbar:{type:Boolean,default:!1},warningThreshold:{default:5},showProgress:{type:Boolean,default:!1}},emits:["on-complete","on-tick","update:progress"],setup(n,{emit:e}){const t=e,i=n,s=ref({days:0,hours:0,minutes:0,seconds:0});let r=null;const o=ref(0),a=ref(0),l=ref(!1),c=()=>{if(l.value)return;const S=new Date().getTime(),w=new Date(i.time).getTime()-S;if(a.value=w,w<=0){s.value={days:0,hours:0,minutes:0,seconds:0},a.value=0,r&&(clearInterval(r),r=null),t("on-complete");return}const L={days:Math.floor(w/(1e3*60*60*24)),hours:Math.floor(w%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(w%(1e3*60*60)/(1e3*60)),seconds:Math.floor(w%(1e3*60)/1e3)};s.value=L,t("on-tick",L)},d=()=>{l.value=!l.value,l.value?clearInterval(r):(c(),r=setInterval(c,1e3))},u=()=>{l.value=!1;const S=new Date(i.time).getTime(),w=new Date().getTime();o.value=S-w,c(),a.value>0&&(r&&clearInterval(r),r=setInterval(c,1e3))},f=S=>String(S).padStart(2,"0"),g=computed(()=>{if(o.value===0||a.value<=0)return 100;const S=Math.max(0,Math.min(100,(o.value-a.value)/o.value*100));return t("update:progress",S),S}),m=computed(()=>`${g.value.toFixed(1)}%`),_=computed(()=>a.value<=0?P("countDown.text.completed"):l.value?P("countDown.text.paused"):s.value.days<=i.warningThreshold?P("countDown.text.timeUp"):P("countDown.text.running")),v=computed(()=>s.value.days<=i.warningThreshold&&a.value>0),C=computed(()=>a.value<=0);return watch(()=>i.time,()=>{u()}),onMounted(()=>{const S=new Date(i.time).getTime(),w=new Date().getTime();o.value=S-w,c(),a.value>0&&(r=setInterval(c,1e3))}),onUnmounted(()=>{r&&clearInterval(r)}),(S,w)=>{const L=resolveComponent("ShadcnButton");return S.simple?(openBlock(),createElementBlock("div",uS,[createBaseVNode("div",dS,toDisplayString$1(`${f(s.value.days)} : ${f(s.value.hours)} : ${f(s.value.minutes)} : ${f(s.value.seconds)}`),1)])):(openBlock(),createBlock$1(unref(Pc),{key:1,border:!1},createSlots({title:withCtx(()=>[renderSlot(S.$slots,"title",{},()=>[createBaseVNode("div",cS,toDisplayString$1(S.title),1)])]),default:withCtx(()=>[renderSlot(S.$slots,"blocks",{timeLeft:s.value,isWarning:v.value,isCompleted:C.value,isPaused:l.value},()=>[createBaseVNode("div",pS,[renderSlot(S.$slots,"days",{value:s.value.days,isWarning:v.value,isCompleted:C.value,isPaused:l.value},()=>[createBaseVNode("div",hS,[createBaseVNode("div",{class:normalizeClass$1(["text-4xl font-bold rounded-lg p-4 transition-all duration-300",{"bg-slate-100":!v.value&&!C.value,"bg-red-50":v.value&&!C.value,"bg-green-50":C.value,"animate-pulse":v.value&&!l.value&&!C.value}])},[createTextVNode(toDisplayString$1(f(s.value.days))+" ",1),v.value&&!C.value?(openBlock(),createElementBlock("span",mS,w[0]||(w[0]=[createBaseVNode("span",{class:"absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75 animate-ping"},null,-1),createBaseVNode("span",{class:"relative inline-flex rounded-full h-3 w-3 bg-red-500"},null,-1)]))):createCommentVNode("",!0)],2),renderSlot(S.$slots,"days-label",{},()=>[createBaseVNode("span",vS,toDisplayString$1(unref(P)("countDown.text.day")),1)])])]),renderSlot(S.$slots,"hours",{value:s.value.hours,isWarning:v.value,isCompleted:C.value,isPaused:l.value},()=>[createBaseVNode("div",gS,[createBaseVNode("div",{class:normalizeClass$1(["text-4xl font-bold rounded-lg p-4 transition-all duration-300",{"bg-slate-100":!v.value&&!C.value,"bg-red-50":v.value&&!C.value,"bg-green-50":C.value,"animate-pulse":v.value&&!l.value&&!C.value}])},toDisplayString$1(f(s.value.hours)),3),renderSlot(S.$slots,"hours-label",{},()=>[createBaseVNode("span",yS,toDisplayString$1(unref(P)("countDown.text.hour")),1)])])]),renderSlot(S.$slots,"minutes",{value:s.value.minutes,isWarning:v.value,isCompleted:C.value,isPaused:l.value},()=>[createBaseVNode("div",bS,[createBaseVNode("div",{class:normalizeClass$1(["text-4xl font-bold rounded-lg p-4 transition-all duration-300",{"bg-slate-100":!v.value&&!C.value,"bg-red-50":v.value&&!C.value,"bg-green-50":C.value,"animate-pulse":v.value&&!l.value&&!C.value}])},toDisplayString$1(f(s.value.minutes)),3),renderSlot(S.$slots,"minutes-label",{},()=>[createBaseVNode("span",wS,toDisplayString$1(unref(P)("countDown.text.minute")),1)])])]),renderSlot(S.$slots,"seconds",{value:s.value.seconds,isWarning:v.value,isCompleted:C.value,isPaused:l.value},()=>[createBaseVNode("div",xS,[createBaseVNode("div",{class:normalizeClass$1(["text-4xl font-bold rounded-lg p-4 transition-all duration-300",{"bg-slate-100":!v.value&&!C.value,"bg-red-50":v.value&&!C.value,"bg-green-50":C.value,"animate-pulse":v.value&&!l.value&&!C.value}])},toDisplayString$1(f(s.value.seconds)),3),renderSlot(S.$slots,"seconds-label",{},()=>[createBaseVNode("span",_S,toDisplayString$1(unref(P)("countDown.text.second")),1)])])])])]),S.showProgress?(openBlock(),createElementBlock("div",CS,[createBaseVNode("div",{class:normalizeClass$1(["h-full transition-all duration-300",{"bg-primary":!v.value&&!C.value,"bg-red-500":v.value&&!C.value,"bg-green-500":C.value,"animate-pulse":v.value&&!l.value&&!C.value}]),style:normalizeStyle$1({width:`${g.value}%`})},null,6)])):createCommentVNode("",!0),S.showProgress?(openBlock(),createElementBlock("div",kS,[createBaseVNode("span",{class:normalizeClass$1(["transition-colors duration-300",{"text-gray-500":!v.value&&!C.value,"text-red-500":v.value&&!C.value,"text-green-500":C.value}])},toDisplayString$1(_.value),3),createBaseVNode("span",$S,toDisplayString$1(m.value),1)])):createCommentVNode("",!0)]),_:2},[S.toolbar?{name:"extra",fn:withCtx(()=>[createBaseVNode("div",fS,[createVNode(L,{type:l.value?"primary":"warning",onClick:d},{default:withCtx(()=>[createTextVNode(toDisplayString$1(l.value?unref(P)("countDown.text.resume"):unref(P)("countDown.text.pause")),1)]),_:1},8,["type"]),createVNode(L,{type:"default",onClick:u},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("countDown.text.reset")),1)]),_:1})])]),key:"0"}:void 0]),1024))}}}),VS={class:"flex flex-col items-center justify-center text-center"},ES={class:"space-y-3 flex flex-col items-center"},TS={class:"text-lg font-semibold text-gray-900"},RS={class:"text-sm text-gray-500"},AS=defineComponent({__name:"ShadcnEmpty",emits:["on-retry"],setup(n,{emit:e}){const t=e;return(i,s)=>{const r=resolveComponent("ShadcnButton");return openBlock(),createElementBlock("div",VS,[createBaseVNode("div",ES,[renderSlot(i.$slots,"image",{},()=>[s[1]||(s[1]=createBaseVNode("div",null,[createBaseVNode("svg",{class:"w-24 h-24 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})])],-1))]),renderSlot(i.$slots,"title",{},()=>[createBaseVNode("h3",TS,toDisplayString$1(unref(P)("empty.text.noData")),1)]),renderSlot(i.$slots,"description",{},()=>[createBaseVNode("p",RS,toDisplayString$1(unref(P)("empty.text.noDataDescription")),1)]),renderSlot(i.$slots,"actions",{},()=>[createVNode(r,{onClick:s[0]||(s[0]=o=>t("on-retry"))},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("empty.text.retry")),1)]),_:1})])])])}}}),MS=defineComponent({__name:"ShadcnBackTop",props:{visibilityHeight:{default:200},right:{default:40},bottom:{default:40},duration:{default:500}},emits:["click"],setup(n,{emit:e}){const t=n,i=e,s=ref(!1),r=ref(null),o=()=>document.documentElement.scrollTop||document.body.scrollTop,a=()=>{s.value=o()>=t.visibilityHeight},l=()=>{const d=Date.now(),u=o(),f=()=>{const g=(Date.now()-d)/t.duration;if(g<1){const m=u*(1-c(g));r.value?r.value.scrollTop=m:window.scrollTo(0,m),requestAnimationFrame(f)}else window.scrollTo(0,0),i("click")};requestAnimationFrame(f)},c=d=>d<.5?2*d*d:-1+(4-2*d)*d;return onMounted(()=>{window.addEventListener("scroll",a),a()}),onUnmounted(()=>{window.removeEventListener("scroll",a)}),(d,u)=>(openBlock(),createBlock$1(Transition,{name:"fade"},{default:withCtx(()=>[withDirectives(createBaseVNode("button",{class:normalizeClass$1(["fixed rounded-full p-3 bg-primary text-primary-foreground shadow-md hover:bg-primary/90 focus:outline-none z-50"]),style:normalizeStyle$1({right:`${unref(ke)(t.right)}`,bottom:`${unref(ke)(t.bottom)}`}),onClick:l},u[0]||(u[0]=[createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[createBaseVNode("polyline",{points:"18 15 12 9 6 15"})],-1)]),4),[[vShow,s.value]])]),_:1}))}});var yn=(n=>(n.input="input",n.output="output",n))(yn||{});function Mf(){const n=new Uint8Array(16);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(n);else if(typeof require=="function"){const e=require("crypto").randomBytes(16);n.set(e)}else throw new Error("No secure random number generator available");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,[...n].map((e,t)=>{const i=e.toString(16).padStart(2,"0");return t===4||t===6||t===8||t===10?`-${i}`:i}).join("")}const NS={class:"h-full flex flex-col"},IS={class:"p-4 border-b border-gray-200"},LS={class:"flex-1 overflow-y-auto"},OS={class:"px-4 py-2 font-medium text-gray-600 bg-gray-50"},BS={class:"p-2"},DS=["onDragstart"],PS={class:"font-medium text-sm"},FS={class:"text-xs text-gray-500 mt-1"},US={class:"mt-2 flex justify-between text-xs text-gray-400"},zS={key:0},WS={key:1},HS=defineComponent({__name:"ShadcnWorkflowPanel",props:{nodes:{},categories:{},searchText:{default:""}},emits:["update:searchText","on-node-drag-start"],setup(n,{emit:e}){const t=e,i=n,s=ref(i.searchText);watch(()=>i.searchText,a=>{s.value=a,t("update:searchText",a)});const r=a=>i.nodes.filter(l=>{const c=s.value.toLowerCase(),d=l.category===a;return(l.category.toLowerCase().includes(c)||l.label.toLowerCase().includes(c))&&d}),o=(a,l)=>{if(l.dataTransfer){const c={...a,id:Mf(),tid:a.id,position:{x:0,y:0}};l.dataTransfer.setData("application/node",JSON.stringify(c)),l.dataTransfer.effectAllowed="copy";const d=document.createElement("div");d.className="bg-white border border-gray-200 rounded-lg p-2 shadow-lg",d.textContent=a.category,d.style.position="absolute",d.style.left="-1000px",document.body.appendChild(d),l.dataTransfer.setDragImage(d,0,0),requestAnimationFrame(()=>{document.body.removeChild(d)}),t("on-node-drag-start",a)}};return(a,l)=>(openBlock(),createElementBlock("div",NS,[renderSlot(a.$slots,"search",{},()=>[createBaseVNode("div",IS,[createVNode(unref(Uc),{modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=c=>s.value=c),placeholder:String(unref(P)("workflow.placeholder.search"))},null,8,["modelValue","placeholder"])])]),createBaseVNode("div",LS,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.categories,c=>(openBlock(),createElementBlock("div",{key:c.value,class:"mb-4"},[renderSlot(a.$slots,"category-header",{category:c},()=>[createBaseVNode("div",OS,toDisplayString$1(c.label),1)]),createBaseVNode("div",BS,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r(c.value),d=>(openBlock(),createElementBlock("div",{key:d.id},[renderSlot(a.$slots,"node",{node:d,onDragStart:o},()=>[createBaseVNode("div",{class:"p-3 mb-2 border border-gray-200 rounded-lg shadow-sm cursor-move hover:border-blue-500",draggable:"true",onDragstart:u=>o(d,u)},[createBaseVNode("div",PS,toDisplayString$1(d.label),1),createBaseVNode("div",FS,toDisplayString$1(d.description),1),createBaseVNode("div",US,[d.ports.some(u=>u.type===unref(yn).input)?(openBlock(),createElementBlock("div",zS,toDisplayString$1(unref(P)("workflow.text.input"))+": "+toDisplayString$1(d.ports.filter(u=>u.type===unref(yn).input).length),1)):createCommentVNode("",!0),d.ports.some(u=>u.type===unref(yn).output)?(openBlock(),createElementBlock("div",WS,toDisplayString$1(unref(P)("workflow.text.output"))+": "+toDisplayString$1(d.ports.filter(u=>u.type===unref(yn).output).length),1)):createCommentVNode("",!0)])],40,DS)])]))),128))])]))),128))]),renderSlot(a.$slots,"bottom")]))}}),GS={class:"flex items-center gap-3 min-w-[120px]"},qS={class:"flex flex-col gap-3"},jS=["data-port-id","data-port-type","onMousedown","onMouseup"],YS={class:"text-xs text-gray-600"},KS={class:"px-2 py-1 flex flex-col items-center select-none"},JS={class:"font-medium text-sm"},XS={class:"text-xs text-gray-500"},ZS={class:"flex flex-col gap-3"},QS={class:"text-xs text-gray-600"},e4=["data-port-id","data-port-type","onMousedown","onMouseup"],Nf=defineComponent({__name:"ShadcnWorkflowNodePorts",props:{node:{},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},connections:{default:()=>[]}},emits:["on-connection-start","on-connection-end","on-connection-drag","on-validation-change"],setup(n,{emit:e}){const t=e,i=n,s=computed(()=>i.node.ports.filter(c=>c.type===yn.input).map(c=>{var d;const u=c.id.startsWith(`${i.node.id}-`)?c.id:`${i.node.id}-${c.id}`,f=((d=i.connections)==null?void 0:d.some(m=>m.target===u||m.source===u))??!1,g=c.required?{valid:f,message:f?c.label:P("workflow.validated.required")}:void 0;return{...c,id:u,validated:g}})),r=computed(()=>i.node.ports.filter(c=>c.type===yn.output).map(c=>{var d;const u=c.id.startsWith(`${i.node.id}-`)?c.id:`${i.node.id}-${c.id}`,f=((d=i.connections)==null?void 0:d.some(m=>m.target===u||m.source===u))??!1,g=c.required?{valid:f,message:f?c.label:P("workflow.validated.required")}:void 0;return{...c,id:u,validated:g}})),o=computed(()=>{const c=[...s.value,...r.value];return{...i.node,ports:c}});watch(o,c=>t("on-validation-change",c),{deep:!0});const a=(c,d)=>{i.disabled||t("on-connection-start",c,d)},l=(c,d)=>{i.disabled||t("on-connection-end",c,d)};return(c,d)=>(openBlock(),createElementBlock("div",GS,[createBaseVNode("div",qS,[(openBlock(!0),createElementBlock(Fragment,null,renderList(s.value,u=>(openBlock(),createElementBlock("div",{class:"flex items-center gap-1.5 justify-start select-none",key:u.id},[createVNode(unref(Po),{content:String(u.validated?u.validated.message:u.label)},{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass$1(["w-3 h-3 rounded-full cursor-pointer transition-colors",{"bg-blue-500 hover:bg-blue-600":!u.validated,"bg-red-500 hover:bg-red-600":u.validated&&!u.validated.valid,"bg-blue-500 hover:bg-blue-600 disabled":u.validated&&u.validated.valid,"hover:animate-pulse hover:h-3.5 hover:w-3.5":!0}]),"data-port-id":u.id,"data-port-type":u.type,onMousedown:f=>a(f,u),onMouseup:f=>l(f,u)},null,42,jS)]),_:2},1032,["content"]),createBaseVNode("span",YS,toDisplayString$1(u.label),1)]))),128))]),renderSlot(c.$slots,"default",{},()=>[createBaseVNode("div",KS,[createBaseVNode("div",JS,toDisplayString$1(c.node.label),1),createBaseVNode("div",XS,toDisplayString$1(c.node.description),1)])]),createBaseVNode("div",ZS,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,u=>(openBlock(),createElementBlock("div",{class:"flex items-center gap-1.5 justify-end select-none",key:u.id},[createBaseVNode("span",QS,toDisplayString$1(u.label),1),createVNode(unref(Po),{content:String(u.validated?u.validated.message:u.label)},{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass$1(["w-3 h-3 rounded-full cursor-pointer transition-colors",{"bg-gray-500 hover:bg-gray-600":!u.validated,"bg-red-500 hover:bg-red-600":u.validated&&!u.validated.valid,"bg-gray-500 hover:bg-gray-600 disabled":u.validated&&u.validated.valid,"hover:animate-pulse hover:h-3.5 hover:w-3.5":!0}]),"data-port-id":u.id,"data-port-type":u.type,onMousedown:f=>a(f,u),onMouseup:f=>l(f,u)},null,42,e4)]),_:2},1032,["content"])]))),128))])]))}}),t4=["data-node-id","onClick","onMousedown"],n4={class:"px-2 pt-1.5 pb-1.5"},o4={class:"w-full flex items-center justify-between border-b"},a4={class:"w-full text-xs text-gray-500 py-1.5"},r4={key:0,class:"text-red-400 animate-bounce"},l4={class:"absolute inset-0",style:{width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"}},s4=["d"],i4=["d","onClick"],u4=["d"],d4=defineComponent({__name:"ShadcnWorkflowCanvas",props:{nodes:{},connections:{},selectedNodeId:{},canvas:{default:()=>({color:"#f3f4f6",showGrid:!0,gridColor:"rgba(0, 0, 0, 0.1)",gridSize:20,gridOpacity:.5,pattern:"grid",width:1920,height:1080})}},emits:["on-node-moved","on-connection-created","on-connection-removed","on-node-added","on-node-selected","on-node-deleted","on-node-updated"],setup(n,{emit:e}){const t=e,i=n,s=ref(null),r=ref(!1),o=ref(!1),a=ref(null),l=ref({x:0,y:0}),c=ref(null),d=ref(null),u=(j,K)=>{var ee;const U=document.querySelector(`[data-port-id="${K}"]`);if(!U)return{x:0,y:0};const q=U.getBoundingClientRect(),Q=(ee=s.value)==null?void 0:ee.getBoundingClientRect();return Q?{x:q.left+q.width/2-Q.left,y:q.top+q.height/2-Q.top}:{x:0,y:0}},f=(j,K)=>{const ee=Math.abs(K.x-j.x);return{c1:{x:j.x+ee/2,y:j.y},c2:{x:K.x-ee/2,y:K.y}}},g=(j,K,ee)=>{var U,q;r.value=!0;const Q=u(ee,K.id);c.value={sourcePort:K,sourceNode:ee,sourcePortPosition:Q,mousePosition:{x:j.clientX-(((U=s.value)==null?void 0:U.getBoundingClientRect().left)||0),y:j.clientY-(((q=s.value)==null?void 0:q.getBoundingClientRect().top)||0)},isValid:!1};const ce=Ce=>{var ae,be;if(!r.value||!c.value)return;c.value.mousePosition={x:Ce.clientX-(((ae=s.value)==null?void 0:ae.getBoundingClientRect().left)||0),y:Ce.clientY-(((be=s.value)==null?void 0:be.getBoundingClientRect().top)||0)};const De=document.elementsFromPoint(Ce.clientX,Ce.clientY).find(Te=>Te.hasAttribute("data-port-id"));if(De){const Te=De.getAttribute("data-port-id"),xe=De.getAttribute("data-port-type"),ze=i.nodes.find(qe=>Te==null?void 0:Te.startsWith(qe.id)),Qe=i.connections.some(qe=>K.type===yn.output?qe.source===K.id&&qe.target===Te:qe.target===K.id&&qe.source===Te);c.value.isValid=!!(ze&&ze.id!==ee.id&&xe!==K.type&&Te&&!Qe)}else c.value.isValid=!1},ie=()=>{r.value=!1,c.value=null,document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",ie)};document.addEventListener("mousemove",ce),document.addEventListener("mouseup",ie)},m=(j,K,ee)=>{if(!c.value)return;const{sourcePort:U,sourceNode:q}=c.value;if(U.type===K.type){c.value=null,r.value=!1;return}if(q.id===ee.id){c.value=null,r.value=!1;return}if(i.connections.some(ce=>U.type===yn.output?ce.source===U.id&&ce.target===K.id:ce.source===K.id&&ce.target===U.id)){c.value=null,r.value=!1;return}const Q={id:Mf(),source:U.type===yn.output?U.id:K.id,target:U.type===yn.input?U.id:K.id};t("on-connection-created",Q),c.value=null,r.value=!1},_=j=>{const K=document.querySelector(`[data-node-id="${j}"]`);return K?{width:K.offsetWidth+2,height:K.offsetHeight+2}:{width:0,height:0}},v=(j,K)=>{const ee=i.canvas.width,U=i.canvas.height,{width:q,height:Q}=_(K);return{x:Math.max(2,Math.min(j.x,ee-q)),y:Math.max(2,Math.min(j.y,U-Q))}},C=j=>{var K,ee;if(a.value&&!r.value){let U={x:j.clientX-l.value.x,y:j.clientY-l.value.y};U=v(U,a.value.id),t("on-node-moved",{...a.value,position:U})}c.value&&(c.value.mousePosition={x:j.clientX-(((K=s.value)==null?void 0:K.getBoundingClientRect().left)||0),y:j.clientY-(((ee=s.value)==null?void 0:ee.getBoundingClientRect().top)||0)})},S=()=>{if(!c.value)return"";const{sourcePortPosition:j,mousePosition:K}=c.value,ee=f(j,K);return`M ${j.x} ${j.y} C ${ee.c1.x} ${ee.c1.y} ${ee.c2.x} ${ee.c2.y} ${K.x} ${K.y}`},w=j=>{const K=u(i.nodes.find(ie=>ie.ports.find(Ce=>Ce.id===j.source)),j.source),ee=u(i.nodes.find(ie=>ie.ports.find(Ce=>Ce.id===j.target)),j.target),U=8,q=K.x+U,Q=ee.x-U,ce=f({x:q,y:K.y},{x:Q,y:ee.y});return`M ${q} ${K.y} C ${ce.c1.x} ${ce.c1.y} ${ce.c2.x} ${ce.c2.y} ${Q} ${ee.y}`},L=(j,K)=>{r.value||(d.value=null,o.value=!0,a.value=j,l.value={x:K.clientX-j.position.x,y:K.clientY-j.position.y})},I=j=>{d.value=null,t("on-node-selected",j)},N=()=>{a.value=null,o.value=!1},R=()=>{(a.value||r.value)&&N()},T=j=>{j.dataTransfer.dropEffect="copy"},A=async j=>{var K,ee,U,q,Q,ce;const ie=j.dataTransfer.getData("application/node");if(ie)try{const Ce=JSON.parse(ie),ae=(ee=(K=s.value)==null?void 0:K.parentElement)==null?void 0:ee.getBoundingClientRect();if(!ae)return;const be=((q=(U=s.value)==null?void 0:U.parentElement)==null?void 0:q.scrollLeft)||0,De=((ce=(Q=s.value)==null?void 0:Q.parentElement)==null?void 0:ce.scrollTop)||0;let Te={x:j.clientX-ae.left+be,y:j.clientY-ae.top+De};const xe={...Ce,position:Te},ze=xe.ports.map(Le=>Le.required?{...Le,validated:{valid:!1,message:P("workflow.validated.required")}}:Le),Qe={...xe,ports:ze};t("on-node-added",Qe),await nextTick$1();const qe=v(Te,xe.id);(qe.x!==Te.x||qe.y!==Te.y)&&t("on-node-moved",{...xe,position:qe})}catch(Ce){console.error("Error parsing drop data:",Ce)}},F=j=>{d.value=j.id,t("on-node-selected",null)},B=j=>{if(j.key==="Delete"||j.key==="Backspace"){if(i.selectedNodeId){W();return}d.value&&(t("on-connection-removed",d.value),d.value=null)}},W=()=>{if(!i.selectedNodeId)return;const j=i.nodes.find(K=>K.id===i.selectedNodeId);j&&(i.connections.filter(K=>K.source.startsWith(j.id)||K.target.startsWith(j.id)).forEach(K=>{t("on-connection-removed",K.id)}),t("on-node-deleted",j),t("on-node-selected",null))},G=j=>{const K=i.nodes.find(ee=>ee.id===j.id);K&&j.ports.some((ee,U)=>{const q=K.ports[U];return q?JSON.stringify(ee.validated)!==JSON.stringify(q.validated):!0})&&t("on-node-updated",{...K,ports:j.ports.map(ee=>({...ee,id:ee.id.split("-").pop()}))})};return(j,K)=>{const ee=resolveComponent("ShadcnIcon"),U=resolveComponent("ShadcnTooltip");return openBlock(),createElementBlock("div",{class:"w-full h-full overflow-auto outline-none",tabindex:"0",onKeydown:B},[createBaseVNode("div",{ref_key:"canvasRef",ref:s,class:"relative bg-gray-50",style:normalizeStyle$1({width:unref(ke)(j.canvas.width),height:unref(ke)(j.canvas.height)}),onMousemove:C,onMouseup:N,onMouseleave:R,onDragover:withModifiers(T,["prevent"]),onDrop:withModifiers(A,["prevent"])},[j.canvas.showGrid?(openBlock(),createElementBlock("div",{key:0,class:"absolute inset-0",style:normalizeStyle$1({backgroundImage:` + linear-gradient(to right, ${j.canvas.gridColor} 1px, transparent 1px), + linear-gradient(to bottom, ${j.canvas.gridColor} 1px, transparent 1px) + `,backgroundSize:`${unref(ke)(j.canvas.gridSize)} ${unref(ke)(j.canvas.gridSize)}`,opacity:j.canvas.gridOpacity})},null,4)):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(j.nodes,q=>{var Q,ce;return openBlock(),createElementBlock("div",{class:normalizeClass$1(["absolute bg-white rounded-lg shadow-md border",{"ring-2 ring-blue-500":j.selectedNodeId===q.id,"cursor-move":!r.value,"before:absolute before:inset-[0px] before:rounded-lg before:ring-2 before:ring-red-500 before:animate-pulse":q==null?void 0:q.ports.some(ie=>{var Ce;return((Ce=ie==null?void 0:ie.validated)==null?void 0:Ce.valid)===!1})}]),key:q.id,"data-node-id":q.id,style:normalizeStyle$1({transform:`translate(${unref(ke)((Q=q.position)==null?void 0:Q.x)}, ${unref(ke)((ce=q.position)==null?void 0:ce.y)})`}),onClick:ie=>I(q),onMousedown:ie=>L(q,ie)},[createBaseVNode("div",n4,[renderSlot(j.$slots,"node",{node:q},()=>{var ie,Ce;return[createBaseVNode("div",o4,[createBaseVNode("div",a4,toDisplayString$1(q.label),1),(ie=q.configure)!=null&&ie.some(ae=>{var be;return((be=ae==null?void 0:ae.validated)==null?void 0:be.valid)===!1})?(openBlock(),createElementBlock("div",r4,[createVNode(U,{content:(Ce=q.configure)==null?void 0:Ce.filter(ae=>(ae==null?void 0:ae.validated.valid)===!1).map(ae=>`${ae.label}: ${ae.validated.message}`).join("
    ")},{default:withCtx(()=>[createVNode(ee,{icon:"CircleAlert"})]),_:2},1032,["content"])])):createCommentVNode("",!0)])]}),createVNode(Nf,{node:q,disabled:o.value,connections:j.connections,onOnConnectionStart:(ie,Ce)=>g(ie,Ce,q),onOnConnectionEnd:(ie,Ce)=>m(ie,Ce,q),onOnValidationChange:G},null,8,["node","disabled","connections","onOnConnectionStart","onOnConnectionEnd"])])],46,t4)}),128)),(openBlock(),createElementBlock("svg",l4,[createBaseVNode("g",null,[c.value?(openBlock(),createElementBlock("path",{key:0,class:normalizeClass$1(["animate-pulse",c.value.isValid?"stroke-blue-500":"stroke-red-500"]),fill:"none","stroke-dasharray":"4","stroke-width":"2",d:S()},null,10,s4)):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(j.connections,q=>(openBlock(),createElementBlock("g",{key:q.id},[createBaseVNode("path",{stroke:"transparent",class:"cursor-pointer hover:stroke-blue-200",style:{"pointer-events":"all"},"stroke-width":"4",fill:"none",d:w(q),onClick:withModifiers(Q=>F(q),["stop"])},null,8,i4),createBaseVNode("path",{fill:"none","stroke-width":"2",d:w(q),class:normalizeClass$1(d.value===q.id?"stroke-blue-500":"stroke-gray-400")},null,10,u4)]))),128))])]))],36)],32)}}}),c4={class:"space-y-2"},f4={class:"space-y-2"},p4={class:"flex-1 flex gap-2"},h4=["onUpdate:modelValue","placeholder","disabled","name","onInput","onBlur"],m4=["onUpdate:modelValue","disabled","placeholder","onInput"],v4={key:0,class:"text-red-500 text-sm"},g4={key:1,class:"text-red-500 text-sm"},If=defineComponent({__name:"ShadcnMap",props:{modelValue:{default:()=>[]},size:{default:"default"},type:{default:"primary"},disabled:{type:Boolean,default:!1},max:{default:1/0},name:{default:void 0}},emits:["update:modelValue","on-add","on-remove","on-change"],setup(n,{emit:e}){const t=e,i=n,s=computed(()=>i.size),r=ref({}),o=ref({}),a=inject(`form-item-${i.name}`,null),l=computed(()=>i.max!==void 0&&i.modelValue.length>=i.max),c=g=>{const m=i.modelValue.map(_=>_.key);r.value={},o.value={},m.forEach((_,v)=>{(_===void 0||_==="")&&(o.value[v]=!0),_&&m.indexOf(_)!==v&&(r.value[v]=!0,r.value[m.indexOf(_)]=!0)}),a&&a.onBlur()},d=()=>{if(i.disabled||l.value)return;const g={key:void 0,value:void 0},m=[...i.modelValue,g];t("update:modelValue",m),t("on-add",g),t("on-change",m),a&&a.onBlur()},u=g=>{if(i.disabled)return;const m=i.modelValue[g],_=i.modelValue.filter((v,C)=>C!==g);t("update:modelValue",_),t("on-remove",m),t("on-change",_),c(),a&&a.onBlur()},f=(g,m,_)=>{if(i.disabled)return;const v=_.target,C=[...i.modelValue];C[g]={...C[g],[m]:v.value},t("update:modelValue",C),t("on-change",C),m==="key"&&c(),a&&a.onBlur()};return watch(()=>i.modelValue.length,g=>{a&&g===0&&a.onBlur()}),watch(()=>i.modelValue,()=>{i.modelValue.forEach((g,m)=>{c()})},{deep:!0}),(g,m)=>{const _=resolveComponent("ShadcnIcon");return openBlock(),createElementBlock("div",c4,[createBaseVNode("div",f4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(g.modelValue,(v,C)=>(openBlock(),createElementBlock("div",{class:"flex gap-2 items-start group",key:C},[createBaseVNode("div",p4,[createBaseVNode("div",{class:normalizeClass$1(["flex-1 border rounded-md transition-colors duration-300",[unref(Oo)[s.value],unref(ho)[g.type],{"border-red-500 animate-pulse":r.value[C]||o.value[C]}]])},[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":S=>v.key=S,type:"text",class:normalizeClass$1(["w-full h-full bg-transparent border-none focus:outline-none px-2",{"cursor-not-allowed opacity-50 bg-gray-100":g.disabled}]),placeholder:unref(P)("map.placeholder.key"),disabled:g.disabled,name:g.name,onInput:S=>f(C,"key",S),onBlur:S=>c()},null,42,h4),[[vModelText,v.key]])],2),createBaseVNode("div",{class:normalizeClass$1(["flex-1 border rounded-md transition-colors duration-300",[unref(Oo)[s.value],unref(ho)[g.type]]])},[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":S=>v.value=S,type:"text",class:normalizeClass$1(["w-full h-full bg-transparent border-none focus:outline-none px-2",{"cursor-not-allowed opacity-50 bg-gray-100":g.disabled}]),disabled:g.disabled,placeholder:unref(P)("map.placeholder.value"),onInput:S=>f(C,"value",S)},null,42,m4),[[vModelText,v.value]])],2)]),g.disabled?createCommentVNode("",!0):(openBlock(),createBlock$1(_,{key:0,icon:"CircleX",class:normalizeClass$1(["text-gray-400 transition-opacity duration-200",[unref(Oo)[s.value],"cursor-pointer hover:text-red-500 opacity-0 group-hover:opacity-100"]]),onClick:S=>u(C)},null,8,["class","onClick"]))]))),128))]),Object.values(o.value).some(v=>v)?(openBlock(),createElementBlock("div",v4,toDisplayString$1(unref(P)("map.validated.required")),1)):createCommentVNode("",!0),Object.values(r.value).some(v=>v)?(openBlock(),createElementBlock("div",g4,toDisplayString$1(unref(P)("map.validated.duplicate")),1)):createCommentVNode("",!0),!g.disabled&&!l.value?(openBlock(),createBlock$1(_,{key:2,icon:"CirclePlus",class:normalizeClass$1(["text-blue-600 hover:text-blue-700 focus:outline-none",{"cursor-pointer ":!Object.values(r.value).some(v=>v)&&!Object.values(o.value).some(v=>v)&&!g.disabled},{"cursor-not-allowed opacity-50 text-gray-100":Object.values(r.value).some(v=>v)||Object.values(o.value).some(v=>v)||g.disabled}]),onClick:m[0]||(m[0]=v=>!Object.values(r.value).some(C=>C)&&!Object.values(o.value).some(C=>C)&&d())},null,8,["class"])):createCommentVNode("",!0)])}}}),y4={class:"py-4 pl-4"},b4={key:0,class:"space-y-4"},w4={class:"text-lg font-medium"},x4={class:"overflow-y-auto max-h-[calc(100vh-80px)]"},_4={class:"space-y-3 flex flex-col min-w-0"},C4={class:"flex items-center justify-between"},k4={key:0,class:"cursor-pointer"},$4={key:0,class:"text-red-400 text-xs"},S4={key:1,class:"text-center text-gray-500"},V4=defineComponent({__name:"ShadcnWorkflowConfigure",props:{selectedNode:{},width:{default:300}},emits:["update:node"],setup(n,{emit:e}){const t=e,i=n,s=ref(""),r=ref("basic"),o=ref({position:{x:0,y:0}}),a=computed(()=>{var f,g;return!!((g=(f=i.selectedNode)==null?void 0:f.configure)!=null&&g.length)}),l=ref({}),c=f=>{var g;const m=[...f.required&&!((g=f.rules)!=null&&g.some(C=>C.required))?[{required:!0,message:P("workflow.validated.required")}]:[],...f.rules||[]];let _=!0,v="";for(const C of m)if(C.required){if(f.type==="array"){if(!Array.isArray(f.value)||f.value.length===0){_=!1,v=C.message;break}}else if(!f.value){_=!1,v=C.message;break}}l.value[f.field]={valid:_,message:v},f.validated={valid:_,message:v}};watch(()=>{var f;return(f=i.selectedNode)==null?void 0:f.configure},f=>{f&&f.forEach(g=>{c(g)})},{immediate:!0}),watch(()=>i.selectedNode,f=>{var g,m;f?(s.value=JSON.stringify(f.data,null,2),o.value={position:{x:((g=f.position)==null?void 0:g.x)||0,y:((m=f.position)==null?void 0:m.y)||0}}):s.value=""},{immediate:!0});const d=(f,g,m)=>Math.min(Math.max(parseInt(f.toString())||0,g),m),u=()=>{var f,g;if(!i.selectedNode)return;const m={x:d(o.value.position.x,0,1920),y:d(o.value.position.y,0,1080)},_=((g=(f=i.selectedNode)==null?void 0:f.configure)==null?void 0:g.map(v=>({[v.field]:v.value})))||[];o.value.position=m,t("update:node",{...i.selectedNode,position:m,data:_})};return(f,g)=>{const m=resolveComponent("ShadcnInput"),_=resolveComponent("ShadcnFormItem"),v=resolveComponent("ShadcnCol"),C=resolveComponent("ShadcnNumber"),S=resolveComponent("ShadcnRow"),w=resolveComponent("ShadcnTabItem"),L=resolveComponent("ShadcnIcon"),I=resolveComponent("ShadcnTooltip"),N=resolveComponent("ShadcnSwitch"),R=resolveComponent("ShadcnRadio"),T=resolveComponent("ShadcnRadioGroup"),A=resolveComponent("ShadcnCheckbox"),F=resolveComponent("ShadcnCheckboxGroup"),B=resolveComponent("ShadcnSelectOption"),W=resolveComponent("ShadcnSelect"),G=resolveComponent("ShadcnSlider"),j=resolveComponent("ShadcnRate"),K=resolveComponent("ShadcnInputTag"),ee=resolveComponent("ShadcnTab");return openBlock(),createElementBlock("div",y4,[f.selectedNode?(openBlock(),createElementBlock("div",b4,[createBaseVNode("h3",w4,toDisplayString$1(unref(P)("dataBuilder.text.configureCenter")),1),createVNode(ee,{modelValue:r.value,"onUpdate:modelValue":g[3]||(g[3]=U=>r.value=U),direction:"vertical",position:"right"},{default:withCtx(()=>[createVNode(w,{label:String(unref(P)("workflow.text.nodeConfigure")),value:"basic"},{default:withCtx(()=>[createVNode(S,{gutter:10},{default:withCtx(()=>[createVNode(v,{span:"12"},{default:withCtx(()=>[createVNode(_,{label:String(unref(P)("workflow.text.nodeId")),name:"nodeId"},{default:withCtx(()=>[createVNode(m,{modelValue:f.selectedNode.id,"onUpdate:modelValue":g[0]||(g[0]=U=>f.selectedNode.id=U),disabled:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),createVNode(v,{class:"my-2",span:"6"},{default:withCtx(()=>[createVNode(_,{label:String(unref(P)("dataBuilder.text.xCoordinate")),name:"x"},{default:withCtx(()=>[createVNode(C,{modelValue:o.value.position.x,"onUpdate:modelValue":g[1]||(g[1]=U=>o.value.position.x=U),min:0,onOnChange:u},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),createVNode(v,{class:"my-2",span:"6"},{default:withCtx(()=>[createVNode(_,{label:String(unref(P)("dataBuilder.text.yCoordinate")),name:"y"},{default:withCtx(()=>[createVNode(C,{modelValue:o.value.position.y,"onUpdate:modelValue":g[2]||(g[2]=U=>o.value.position.y=U),min:0,onOnChange:u},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["label"]),a.value?(openBlock(),createBlock$1(w,{key:0,class:"space-y-3",label:String(unref(P)("workflow.text.dataConfigure")),value:"configure"},{default:withCtx(()=>[createBaseVNode("div",x4,[createBaseVNode("div",_4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(f.selectedNode.configure,U=>{var q;return openBlock(),createElementBlock("div",{class:"space-y-1.5",key:U.label},[createBaseVNode("div",C4,[createBaseVNode("span",null,toDisplayString$1(U.label),1),U.description?(openBlock(),createElementBlock("span",k4,[createVNode(I,{content:U.description},{default:withCtx(()=>[createVNode(L,{icon:"CircleHelp",size:"18"})]),_:2},1032,["content"])])):createCommentVNode("",!0)]),renderSlot(f.$slots,`configure-${U.type}`,{item:U,onChange:()=>{c(U),u()},validation:l.value[U.field]},()=>{var Q,ce,ie,Ce,ae,be,De,Te,xe,ze,Qe,qe;return[U.type==="number"?(openBlock(),createBlock$1(C,{key:0,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((Q=l.value[U.field])!=null&&Q.valid)}),clearable:U.clearable,disabled:U.disabled,max:U.max,min:U.min,name:U.label,placeholder:U.placeholder,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","clearable","disabled","max","min","name","placeholder","onOnChange"])):U.type==="textarea"?(openBlock(),createBlock$1(m,{key:1,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((ce=l.value[U.field])!=null&&ce.valid)}),disabled:U.disabled,"max-count":U.maxCount,name:U.label,placeholder:U.placeholder,"word-count":U.wordCount,type:"textarea",onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","max-count","name","placeholder","word-count","onOnChange"])):U.type==="password"?(openBlock(),createBlock$1(m,{key:2,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((ie=l.value[U.field])!=null&&ie.valid)}),disabled:U.disabled,name:U.label,placeholder:U.placeholder,type:"password",onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","name","placeholder","onOnChange"])):U.type==="switch"?(openBlock(),createBlock$1(N,{key:3,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((Ce=l.value[U.field])!=null&&Ce.valid)}),disabled:U.disabled,"false-value":U.falseValue,name:U.label,"true-value":U.trueValue,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","false-value","name","true-value","onOnChange"])):U.type==="radio"?(openBlock(),createBlock$1(T,{key:4,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((ae=l.value[U.field])!=null&&ae.valid)}),onOnChange:()=>{c(U),u()}},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(U.options,Le=>(openBlock(),createBlock$1(R,{key:Le,disabled:Le.disabled,value:Le.value},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Le.label),1)]),_:2},1032,["disabled","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","onOnChange"])):U.type==="checkbox"?(openBlock(),createBlock$1(F,{key:5,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((be=l.value[U.field])!=null&&be.valid)}),onOnChange:()=>{c(U),u()}},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(U.options,Le=>(openBlock(),createBlock$1(A,{key:Le,disabled:Le.disabled,value:Le.value},{default:withCtx(()=>[createTextVNode(toDisplayString$1(Le.label),1)]),_:2},1032,["disabled","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","onOnChange"])):U.type==="select"?(openBlock(),createBlock$1(W,{key:6,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((De=l.value[U.field])!=null&&De.valid)}),disabled:U.disabled,name:U.label,placeholder:U.placeholder,onOnChange:()=>{c(U),u()}},{options:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(U.options,Le=>(openBlock(),createBlock$1(B,{key:Le.value,disabled:Le.disabled,label:Le.label,value:Le.value},null,8,["disabled","label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled","name","placeholder","onOnChange"])):U.type==="slider"?(openBlock(),createBlock$1(G,{key:7,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((Te=l.value[U.field])!=null&&Te.valid)}),disabled:U.disabled,max:U.max,min:U.min,"show-step":U.showStep,"show-tip":U.showTip,step:U.step,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","max","min","show-step","show-tip","step","onOnChange"])):U.type==="rate"?(openBlock(),createBlock$1(j,{key:8,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,"allow-half":U.allowHalf,class:normalizeClass$1({"border-red-500":!((xe=l.value[U.field])!=null&&xe.valid)}),disabled:U.disabled,max:U.max,min:U.min,"show-text":U.showText,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","allow-half","class","disabled","max","min","show-text","onOnChange"])):U.type==="array"?(openBlock(),createBlock$1(K,{key:9,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((ze=l.value[U.field])!=null&&ze.valid)}),disabled:U.disabled,name:U.label,placeholder:U.placeholder,style:normalizeStyle$1({width:`${unref(ke)(Number(f.width)-60)}`}),onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","name","placeholder","style","onOnChange"])):U.type==="map"?(openBlock(),createBlock$1(unref(If),{key:10,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((Qe=l.value[U.field])!=null&&Qe.valid)}),disabled:U.disabled,name:U.label,placeholder:U.placeholder,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","name","placeholder","onOnChange"])):(openBlock(),createBlock$1(m,{key:11,modelValue:U.value,"onUpdate:modelValue":Le=>U.value=Le,class:normalizeClass$1({"border-red-500":!((qe=l.value[U.field])!=null&&qe.valid)}),disabled:U.disabled,name:U.label,placeholder:U.placeholder,onOnChange:()=>{c(U),u()}},null,8,["modelValue","onUpdate:modelValue","class","disabled","name","placeholder","onOnChange"]))]}),(q=l.value[U.field])!=null&&q.valid?createCommentVNode("",!0):(openBlock(),createElementBlock("span",$4,toDisplayString$1(l.value[U.field].message),1))])}),128))])])]),_:3},8,["label"])):createCommentVNode("",!0)]),_:3},8,["modelValue"])])):(openBlock(),createElementBlock("div",S4,toDisplayString$1(unref(P)("workflow.placeholder.selectNode")),1))])}}}),E4={class:"flex w-full h-screen"},T4=defineComponent({__name:"ShadcnWorkflowEditor",props:{modelValue:{default:()=>({nodes:[],connections:[]})},nodes:{default:()=>[]},connections:{default:()=>[]},categories:{default:()=>[]},searchText:{default:""},panelWidth:{default:250},configureWidth:{default:300}},emits:["update:modelValue","update:searchText","on-node-moved","on-node-added","on-node-selected","on-node-deleted","on-connection-created","on-connection-removed"],setup(n,{emit:e}){const t=e,i=n,s=ref([]),r=ref([]),o=ref();watch(()=>i.modelValue,v=>{v&&(s.value=v.nodes,r.value=v.connections)},{deep:!0}),watch([s,r],([v,C])=>{const S={nodes:v.map(L=>({id:L.id,tid:L.tid,category:L.category,position:L.position,key:L.key,data:L.data&&L.data.length>0?L.data.reduce((I,N)=>({...I,...N}),{}):L.data})),connections:C},w=m(v);t("update:modelValue",{nodes:v,connections:C,data:S,validation:w})},{deep:!0});const a=v=>{const C=s.value.findIndex(S=>S.id===v.id);C!==-1&&(s.value[C]=v),t("on-node-moved",v)},l=v=>{s.value.push(v),o.value=v,t("on-node-added",v)},c=v=>{r.value.push(v),t("on-connection-created",v)},d=v=>{r.value=r.value.filter(C=>C.id!==v),t("on-connection-removed",v)},u=v=>{const C=s.value.findIndex(S=>S.id===v.id);C!==-1&&(s.value[C]=v)},f=v=>{o.value=v,t("on-node-selected",v)},g=v=>{s.value=s.value.filter(C=>C.id!==v.id),t("on-node-deleted",v)},m=v=>{const C=[];return v.forEach(S=>{S.configure&&S.configure.forEach(w=>{w.validated&&!w.validated.valid&&C.push({type:"configure",scope:w.field,message:w.validated.message})}),S.ports&&S.ports.forEach(w=>{w.validated&&!w.validated.valid&&C.push({type:"port",scope:w.id,message:w.validated.message})})}),C},_=(v,C)=>C.map(S=>{const w=v.find(I=>I.id===S.tid);let L=S.configure||[];return w!=null&&w.configure&&(L=w==null?void 0:w.configure.map(I=>({...I,value:S.data&&S.data[I.field]!==void 0?S.data[I.field]:I.value}))),w?{...w,id:S.id,position:S.position,data:S.data||{},category:S.category,ports:w.ports,configure:L,validation:w.validation}:S});return onMounted(()=>{i.modelValue&&(s.value=_(i.nodes,i.modelValue.nodes),r.value=i.modelValue.connections)}),watch(()=>{var v;return(v=i.modelValue)==null?void 0:v.nodes},(v,C)=>{!v||JSON.stringify(v)===JSON.stringify(C)||(s.value=_(i.nodes,v))}),watch(()=>{var v;return(v=i.modelValue)==null?void 0:v.connections},v=>{v&&(r.value=v)}),(v,C)=>{var S;return openBlock(),createElementBlock("div",E4,[createVNode(HS,{class:"border-r",categories:i.categories,nodes:i.nodes,"search-text":i.searchText,style:normalizeStyle$1({width:unref(ke)(v.panelWidth)}),"onUpdate:searchText":C[0]||(C[0]=w=>t("update:searchText",w))},{search:withCtx(()=>[renderSlot(v.$slots,"panel-search")]),"category-header":withCtx(({category:w})=>[renderSlot(v.$slots,"panel-category-header",{category:w})]),node:withCtx(({node:w,onDragStart:L})=>[renderSlot(v.$slots,"panel-node",{node:w,onDragStart:L})]),bottom:withCtx(()=>[renderSlot(v.$slots,"panel-bottom")]),_:3},8,["categories","nodes","search-text","style"]),createVNode(d4,{class:"flex-1",nodes:s.value,connections:r.value,"selected-node-id":(S=o.value)==null?void 0:S.id,onOnNodeMoved:a,onOnNodeAdded:l,onOnNodeSelected:f,onOnConnectionCreated:c,onOnConnectionRemoved:d,onOnNodeDeleted:g,onOnNodeUpdated:u},{node:withCtx(({node:w})=>[renderSlot(v.$slots,"canvas-node",{node:w})]),_:3},8,["nodes","connections","selected-node-id"]),createVNode(V4,{class:"border-l","selected-node":o.value,width:v.configureWidth,style:normalizeStyle$1({width:unref(ke)(v.configureWidth)}),"onUpdate:node":u},createSlots({_:2},[renderList(v.$slots,(w,L)=>({name:L,fn:withCtx(I=>[renderSlot(v.$slots,L,normalizeProps(guardReactiveProps(I)))])}))]),1032,["selected-node","width","style"])])}}}),R4={class:"w-full h-full overflow-auto outline-none"},A4=["data-node-id"],M4={class:"px-2 pt-1.5 pb-1.5"},N4={class:"w-full flex items-center justify-between border-b"},I4={class:"w-full text-xs text-gray-500 py-1.5"},L4={style:{width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},class:"absolute inset-0"},O4=["d"],B4=defineComponent({__name:"ShadcnWorkflowView",props:{nodes:{},data:{default:()=>({nodes:[],connections:[]})},canvas:{default:()=>({color:"#f3f4f6",showGrid:!0,gridColor:"rgba(0, 0, 0, 0.1)",gridSize:20,gridOpacity:.5,pattern:"grid",width:1920,height:1080})}},setup(n){const e=n,t=ref(null),i=computed(()=>s(e.nodes,e.data)),s=(c,d)=>{const u={},f=["label","category","description","ports","configure"];c.forEach(m=>{u[m.id]={},f.forEach(_=>{m[_]!==void 0&&(u[m.id][_]=m[_])})});const g={...d};return g.nodes=d.nodes.map(m=>{const _=u[m.tid];return _?{...m,..._}:m}),g},r=(c,d)=>{var u;const f=document.querySelector(`[data-port-id="${d}"]`);if(!f)return{x:0,y:0};const g=f.getBoundingClientRect(),m=(u=t.value)==null?void 0:u.getBoundingClientRect();return m?{x:g.left+g.width/2-m.left,y:g.top+g.height/2-m.top}:{x:0,y:0}},o=(c,d)=>{const u=Math.abs(d.x-c.x);return{c1:{x:c.x+u/2,y:c.y},c2:{x:d.x-u/2,y:d.y}}},a=c=>{const d=r(i.value.nodes.find(v=>v.ports.find(C=>`${v.id}-${C.id}`===c.source)),c.source),u=r(i.value.nodes.find(v=>v.ports.find(C=>`${v.id}-${C.id}`===c.target)),c.target),f=8,g=d.x+f,m=u.x-f,_=o({x:g,y:d.y},{x:m,y:u.y});return`M ${g} ${d.y} C ${_.c1.x} ${_.c1.y} ${_.c2.x} ${_.c2.y} ${m} ${u.y}`},l=ref({});return onMounted(()=>{e.data.connections.forEach(c=>{l.value[c.id]=a(c)})}),(c,d)=>(openBlock(),createElementBlock("div",R4,[createBaseVNode("div",{ref_key:"canvasRef",ref:t,style:normalizeStyle$1({width:unref(ke)(c.canvas.width),height:unref(ke)(c.canvas.height)}),class:"relative bg-gray-50"},[c.canvas.showGrid?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle$1({backgroundImage:` + linear-gradient(to right, ${c.canvas.gridColor} 1px, transparent 1px), + linear-gradient(to bottom, ${c.canvas.gridColor} 1px, transparent 1px) + `,backgroundSize:`${unref(ke)(c.canvas.gridSize)} ${unref(ke)(c.canvas.gridSize)}`,opacity:c.canvas.gridOpacity}),class:"absolute inset-0"},null,4)):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(i.value.nodes,u=>{var f,g;return openBlock(),createElementBlock("div",{key:u.id,"data-node-id":u.id,style:normalizeStyle$1({transform:`translate(${unref(ke)((f=u.position)==null?void 0:f.x)}, ${unref(ke)((g=u.position)==null?void 0:g.y)})`}),class:"absolute bg-white rounded-lg shadow-md border"},[createBaseVNode("div",M4,[renderSlot(c.$slots,"node",{node:u},()=>[createBaseVNode("div",N4,[createBaseVNode("div",I4,toDisplayString$1(u.label),1)])]),createVNode(Nf,{connections:i.value.connections,disabled:!0,node:u},null,8,["connections","node"])])],12,A4)}),128)),(openBlock(),createElementBlock("svg",L4,[createBaseVNode("g",null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(c.data.connections,u=>(openBlock(),createElementBlock("g",{key:u.id},[createBaseVNode("path",{d:l.value[u.id],class:"stroke-gray-400",fill:"none","stroke-width":"2"},null,8,O4)]))),128))])]))],4)]))}}),D4=["disabled","onClick"],P4=["placeholder","disabled","name"],F4=defineComponent({__name:"ShadcnInputTag",props:{modelValue:{default:()=>[]},placeholder:{default:P("inputTag.text.placeholder")},name:{default:void 0},disabled:{type:Boolean,default:!1},size:{default:"default"},type:{default:"primary"},max:{default:1/0}},emits:["update:modelValue","on-add","on-remove","on-change"],setup(n,{emit:e}){const t=e,i=n,s=computed(()=>i.size),r=ref(null),o=ref(null),a=ref(""),l=ref(null),c=i.name?inject(`form-item-${i.name}`):null,d=C=>C===l.value,u=C=>{l.value=C,setTimeout(()=>{l.value===C&&(l.value=null)},1e3)},f=computed(()=>!i.disabled&&a.value.trim()!==""&&i.modelValue.length{if(f.value){const C=a.value.trim();if(i.modelValue.includes(C)){u(C);return}const S=[...i.modelValue,C];t("update:modelValue",S),t("on-add",C),t("on-change",S),a.value="",c&&c.onBlur(),nextTick$1(()=>{if(r.value){const w=r.value;w.scrollLeft=w.scrollWidth-w.clientWidth}})}},m=C=>{const S=i.modelValue.filter(w=>w!==C);t("update:modelValue",S),t("on-remove",C),t("on-change",S),C===l.value&&(l.value=null),c&&c.onBlur()},_=()=>{c&&c.onBlur()},v=C=>{if(C.key==="Enter"||C.key===",")C.preventDefault(),g();else if(C.key==="Backspace"&&a.value===""&&i.modelValue.length>0){const S=i.modelValue[i.modelValue.length-1];m(S)}};return(C,S)=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["flex px-2 border rounded-md",[unref(Oo)[s.value],[unref(ho)[C.type]],{"cursor-not-allowed opacity-50 bg-gray-100":C.disabled}]])},[createBaseVNode("div",{class:"flex gap-2 w-full overflow-x-auto py-1 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",ref_key:"containerRef",ref:r},[(openBlock(!0),createElementBlock(Fragment,null,renderList(C.modelValue,w=>(openBlock(),createElementBlock("div",{class:normalizeClass$1(["flex items-center gap-1 px-1 py-0.5 text-sm rounded-md whitespace-nowrap transition-colors duration-300",{"bg-primary/10 text-primary":!d(w),"bg-red-100 text-red-600 animate-pulse":d(w)}]),key:w},[createBaseVNode("span",null,toDisplayString$1(w),1),createBaseVNode("button",{type:"button",class:normalizeClass$1(["hover:text-primary/80 focus:outline-none",{"text-primary":!d(w),"text-red-600":d(w)}]),disabled:C.disabled,onClick:L=>m(w)},S[2]||(S[2]=[createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[createBaseVNode("path",{d:"M18 6 6 18"}),createBaseVNode("path",{d:"m6 6 12 12"})],-1)]),10,D4)],2))),128)),withDirectives(createBaseVNode("input",{"onUpdate:modelValue":S[0]||(S[0]=w=>a.value=w),ref_key:"inputRef",ref:o,class:normalizeClass$1(["flex-1 min-w-[100px] bg-transparent border-none focus:outline-none text-sm",{"cursor-not-allowed opacity-50 bg-gray-100":C.disabled}]),type:"text",placeholder:C.modelValue.length===0?C.placeholder:"",disabled:C.disabled||C.modelValue.length>=C.max,name:C.name,onKeydown:v,onBlur:_,onKeypress:S[1]||(S[1]=withKeys(withModifiers(()=>{},["prevent"]),["enter"]))},null,42,P4),[[vModelText,a.value]])],512)],2))}}),U4={class:"w-full bg-gray-200 overflow-hidden"},z4=["aria-valuenow"],Lf=defineComponent({__name:"ShadcnLoadingBar",props:{modelValue:{default:0},height:{default:2},color:{default:"#2563eb"},duration:{default:300},animate:{type:Boolean,default:!0},status:{default:"default"}},emits:["update:modelValue","on-complete"],setup(n,{emit:e}){const t=e,i=n,s=a=>{switch(a){case"success":return"#22c55e";case"error":return"#ef4444";default:return i.color}},r=computed(()=>({height:ke(i.height),width:`${i.modelValue}%`,backgroundColor:s(i.status),transition:i.animate?`width ${Number(i.duration)}ms ease-in-out, background-color ${Number(i.duration)}ms ease-in-out`:"none"})),o=computed(()=>({"transition-colors":i.animate}));return watch(()=>i.modelValue,a=>{a===100&&setTimeout(()=>{t("on-complete")},Number(i.duration))}),(a,l)=>(openBlock(),createElementBlock("div",U4,[createBaseVNode("div",{role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":a.modelValue,style:normalizeStyle$1(r.value),class:normalizeClass$1(o.value)},null,14,z4)]))}}),W4={class:"relative"},H4=defineComponent({__name:"ShadcnFloatButton",props:{position:{default:"bottom-right"},circle:{type:Boolean,default:!1},top:{default:40},right:{default:40},bottom:{default:40},left:{default:40},trigger:{default:"hover"}},emits:["on-menu-visible"],setup(n,{emit:e}){const t=n,i=e,s=ref(!1),r=ref(null),o=computed(()=>{switch(t.position){case"top-left":return{top:ke(t.top),left:ke(t.left)};case"top-right":return{top:ke(t.top),right:ke(t.right)};case"bottom-left":return{bottom:ke(t.bottom),left:ke(t.left)};case"bottom-right":default:return{bottom:ke(t.bottom),right:ke(t.right)}}}),a=computed(()=>o.value),l=computed(()=>{switch(t.position){case"top-left":return"mt-12 ml-0";case"top-right":return"mt-12 mr-0";case"bottom-left":return"mb-12 ml-0";case"bottom-right":default:return"mb-12 mr-0"}}),c=()=>{t.trigger==="click"&&v()},d=()=>{t.trigger==="hover"&&(f(),m())},u=()=>{t.trigger==="hover"&&g()},f=()=>{r.value&&(clearTimeout(r.value),r.value=null)},g=()=>{f(),r.value=setTimeout(()=>{_()},200)},m=()=>{s.value=!0,i("on-menu-visible",!0)},_=()=>{s.value=!1,i("on-menu-visible",!1)},v=()=>{s.value=!s.value,i("on-menu-visible",s.value)};return(C,S)=>(openBlock(),createElementBlock("div",W4,[createBaseVNode("button",{class:normalizeClass$1(["fixed flex items-center justify-center p-2 border shadow-md transition-all duration-300 hover:scale-105",C.circle&&"rounded-full"]),style:normalizeStyle$1(o.value),onClick:c,onMouseenter:d,onMouseleave:u},[C.$slots.icon?renderSlot(C.$slots,"icon",{key:0}):renderSlot(C.$slots,"default",{key:1})],38),createVNode(Transition,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-150","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:withCtx(()=>[s.value&&C.$slots.menu?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["fixed z-50 bg-white border rounded shadow-lg",l.value]),style:normalizeStyle$1(a.value),onMouseenter:d,onMouseleave:g},[renderSlot(C.$slots,"menu")],38)):createCommentVNode("",!0)]),_:3})]))}}),G4={class:"w-full space-y-1"},q4={class:"flex flex-col gap-2"},j4={class:"flex-shrink-0"},Y4={key:0,class:"text-red-500 text-sm mt-1"},K4={class:"flex-shrink-0"},J4={key:0,class:"text-red-500 text-sm mt-1"},X4={key:0,class:"flex flex-col"},Z4={class:"condition-value"},Q4={key:1,class:"h-10 flex items-center"},eV={key:3,class:"flex items-center gap-2"},tV={key:4,class:"flex items-center gap-2"},nV={key:0,class:"text-red-500 text-sm mt-1"},oV={class:"flex-shrink-0 pt-2"},aV={class:"flex items-center gap-2 text-blue-500 -ml-4"},rV=defineComponent({__name:"ShadcnDataFilter",props:{modelValue:{},operators:{default:()=>[]},fields:{default:()=>[]}},emits:["update:modelValue","on-change","on-add-condition","on-remove-condition","on-validation-change"],setup(n,{expose:e,emit:t}){const i=t,s=n,r=ref([]),o=computed(()=>r.value.length===0),a=(R,T)=>r.value.some(A=>A.fieldIndex===R&&A.field===T),l=(R,T)=>{var A;return(A=r.value.find(F=>F.fieldIndex===R&&F.field===T))==null?void 0:A.message},c=computed(()=>s.operators.length>0?s.operators:[{label:P("dataFilter.text.eq"),value:"eq",scope:["string","number","date","boolean"]},{label:P("dataFilter.text.neq"),value:"neq",scope:["string","number","date","boolean"]},{label:P("dataFilter.text.gt"),value:"gt",scope:["number","date"]},{label:P("dataFilter.text.gte"),value:"gte",scope:["number","date"]},{label:P("dataFilter.text.lt"),value:"lt",scope:["number","date"]},{label:P("dataFilter.text.lte"),value:"lte",scope:["number","date"]},{label:P("dataFilter.text.in"),value:"in",scope:["string","number","date"]},{label:P("dataFilter.text.notIn"),value:"notIn",scope:["string","number","date"]},{label:P("dataFilter.text.between"),value:"between",scope:["number","date"]},{label:P("dataFilter.text.notBetween"),value:"notBetween",scope:["number","date"]},{label:P("dataFilter.text.isNull"),value:"isNull",scope:["string","number","date","boolean"]},{label:P("dataFilter.text.isNotNull"),value:"isNotNull",scope:["string","number","date","boolean"]},{label:P("dataFilter.text.like"),value:"like",scope:["string"]},{label:P("dataFilter.text.notLike"),value:"notLike",scope:["string"]},{label:P("dataFilter.text.regex"),value:"regex",scope:["string"]},{label:P("dataFilter.text.notRegex"),value:"notRegex",scope:["string"]},{label:P("dataFilter.text.isTrue"),value:"isTrue",scope:["boolean"]},{label:P("dataFilter.text.isFalse"),value:"isFalse",scope:["boolean"]}]),d=["isNull","isNotNull","isTrue","isFalse"],u=R=>{const T=s.fields.find(A=>A.value===R);return T==null?void 0:T.type},f=R=>{const T=u(R);return T?c.value.filter(A=>A.scope.includes(T)):[]},g=R=>R?!d.includes(R):!0,m=R=>{var T;return(T=f(R)[0])==null?void 0:T.value},_=()=>{var R;const T=((R=s.fields[0])==null?void 0:R.value)||null,A=T?m(T):null,F={field:T,operator:A};return d.includes(A??"")||(F.value=["between","notBetween"].includes(A??"")?[void 0,void 0]:void 0),F},v=(R,T)=>{Array.isArray(R.value)||(R.value=[void 0,void 0]),N()},C=ref([...s.modelValue]);onMounted(()=>{C.value.length===0&&S(),N()}),watch(()=>s.modelValue,R=>{C.value=[...R]},{deep:!0}),watch(()=>C.value.map(R=>({field:R.field,operator:R.operator})),(R,T)=>{C.value.forEach((A,F)=>{var B;const W=R[F],G=T==null?void 0:T[F];if(W.field!==(G==null?void 0:G.field)||W.operator!==(G==null?void 0:G.operator)){const j=f(A.field);j.find(K=>K.value===A.operator)||(A.operator=(B=j[0])==null?void 0:B.value),d.includes(A.operator??"")?delete A.value:["between","notBetween"].includes(A.operator??"")?A.value=[void 0,void 0]:A.value=void 0,N()}})},{deep:!0});const S=()=>{const R=_();C.value.push(R),i("on-add-condition",R),N()},w=R=>{const T=C.value[R];C.value.splice(R,1),i("on-remove-condition",T),N()},L=(R,T)=>{const A=[],F=s.fields.find(B=>B.value===R.field);if(!F)return A.push({fieldIndex:T,field:"field",message:P("dataFilter.validated.invalid")}),A;if(R.field||A.push({fieldIndex:T,field:"field",message:P("dataFilter.validated.required")}),R.operator||A.push({fieldIndex:T,field:"operator",message:P("dataFilter.validated.operatorRequired")}),!g(R.operator))return A;if((R.value===void 0||R.value==="")&&A.push({fieldIndex:T,field:"value",message:P("dataFilter.validated.valueRequired")}),F&&R.value!==void 0&&R.value!=="")switch(F.type){case"number":if(["between","notBetween"].includes(R.operator??"")){const[B,W]=R.value;B===void 0||W===void 0?A.push({fieldIndex:T,field:"value",message:P("dataFilter.validated.rangeRequired")}):B>W&&A.push({fieldIndex:T,field:"value",message:P("dataFilter.validated.invalidRange")})}break;case"date":if(["between","notBetween"].includes(R.operator??"")){const[B,W]=R.value;B&&W&&new Date(B)>new Date(W)&&A.push({fieldIndex:T,field:"value",message:P("dataFilter.validated.invalidDateRange")})}break;case"string":if(R.operator==="regex")try{new RegExp(R.value)}catch{A.push({fieldIndex:T,field:"value",message:P("dataFilter.validated.invalidRegex")})}break}return A},I=()=>{const R=[];return C.value.forEach((T,A)=>{const F=L(T,A);R.push(...F)}),{isValid:R.length===0,errors:R}},N=()=>{const R=I();r.value=R.errors,i("update:modelValue",C.value),i("on-change",C.value),i("on-validation-change",{isValid:R.isValid,errors:R.errors})};return e({validate:()=>{const R=I();return r.value=R.errors,R},isValid:o,validationErrors:r}),(R,T)=>{const A=resolveComponent("ShadcnSelectOption"),F=resolveComponent("ShadcnSelect"),B=resolveComponent("ShadcnNumber"),W=resolveComponent("ShadcnSwitch"),G=resolveComponent("ShadcnInputTag"),j=resolveComponent("ShadcnInput"),K=resolveComponent("ShadcnIcon"),ee=resolveComponent("ShadcnButton");return openBlock(),createElementBlock("div",G4,[createBaseVNode("div",q4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(C.value,(U,q)=>{var Q,ce;return openBlock(),createElementBlock("div",{key:q,class:"flex items-start gap-2 group"},[createBaseVNode("div",j4,[createVNode(F,{modelValue:U.field,"onUpdate:modelValue":ie=>U.field=ie,class:normalizeClass$1(["min-w-48",{"border border-red-500 rounded":a(q,"field")}])},{options:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(R.fields,ie=>(openBlock(),createBlock$1(A,{key:ie.value,value:ie.value,label:ie.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class"]),a(q,"field")?(openBlock(),createElementBlock("div",Y4,toDisplayString$1((Q=r.value[q])==null?void 0:Q.message),1)):createCommentVNode("",!0)]),createBaseVNode("div",K4,[createVNode(F,{modelValue:U.operator,"onUpdate:modelValue":ie=>U.operator=ie,class:normalizeClass$1(["min-w-48",{"border border-red-500 rounded":a(q,"operator")}]),disabled:!U.field,onChange:N},{options:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(f(U.field),ie=>(openBlock(),createBlock$1(A,{key:ie.value,value:ie.value,label:ie.label},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"]),a(q,"operator")?(openBlock(),createElementBlock("div",J4,toDisplayString$1((ce=r.value[q])==null?void 0:ce.message),1)):createCommentVNode("",!0)]),g(U.operator)?(openBlock(),createElementBlock("div",X4,[createBaseVNode("div",Z4,[u(U.field)==="number"&&!["in","notIn","between","notBetween"].includes(U.operator??"")?(openBlock(),createBlock$1(B,{key:0,modelValue:U.value,"onUpdate:modelValue":ie=>U.value=ie,class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),placeholder:unref(P)("dataFilter.placeholder.value"),onOnChange:N},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):u(U.field)==="boolean"?(openBlock(),createElementBlock("div",Q4,[createVNode(W,{modelValue:U.value,"onUpdate:modelValue":ie=>U.value=ie,class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:N},null,8,["modelValue","onUpdate:modelValue","class"])])):["string","number","date"].includes(u(U.field)??"")&&["in","notIn"].includes(U.operator??"")?(openBlock(),createBlock$1(G,{key:2,modelValue:U.value,"onUpdate:modelValue":ie=>U.value=ie,placeholder:unref(P)("dataFilter.placeholder.values"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:N},null,8,["modelValue","onUpdate:modelValue","placeholder","class"])):u(U.field)==="number"&&["between","notBetween"].includes(U.operator??"")?(openBlock(),createElementBlock("div",eV,[createVNode(B,{modelValue:U.value[0],"onUpdate:modelValue":ie=>U.value[0]=ie,placeholder:unref(P)("dataFilter.placeholder.minNumber"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:ie=>v(U)},null,8,["modelValue","onUpdate:modelValue","placeholder","class","onOnChange"]),T[0]||(T[0]=createBaseVNode("span",null,"...",-1)),createVNode(B,{modelValue:U.value[1],"onUpdate:modelValue":ie=>U.value[1]=ie,placeholder:unref(P)("dataFilter.placeholder.maxNumber"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:ie=>v(U)},null,8,["modelValue","onUpdate:modelValue","placeholder","class","onOnChange"])])):u(U.field)==="date"&&["between","notBetween"].includes(U.operator??"")?(openBlock(),createElementBlock("div",tV,[createVNode(j,{modelValue:U.value[0],"onUpdate:modelValue":ie=>U.value[0]=ie,type:"date",placeholder:unref(P)("dataFilter.placeholder.startDate"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:ie=>v(U)},null,8,["modelValue","onUpdate:modelValue","placeholder","class","onOnChange"]),T[1]||(T[1]=createBaseVNode("span",null,"...",-1)),createVNode(j,{modelValue:U.value[1],"onUpdate:modelValue":ie=>U.value[1]=ie,type:"date",placeholder:unref(P)("dataFilter.placeholder.endDate"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),onOnChange:ie=>v(U)},null,8,["modelValue","onUpdate:modelValue","placeholder","class","onOnChange"])])):(openBlock(),createBlock$1(j,{key:5,modelValue:U.value,"onUpdate:modelValue":ie=>U.value=ie,placeholder:unref(P)("dataFilter.placeholder.value"),class:normalizeClass$1({"border border-red-500 rounded.validated":a(q,"value")}),type:u(U.field)==="date"?"date":"text",onOnChange:N},null,8,["modelValue","onUpdate:modelValue","placeholder","class","type"]))]),a(q,"value")?(openBlock(),createElementBlock("div",nV,toDisplayString$1(l(q,"value")),1)):createCommentVNode("",!0)])):createCommentVNode("",!0),createBaseVNode("div",oV,[createVNode(K,{class:"cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity",icon:"Trash",color:"#ef4444",size:"18",onClick:ie=>w(q)},null,8,["onClick"])])])}),128))]),createVNode(ee,{type:"text",onClick:S},{default:withCtx(()=>[createBaseVNode("div",aV,[createVNode(K,{icon:"Plus",size:"16"}),createBaseVNode("span",null,toDisplayString$1(unref(P)("dataFilter.text.addCondition")),1)])]),_:1})])}}}),lV={class:"w-full space-y-4"},sV={class:"space-y-2"},iV={key:0,class:"absolute left-[42px] -top-2 h-full border-l-2 border-emerald-500"},uV={class:"absolute -left-12 top-1/2 -translate-y-1/2"},dV={class:"flex items-start"},cV={key:0,class:"min-w-16"},fV={key:0,class:"w-full"},pV={key:1,class:"flex items-center gap-2 w-full"},hV={class:"ml-5 flex items-center gap-4"},mV={class:"flex items-center gap-1 text-blue-500"},vV={class:"text-sm"},gV={class:"flex items-center gap-1 text-blue-500"},yV={class:"text-sm"},bV=defineComponent({__name:"ShadcnHierarchicalDataFilter",props:{modelValue:{default:()=>[]},fields:{default:()=>[]}},emits:["update:modelValue","on-validation-change"],setup(n,{expose:e,emit:t}){const i=t,s=n,r=ref([{operator:"and",items:[]}]),o=v=>{var C,S;return v.type==="group"?((S=(C=v.value)==null?void 0:C[0])==null?void 0:S.operator)||"and":v.operator||"and"},a=(v,C,S)=>{var w;const L=r.value[v].items[C];L.type==="group"?(w=L.value)!=null&&w[0]&&(L.value[0].operator=S):L.operator=S,g()},l=v=>{const C={type:"condition",value:[],operator:"and",isValid:!1};r.value[v].items.push(C),g()},c=v=>{const C={type:"group",value:[{operator:"and",items:[{type:"condition",value:[],operator:"and",isValid:!1}]}],operator:"and",isValid:!1};r.value[v].items.push(C),g()},d=(v,C)=>{r.value[v].items.splice(C,1),g()},u=(v,C,S)=>{r.value[v].items[C].isValid=S.isValid,m()},f=(v,C,S)=>{r.value[v].items[C].isValid=S.isValid,m()},g=()=>{i("update:modelValue",r.value)},m=()=>{const v=r.value.every(C=>C.items.every(S=>S.isValid!==!1));i("on-validation-change",{isValid:v,errors:[]})},_=v=>{var C,S;return v.type==="group"?((C=v.value)==null?void 0:C.some(w=>{var L;return((L=w.items)==null?void 0:L.length)>1}))||!1:((S=v.value)==null?void 0:S.length)>1||!1};return!s.modelValue||!Array.isArray(s.modelValue)||s.modelValue.length===0?r.value=[{operator:"and",items:[]}]:r.value=JSON.parse(JSON.stringify(s.modelValue)),watch(()=>s.modelValue,v=>{if(v&&Array.isArray(v)&&v.length>0){const C=JSON.stringify(r.value),S=JSON.stringify(v);C!==S&&(r.value=JSON.parse(JSON.stringify(v)))}else(!v||v.length===0)&&(r.value=[{operator:"and",items:[]}])},{deep:!0}),e({validate:()=>({isValid:r.value.every(v=>v.items.every(C=>C.isValid!==!1)),errors:[]})}),(v,C)=>{const S=resolveComponent("ShadcnToggle"),w=resolveComponent("ShadcnToggleGroup"),L=resolveComponent("ShadcnHierarchicalDataFilter",!0),I=resolveComponent("ShadcnDataFilter"),N=resolveComponent("ShadcnIcon"),R=resolveComponent("ShadcnButton");return openBlock(),createElementBlock("div",lV,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(T,A)=>(openBlock(),createElementBlock("div",{key:A},[createBaseVNode("div",sV,[T.items.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(T.items,(F,B)=>(openBlock(),createElementBlock("div",{key:B,class:"relative"},[_(F)?(openBlock(),createElementBlock("div",iV,[createBaseVNode("div",uV,[createVNode(w,{"model-value":o(F),size:"small",class:"border rounded",orientation:"vertical",onOnChange:W=>a(A,B,W)},{default:withCtx(()=>[createVNode(S,{value:"and",class:normalizeClass$1(["px-2 py-0.5 text-xs rounded-none",{"bg-emerald-500 text-white":o(F)==="and"}])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataFilter.text.and")),1)]),_:2},1032,["class"]),createVNode(S,{value:"or",class:normalizeClass$1(["px-2 py-0.5 text-xs rounded-none w-full",{"bg-emerald-500 text-white":o(F)==="or"}])},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("dataFilter.text.or")),1)]),_:2},1032,["class"])]),_:2},1032,["model-value","onOnChange"])])])):createCommentVNode("",!0),createBaseVNode("div",dV,[B>0||A>0?(openBlock(),createElementBlock("div",cV)):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass$1(["flex-1",{"ml-[60px]":B===0&&A===0}])},[F.type==="group"?(openBlock(),createElementBlock("div",fV,[createVNode(L,{modelValue:F.value,"onUpdate:modelValue":W=>F.value=W,fields:v.fields,onOnValidationChange:W=>f(A,B,W)},null,8,["modelValue","onUpdate:modelValue","fields","onOnValidationChange"])])):(openBlock(),createElementBlock("div",pV,[createVNode(I,{modelValue:F.value,"onUpdate:modelValue":W=>F.value=W,fields:v.fields,onOnValidationChange:W=>u(A,B,W)},null,8,["modelValue","onUpdate:modelValue","fields","onOnValidationChange"]),createVNode(N,{class:"cursor-pointer text-gray-400 hover:text-red-600",icon:"Trash",size:"16",onClick:W=>d(A,B)},null,8,["onClick"])]))],2)])]))),128)):createCommentVNode("",!0),createBaseVNode("div",hV,[createVNode(R,{type:"text",onClick:F=>l(A)},{default:withCtx(()=>[createBaseVNode("div",mV,[createVNode(N,{icon:"Plus",size:"14"}),createBaseVNode("span",vV,toDisplayString$1(unref(P)("dataFilter.text.addCondition")),1)])]),_:2},1032,["onClick"]),createVNode(R,{type:"text",onClick:F=>c(A)},{default:withCtx(()=>[createBaseVNode("div",gV,[createVNode(N,{icon:"Plus",size:"14"}),createBaseVNode("span",yV,toDisplayString$1(unref(P)("dataFilter.text.addGroup")),1)])]),_:2},1032,["onClick"])])])]))),128))])}}});var Fo={},wV=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Of={},en={};let ui;const xV=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];en.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17};en.getSymbolTotalCodewords=function(n){return xV[n]};en.getBCHDigit=function(n){let e=0;for(;n!==0;)e++,n>>>=1;return e};en.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');ui=n};en.isKanjiModeEnabled=function(){return typeof ui<"u"};en.toSJIS=function(n){return ui(n)};var jr={};(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+t)}}n.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4},n.from=function(t,i){if(n.isValid(t))return t;try{return e(t)}catch{return i}}})(jr);function Bf(){this.buffer=[],this.length=0}Bf.prototype={get:function(n){const e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)===1},put:function(n,e){for(let t=0;t>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var _V=Bf;function Ea(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}Ea.prototype.set=function(n,e,t,i){const s=n*this.size+e;this.data[s]=t,i&&(this.reservedBit[s]=!0)};Ea.prototype.get=function(n,e){return this.data[n*this.size+e]};Ea.prototype.xor=function(n,e,t){this.data[n*this.size+e]^=t};Ea.prototype.isReserved=function(n,e){return this.reservedBit[n*this.size+e]};var CV=Ea,Df={};(function(n){const e=en.getSymbolSize;n.getRowColCoords=function(t){if(t===1)return[];const i=Math.floor(t/7)+2,s=e(t),r=s===145?26:Math.ceil((s-13)/(2*i-2))*2,o=[s-7];for(let a=1;a=0&&i<=7},n.from=function(i){return n.isValid(i)?parseInt(i,10):void 0},n.getPenaltyN1=function(i){const s=i.size;let r=0,o=0,a=0,l=null,c=null;for(let d=0;d=5&&(r+=e.N1+(o-5)),l=f,o=1),f=i.get(u,d),f===c?a++:(a>=5&&(r+=e.N1+(a-5)),c=f,a=1)}o>=5&&(r+=e.N1+(o-5)),a>=5&&(r+=e.N1+(a-5))}return r},n.getPenaltyN2=function(i){const s=i.size;let r=0;for(let o=0;o=10&&(o===1488||o===93)&&r++,a=a<<1&2047|i.get(c,l),c>=10&&(a===1488||a===93)&&r++}return r*e.N3},n.getPenaltyN4=function(i){let s=0;const r=i.data.length;for(let o=0;o=0;){const r=s[0];for(let a=0;a0){const s=new Uint8Array(this.degree);return s.set(t,i),s}return t};var $V=di,Wf={},Zn={},ci={};ci.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40};var $n={};const Hf="[0-9]+",SV="[A-Z $%*+\\-./:]+";let Ca="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ca=Ca.replace(/u/g,"\\u");const VV="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ca+`)(?:.|[\r +]))+`;$n.KANJI=new RegExp(Ca,"g");$n.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");$n.BYTE=new RegExp(VV,"g");$n.NUMERIC=new RegExp(Hf,"g");$n.ALPHANUMERIC=new RegExp(SV,"g");const EV=new RegExp("^"+Ca+"$"),TV=new RegExp("^"+Hf+"$"),RV=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");$n.testKanji=function(n){return EV.test(n)};$n.testNumeric=function(n){return TV.test(n)};$n.testAlphanumeric=function(n){return RV.test(n)};(function(n){const e=ci,t=$n;n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(s,r){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?s.ccBits[0]:r<27?s.ccBits[1]:s.ccBits[2]},n.getBestModeForData=function(s){return t.testNumeric(s)?n.NUMERIC:t.testAlphanumeric(s)?n.ALPHANUMERIC:t.testKanji(s)?n.KANJI:n.BYTE},n.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},n.isValid=function(s){return s&&s.bit&&s.ccBits};function i(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+s)}}n.from=function(s,r){if(n.isValid(s))return s;try{return i(s)}catch{return r}}})(Zn);(function(n){const e=en,t=Yr,i=jr,s=Zn,r=ci,o=7973,a=e.getBCHDigit(o);function l(f,g,m){for(let _=1;_<=40;_++)if(g<=n.getCapacity(_,m,f))return _}function c(f,g){return s.getCharCountIndicator(f,g)+4}function d(f,g){let m=0;return f.forEach(function(_){const v=c(_.mode,g);m+=v+_.getBitsLength()}),m}function u(f,g){for(let m=1;m<=40;m++)if(d(f,m)<=n.getCapacity(m,g,s.MIXED))return m}n.from=function(f,g){return r.isValid(f)?parseInt(f,10):g},n.getCapacity=function(f,g,m){if(!r.isValid(f))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=s.BYTE);const _=e.getSymbolTotalCodewords(f),v=t.getTotalCodewordsCount(f,g),C=(_-v)*8;if(m===s.MIXED)return C;const S=C-c(m,f);switch(m){case s.NUMERIC:return Math.floor(S/10*3);case s.ALPHANUMERIC:return Math.floor(S/11*2);case s.KANJI:return Math.floor(S/13);case s.BYTE:default:return Math.floor(S/8)}},n.getBestVersionForData=function(f,g){let m;const _=i.from(g,i.M);if(Array.isArray(f)){if(f.length>1)return u(f,_);if(f.length===0)return 1;m=f[0]}else m=f;return l(m.mode,m.getLength(),_)},n.getEncodedBits=function(f){if(!r.isValid(f)||f<7)throw new Error("Invalid QR Code version");let g=f<<12;for(;e.getBCHDigit(g)-a>=0;)g^=o<=0;)i^=qf<0&&(t=this.data.substr(e),i=parseInt(t,10),n.put(i,s*3+1))};var NV=Uo;const IV=Zn,Ss=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function zo(n){this.mode=IV.ALPHANUMERIC,this.data=n}zo.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)};zo.prototype.getLength=function(){return this.data.length};zo.prototype.getBitsLength=function(){return zo.getBitsLength(this.data.length)};zo.prototype.write=function(n){let e;for(e=0;e+2<=this.data.length;e+=2){let t=Ss.indexOf(this.data[e])*45;t+=Ss.indexOf(this.data[e+1]),n.put(t,11)}this.data.length%2&&n.put(Ss.indexOf(this.data[e]),6)};var LV=zo;const OV=Zn;function Wo(n){this.mode=OV.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}Wo.getBitsLength=function(n){return n*8};Wo.prototype.getLength=function(){return this.data.length};Wo.prototype.getBitsLength=function(){return Wo.getBitsLength(this.data.length)};Wo.prototype.write=function(n){for(let e=0,t=this.data.length;e=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),n.put(t,13)}};var FV=Ho,Yf={exports:{}};(function(n){var e={single_source_shortest_paths:function(t,i,s){var r={},o={};o[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,c,d,u,f,g,m,_,v;!a.empty();){l=a.pop(),c=l.value,u=l.cost,f=t[c]||{};for(d in f)f.hasOwnProperty(d)&&(g=f[d],m=u+g,_=o[d],v=typeof o[d]>"u",(v||_>m)&&(o[d]=m,a.push(d,m),r[d]=c))}if(typeof s<"u"&&typeof o[s]>"u"){var C=["Could not find a path from ",i," to ",s,"."].join("");throw new Error(C)}return r},extract_shortest_path_from_predecessor_list:function(t,i){for(var s=[],r=i;r;)s.push(r),t[r],r=t[r];return s.reverse(),s},find_path:function(t,i,s){var r=e.single_source_shortest_paths(t,i,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(t){var i=e.PriorityQueue,s={},r;t=t||{};for(r in i)i.hasOwnProperty(r)&&(s[r]=i[r]);return s.queue=[],s.sorter=t.sorter||i.default_sorter,s},default_sorter:function(t,i){return t.cost-i.cost},push:function(t,i){var s={value:t,cost:i};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=e})(Yf);var UV=Yf.exports;(function(n){const e=Zn,t=NV,i=LV,s=BV,r=FV,o=$n,a=en,l=UV;function c(C){return unescape(encodeURIComponent(C)).length}function d(C,S,w){const L=[];let I;for(;(I=C.exec(w))!==null;)L.push({data:I[0],index:I.index,mode:S,length:I[0].length});return L}function u(C){const S=d(o.NUMERIC,e.NUMERIC,C),w=d(o.ALPHANUMERIC,e.ALPHANUMERIC,C);let L,I;return a.isKanjiModeEnabled()?(L=d(o.BYTE,e.BYTE,C),I=d(o.KANJI,e.KANJI,C)):(L=d(o.BYTE_KANJI,e.BYTE,C),I=[]),S.concat(w,L,I).sort(function(N,R){return N.index-R.index}).map(function(N){return{data:N.data,mode:N.mode,length:N.length}})}function f(C,S){switch(S){case e.NUMERIC:return t.getBitsLength(C);case e.ALPHANUMERIC:return i.getBitsLength(C);case e.KANJI:return r.getBitsLength(C);case e.BYTE:return s.getBitsLength(C)}}function g(C){return C.reduce(function(S,w){const L=S.length-1>=0?S[S.length-1]:null;return L&&L.mode===w.mode?(S[S.length-1].data+=w.data,S):(S.push(w),S)},[])}function m(C){const S=[];for(let w=0;w=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?n.set(r+a,o+l,!0,!0):n.set(r+a,o+l,!1,!0))}}function JV(n){const e=n.size;for(let t=8;t>a&1)===1,n.set(s,r,o,!0),n.set(r,s,o,!0)}function Ts(n,e,t){const i=n.size,s=jV.getEncodedBits(e,t);let r,o;for(r=0;r<15;r++)o=(s>>r&1)===1,r<6?n.set(r,8,o,!0):r<8?n.set(r+1,8,o,!0):n.set(i-15+r,8,o,!0),r<8?n.set(8,i-r-1,o,!0):r<9?n.set(8,15-r-1+1,o,!0):n.set(8,15-r-1,o,!0);n.set(i-8,8,1,!0)}function QV(n,e){const t=n.size;let i=-1,s=t-1,r=7,o=0;for(let a=t-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!n.isReserved(s,a-l)){let c=!1;o>>r&1)===1),n.set(s,a-l,c),r--,r===-1&&(o++,r=7)}if(s+=i,s<0||t<=s){s-=i,i=-i;break}}}function eE(n,e,t){const i=new zV;t.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),YV.getCharCountIndicator(l.mode,n)),l.write(i)});const s=Jr.getSymbolTotalCodewords(n),r=js.getTotalCodewordsCount(n,e),o=(s-r)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let l=0;l=7&&ZV(l,e),QV(l,o),isNaN(i)&&(i=qs.getBestMask(l,Ts.bind(null,l,t))),qs.applyMask(i,l),Ts(l,t,i),{modules:l,version:e,errorCorrectionLevel:t,maskPattern:i,segments:s}}Of.create=function(n,e){if(typeof n>"u"||n==="")throw new Error("No input text");let t=Vs.M,i,s;return typeof e<"u"&&(t=Vs.from(e.errorCorrectionLevel,Vs.M),i=Dr.from(e.version),s=qs.from(e.maskPattern),e.toSJISFunc&&Jr.setToSJISFunction(e.toSJISFunc)),nE(n,i,t,s)};var Kf={},fi={};(function(n){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let i=t.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+t);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(r){return[r,r]}))),i.length===6&&i.push("F","F");const s=parseInt(i.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+i.slice(0,6).join("")}}n.getOptions=function(t){t||(t={}),t.color||(t.color={});const i=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,s=t.width&&t.width>=21?t.width:void 0,r=t.scale||4;return{width:s,scale:s?4:r,margin:i,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},n.getScale=function(t,i){return i.width&&i.width>=t+i.margin*2?i.width/(t+i.margin*2):i.scale},n.getImageWidth=function(t,i){const s=n.getScale(t,i);return Math.floor((t+i.margin*2)*s)},n.qrToImageData=function(t,i,s){const r=i.modules.size,o=i.modules.data,a=n.getScale(r,s),l=Math.floor((r+s.margin*2)*a),c=s.margin*a,d=[s.color.light,s.color.dark];for(let u=0;u=c&&f>=c&&u"u"&&(!r||!r.getContext)&&(a=r,r=void 0),r||(l=i()),a=e.getOptions(a);const c=e.getImageWidth(s.modules.size,a),d=l.getContext("2d"),u=d.createImageData(c,c);return e.qrToImageData(u.data,s,a),t(d,l,c),d.putImageData(u,0,0),l},n.renderToDataURL=function(s,r,o){let a=o;typeof a>"u"&&(!r||!r.getContext)&&(a=r,r=void 0),a||(a={});const l=n.render(s,r,a),c=a.type||"image/png",d=a.rendererOpts||{};return l.toDataURL(c,d.quality)}})(Kf);var Jf={};const oE=fi;function mc(n,e){const t=n.a/255,i=e+'="'+n.hex+'"';return t<1?i+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':i}function Rs(n,e,t){let i=n+e;return typeof t<"u"&&(i+=" "+t),i}function aE(n,e,t){let i="",s=0,r=!1,o=0;for(let a=0;a0&&l>0&&n[a-1]||(i+=r?Rs("M",l+t,.5+c+t):Rs("m",s,0),s=0,r=!1),l+1':"",l="',c='viewBox="0 0 '+o+" "+o+'"',d=''+a+l+` +`;return typeof t=="function"&&t(null,d),d};const rE=wV,Ys=Of,Xf=Kf,lE=Jf;function pi(n,e,t,i,s){const r=[].slice.call(arguments,1),o=r.length,a=typeof r[o-1]=="function";if(!a&&!rE())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=t,t=e,e=i=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=i,i=void 0):(s=i,i=t,t=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(t=e,e=i=void 0):o===2&&!e.getContext&&(i=t,t=e,e=void 0),new Promise(function(l,c){try{const d=Ys.create(t,i);l(n(d,e,i))}catch(d){c(d)}})}try{const l=Ys.create(t,i);s(null,n(l,e,i))}catch(l){s(l)}}Fo.create=Ys.create;Fo.toCanvas=pi.bind(null,Xf.render);Fo.toDataURL=pi.bind(null,Xf.renderToDataURL);Fo.toString=pi.bind(null,function(n,e,t){return lE.render(n,t)});const sE={class:"inline-flex items-center justify-center"},iE=["height","width"],uE={key:0,class:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"},dE=defineComponent({__name:"ShadcnQrCode",props:{modelValue:{},size:{default:200},padding:{default:0},margin:{default:0},level:{default:"H"},background:{default:"#ffffff"},foreground:{default:"#000000"},rounded:{type:Boolean,default:!1}},emits:["on-complete"],setup(n,{emit:e}){const t=useSlots(),i=e,s=n,r=ref(null),o=ref(!1),a=computed(()=>s.size+s.padding*2),l=()=>{if(r.value){o.value=!0;try{const c=r.value,d=c.getContext("2d");if(!d)return;const u={width:s.size,margin:s.margin,color:{dark:s.foreground,light:s.background}};if(t.img){const f=Math.floor(s.size*.3),g=Math.floor(s.size*.15),m=document.createElement("canvas");m.width=s.size,m.height=s.size;const _=m.getContext("2d");if(!_)return;const v=_.createRadialGradient(s.size/2,s.size/2,g,s.size/2,s.size/2,f);v.addColorStop(0,"rgba(255, 255, 255, 1)"),v.addColorStop(1,"rgba(255, 255, 255, 0)"),_.fillStyle=v,_.fillRect(0,0,s.size,s.size),Fo.toCanvas(c,s.modelValue,{...u,errorCorrectionLevel:"H"}).then(()=>{const C=s.size/2,S=s.size/2,w=f/2;d.globalCompositeOperation="destination-out",d.beginPath(),d.arc(C,S,w,0,Math.PI*2),d.fill(),d.globalCompositeOperation="source-over",i("on-complete"),o.value=!1})}else Fo.toCanvas(c,s.modelValue,{...u,errorCorrectionLevel:s.level}).then(()=>{i("on-complete"),o.value=!1})}catch(c){console.error("Error generating QR code:",c),o.value=!1}}};return watchEffect(()=>{l()}),onMounted(()=>{l()}),(c,d)=>{const u=resolveComponent("ShadcnSpin");return openBlock(),createElementBlock("div",sE,[createBaseVNode("div",{class:normalizeClass$1(["relative bg-white shadow-sm ring-1 ring-slate-900/10",{"rounded-lg":c.rounded}]),style:normalizeStyle$1({width:unref(ke)(a.value),height:unref(ke)(a.value),padding:unref(ke)(c.padding)})},[createVNode(u,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=f=>o.value=f),fixed:""},null,8,["modelValue"]),withDirectives(createBaseVNode("canvas",{ref_key:"qrCanvas",ref:r,class:normalizeClass$1(["w-full h-full",{"rounded-lg":c.rounded}]),height:s.size,width:s.size},null,10,iE),[[vShow,!o.value]]),unref(t).img?(openBlock(),createElementBlock("div",uE,[renderSlot(c.$slots,"img")])):createCommentVNode("",!0)],6)])}}}),cE={class:"relative w-full shadcn-time-picker-container"},fE={class:"absolute right-2 top-0 h-full flex items-center gap-2 text-gray-400"},pE={key:0,class:"absolute mt-1 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 p-2 z-10 space-y-2 w-fit"},hE={class:"flex justify-between items-center gap-3"},mE={class:"flex space-x-2"},vE={key:0},gE={key:0,class:"grid grid-cols-3 gap-2 mt-2"},yE=["onClick"],bE=defineComponent({__name:"ShadcnTimePicker",props:{modelValue:{default:""},placeholder:{default:P("timePicker.placeholder.time")},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},quickTimes:{},format:{default:"HH:mm"}},emits:["update:modelValue","on-change","on-clear"],setup(n,{emit:e}){const t=n,i=e,s=ref(!1),r=ref(0),o=ref(0),a=ref(0),l=ref("AM"),c=computed(()=>t.format.includes("hh")),d=computed(()=>t.format.includes(":ss")),u=R=>R.toString().padStart(2,"0"),f=R=>Number(R),g=computed(()=>{if(!t.modelValue)return"";if(!c.value)return t.modelValue;const[R,T]=t.modelValue.split(" "),[A,...F]=R.split(":"),B=parseInt(A,10)%12||12;return`${u(B)}:${F.join(":")} ${T}`});watch(()=>t.modelValue,R=>{if(!R){r.value=0,o.value=0,a.value=0,l.value="AM";return}const[T,A]=R.split(" "),F=T.split(":");let B=parseInt(F[0],10);c.value&&(l.value=A||"AM",B=B%12||12),r.value=B,o.value=parseInt(F[1],10),d.value&&F[2]&&(a.value=parseInt(F[2],10))});const m=()=>{t.disabled||(s.value=!s.value)},_=R=>{l.value=R,S()},v=R=>c.value?(R%12||12).toString().padStart(2,"0"):R.toString().padStart(2,"0"),C=(R,T)=>T==="PM"&&R<12?R+12:T==="AM"&&R===12?0:R,S=()=>{let R=r.value;c.value&&(R=C(R,l.value));const T=u(R),A=u(o.value);let F=`${T}:${A}`;if(d.value){const B=u(a.value);F=`${F}:${B}`}c.value&&(F=`${F} ${l.value}`),i("update:modelValue",F),i("on-change",F)},w=R=>{s.value&&(R.target.closest(".shadcn-time-picker-container")||(s.value=!1))},L=R=>{R.key==="Escape"&&(s.value=!1)},I=R=>{R.stopPropagation(),i("update:modelValue",""),i("on-clear")},N=R=>{i("update:modelValue",R),i("on-change",R),s.value=!1};return onMounted(()=>{document.addEventListener("click",w),document.addEventListener("keydown",L)}),onUnmounted(()=>{document.removeEventListener("click",w),document.removeEventListener("keydown",L)}),(R,T)=>{var A;const F=resolveComponent("ShadcnInput"),B=resolveComponent("ShadcnIcon"),W=resolveComponent("ShadcnNumber"),G=resolveComponent("ShadcnToggle"),j=resolveComponent("ShadcnToggleGroup");return openBlock(),createElementBlock("div",cE,[createVNode(F,{readonly:"","model-value":g.value,placeholder:R.placeholder,disabled:R.disabled,onClick:m},null,8,["model-value","placeholder","disabled"]),createBaseVNode("div",fE,[R.clearable&&R.modelValue?(openBlock(),createElementBlock("div",{key:0,class:"flex items-center cursor-pointer hover:text-muted-foreground",onClick:I},[renderSlot(R.$slots,"clear",{},()=>[createVNode(B,{icon:"CircleX",size:"18"})])])):createCommentVNode("",!0),renderSlot(R.$slots,"icon",{},()=>[createVNode(B,{icon:"Clock",size:"18"})])]),s.value?(openBlock(),createElementBlock("div",pE,[createBaseVNode("div",hE,[createBaseVNode("div",mE,[createVNode(W,{modelValue:r.value,"onUpdate:modelValue":T[0]||(T[0]=K=>r.value=K),class:"w-14",min:0,max:c.value?12:23,formatter:v,parser:f,onFocus:T[1]||(T[1]=K=>s.value=!0),onOnChange:S},null,8,["modelValue","max"]),T[8]||(T[8]=createBaseVNode("span",{class:"text-xl select-none"},":",-1)),createVNode(W,{modelValue:o.value,"onUpdate:modelValue":T[2]||(T[2]=K=>o.value=K),class:"w-14",min:0,max:59,formatter:v,parser:f,onFocus:T[3]||(T[3]=K=>s.value=!0),onOnChange:S},null,8,["modelValue"]),d.value?(openBlock(),createElementBlock(Fragment,{key:0},[T[7]||(T[7]=createBaseVNode("span",{class:"text-xl select-none"},":",-1)),createVNode(W,{modelValue:a.value,"onUpdate:modelValue":T[4]||(T[4]=K=>a.value=K),class:"w-14",max:59,min:0,formatter:v,parser:f,onFocus:T[5]||(T[5]=K=>s.value=!0),onOnChange:S},null,8,["modelValue"])],64)):createCommentVNode("",!0)]),c.value?(openBlock(),createElementBlock("div",vE,[createVNode(j,{modelValue:l.value,"onUpdate:modelValue":T[6]||(T[6]=K=>l.value=K),class:"space-x-1",type:"single",onOnChange:_},{default:withCtx(()=>[createVNode(G,{value:"AM"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("timePicker.text.am")),1)]),_:1}),createVNode(G,{value:"PM"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("timePicker.text.pm")),1)]),_:1})]),_:1},8,["modelValue"])])):createCommentVNode("",!0)]),(A=R.quickTimes)!=null&&A.length?(openBlock(),createElementBlock("div",gE,[(openBlock(!0),createElementBlock(Fragment,null,renderList(R.quickTimes,K=>(openBlock(),createElementBlock("button",{key:K,class:"px-2 py-1 text-sm rounded-md hover:bg-gray-100 select-none active:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",onClick:ee=>N(K)},toDisplayString$1(K),9,yE))),128))])):createCommentVNode("",!0)])):createCommentVNode("",!0)])}}}),wE={class:"flex flex-col gap-4 p-2"},xE={key:0,class:"flex justify-between items-center select-none"},_E={class:"flex items-center"},CE={class:"text-sm font-medium"},kE=defineComponent({__name:"ShadcnColorPanel",props:{modelValue:{},showDropper:{type:Boolean}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=ref(0),r=ref(100),o=ref(100),a=ref(null),l=ref(null),c=ref(!1),d=ref(!1),u=async()=>{if(!("EyeDropper"in window)){alert("Your browser does not support the EyeDropper API");return}try{const F=(await new window.EyeDropper().open()).sRGBHex;m(F),A()}catch(F){console.error("EyeDropper error:",F)}},f=F=>{const B=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(F);return B?[parseInt(B[1],16)/255,parseInt(B[2],16)/255,parseInt(B[3],16)/255]:null},g=(F,B,W)=>{const G=Math.max(F,B,W),j=Math.min(F,B,W),K=G-j;let ee=0;K===0?ee=0:G===F?ee=(B-W)/K%6:G===B?ee=(W-F)/K+2:G===W&&(ee=(F-B)/K+4),ee=Math.round(ee*60),ee<0&&(ee+=360);const U=G===0?0:K/G*100,q=G*100;return[ee,U,q]},m=F=>{const B=f(F);if(B){const[W,G,j]=g(...B);s.value=W,r.value=G,o.value=j}};watch(()=>t.modelValue,F=>{F!==v.value&&m(F)});const _=computed(()=>`hsl(${s.value}, ${r.value}%, ${o.value}%)`),v=computed(()=>{const[F,B,W]=C(s.value,r.value,o.value);return S(F,B,W)}),C=(F,B,W)=>{B=B/100,W=W/100;const G=Math.floor(F/60),j=F/60-G,K=W*(1-B),ee=W*(1-j*B),U=W*(1-(1-j)*B);switch(G%6){case 0:return[W,U,K];case 1:return[ee,W,K];case 2:return[K,W,U];case 3:return[K,ee,W];case 4:return[U,K,W];case 5:return[W,K,ee];default:return[0,0,0]}},S=(F,B,W)=>{const G=j=>Math.round(j*255).toString(16).padStart(2,"0");return`#${G(F)}${G(B)}${G(W)}`},w=F=>{if(!a.value)return;const B=a.value.getBoundingClientRect(),W="touches"in F?F.touches[0].clientX:F.clientX,G="touches"in F?F.touches[0].clientY:F.clientY;let j=(W-B.left)/B.width*100,K=(G-B.top)/B.height*100;j=Math.max(0,Math.min(100,j)),K=Math.max(0,Math.min(100,K)),r.value=j,o.value=100-K,A()},L=F=>{if(!l.value)return;const B=l.value.getBoundingClientRect();let W=(("touches"in F?F.touches[0].clientX:F.clientX)-B.left)/B.width*360;W=Math.max(0,Math.min(360,W)),s.value=W,A()},I=F=>{c.value=!0,w(F),document.addEventListener("mousemove",R),document.addEventListener("touchmove",R),document.addEventListener("mouseup",T),document.addEventListener("touchend",T)},N=F=>{d.value=!0,L(F),document.addEventListener("mousemove",R),document.addEventListener("touchmove",R),document.addEventListener("mouseup",T),document.addEventListener("touchend",T)},R=F=>{c.value?w(F):d.value&&L(F)},T=()=>{c.value=!1,d.value=!1,document.removeEventListener("mousemove",R),document.removeEventListener("touchmove",R),document.removeEventListener("mouseup",T),document.removeEventListener("touchend",T)},A=()=>{i("update:modelValue",v.value),i("on-change",v.value)};return onMounted(()=>{t.modelValue&&m(t.modelValue)}),onUnmounted(()=>{T()}),(F,B)=>{const W=resolveComponent("ShadcnIcon");return openBlock(),createElementBlock("div",wE,[F.showDropper?(openBlock(),createElementBlock("div",xE,[createBaseVNode("div",_E,[createBaseVNode("div",{class:"w-6 h-6 rounded-md border shadow-sm mr-2",style:normalizeStyle$1({backgroundColor:_.value})},null,4),createBaseVNode("span",CE,toDisplayString$1(v.value.toUpperCase()),1)]),createBaseVNode("button",{class:"p-1 rounded-md items-center flex hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",onClick:u,title:"Color Picker"},[createVNode(W,{icon:"Pipette",class:"w-4 h-4"})])])):createCommentVNode("",!0),createBaseVNode("div",{ref_key:"saturationPanel",ref:a,class:"w-full h-32 rounded-sm relative cursor-pointer",role:"slider","aria-label":"Color saturation and brightness",style:normalizeStyle$1({backgroundColor:`hsl(${s.value}, 100%, 50%)`,backgroundImage:"linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent)"}),onMousedown:I,onTouchstart:I},[createBaseVNode("div",{class:"w-4 h-4 rounded-full border-2 border-white absolute -translate-x-1/2 -translate-y-1/2 shadow-lg",style:normalizeStyle$1({left:`${r.value}%`,top:`${100-o.value}%`,backgroundColor:_.value})},null,4)],36),createBaseVNode("div",{ref_key:"hueSlider",ref:l,class:"w-full h-4 rounded-sm relative cursor-pointer",role:"slider","aria-label":"Color hue",style:{backgroundImage:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"},onMousedown:N,onTouchstart:N},[createBaseVNode("div",{class:"absolute top-0 w-4 h-full rounded-full border-2 border-white shadow-lg -translate-x-1/2",style:normalizeStyle$1({left:`${s.value/360*100}%`,backgroundColor:`hsl(${s.value}, 100%, 50%)`})},null,4)],544)])}}}),$E={class:"inline-block relative shadcn-color-picker-container"},SE={key:0,class:"relative"},VE={class:"absolute min-w-64 z-10 mt-0.5 p-2 bg-white rounded-lg shadow-lg border"},EE={class:"grid grid-cols-5 gap-2"},TE=["onClick"],RE={class:"mt-2 space-y-2"},AE={key:0,class:"space-y-2"},ME={class:"flex justify-between items-center"},NE={class:"text-sm text-gray-500"},IE={key:1,class:"grid grid-cols-3 gap-2"},LE={key:2,class:"grid grid-cols-3 gap-2"},OE={key:1,class:"mt-2"},BE={key:2,class:"flex items-center select-none"},DE={class:"text-sm text-gray-500 mr-2"},PE=defineComponent({__name:"ShadcnColorPicker",props:{modelValue:{},color:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},presetColors:{default:()=>["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#2dd4bf","#38bdf8","#818cf8","#c084fc","#e879f9","#fb7185","#475569","#737373","#78716c","#ef4444"]},format:{default:"auto"},showPanel:{type:Boolean,default:!0},showDropper:{type:Boolean,default:!0},showTransparency:{type:Boolean,default:!0},showFormat:{type:Boolean,default:!0}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=ref(!1),r=ref(100),o=ref("hex"),a=computed(()=>t.presetColors),l=q=>q?q.startsWith("rgb"):!1,c=q=>q?q.startsWith("hsl"):!1,d=q=>q?q.startsWith("#"):!1,u=q=>{const Q=parseInt(q.slice(1,3),16),ce=parseInt(q.slice(3,5),16),ie=parseInt(q.slice(5,7),16);return[Q,ce,ie]},f=(q,Q,ce)=>"#"+[q,Q,ce].map(ie=>{const Ce=ie.toString(16);return Ce.length===1?"0"+Ce:Ce}).join(""),g=(q,Q,ce)=>{q/=255,Q/=255,ce/=255;const ie=Math.max(q,Q,ce),Ce=Math.min(q,Q,ce);let ae=0,be,De=(ie+Ce)/2;if(ie===Ce)ae=be=0;else{const Te=ie-Ce;switch(be=De>.5?Te/(2-ie-Ce):Te/(ie+Ce),ie){case q:ae=(Q-ce)/Te+(Q{if(q=q%360,Q=Math.max(0,Math.min(100,Q))/100,ce=Math.max(0,Math.min(100,ce))/100,Q===0){const xe=Math.round(ce*255);return[xe,xe,xe]}const ie=(xe,ze,Qe)=>(Qe<0&&(Qe+=1),Qe>1&&(Qe-=1),Qe<1/6?xe+(ze-xe)*6*Qe:Qe<1/2?ze:Qe<2/3?xe+(ze-xe)*(2/3-Qe)*6:xe),Ce=ce<.5?ce*(1+Q):ce+Q-ce*Q,ae=2*ce-Ce,be=ie(ae,Ce,q/360+1/3),De=ie(ae,Ce,q/360),Te=ie(ae,Ce,q/360-1/3);return[Math.round(be*255),Math.round(De*255),Math.round(Te*255)]},_=(q,Q)=>{const[ce,ie,Ce]=u(q);return`rgba(${ce}, ${ie}, ${Ce}, ${Q/100})`},v=(q,Q,ce,ie)=>`rgba(${q}, ${Q}, ${ce}, ${ie/100})`,C=(q,Q,ce,ie)=>`hsla(${q}, ${Q}%, ${ce}%, ${ie/100})`,S=q=>{const Q=q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return Q?[parseInt(Q[1]),parseInt(Q[2]),parseInt(Q[3])]:[0,0,0]},w=q=>{const Q=q.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);return Q?[parseInt(Q[1]),parseInt(Q[2]),parseInt(Q[3])]:[0,0,0]},L=computed(()=>T.value),I=computed(()=>u(T.value)),N=computed(()=>{const q=u(T.value);return g(...q)}),R=computed(()=>{if(!t.modelValue&&!t.color)return"transparent";const q=t.modelValue||t.color;if(l(q)){const[Q,ce,ie]=S(q);return v(Q,ce,ie,r.value)}else if(c(q)){const[Q,ce,ie]=w(q),[Ce,ae,be]=m(Q,ce,ie);return v(Ce,ae,be,r.value)}else if(d(q))return _(q,r.value);return"transparent"}),T=computed(()=>{if(!t.modelValue&&!t.color)return"#000000";const q=t.modelValue||t.color;if(l(q)){const[Q,ce,ie]=S(q);return f(Q,ce,ie)}else if(c(q)){const[Q,ce,ie]=w(q),[Ce,ae,be]=m(Q,ce,ie);return f(Ce,ae,be)}else if(d(q))return q;return"#000000"});onMounted(()=>{const q=t.modelValue||t.color;if(q){if(l(q)){const Q=q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);Q&&Q[4]&&(r.value=Math.round(parseFloat(Q[4])*100))}else if(c(q)){const Q=q.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%(?:,\s*([\d.]+))?\)/);Q&&Q[4]&&(r.value=Math.round(parseFloat(Q[4])*100))}}});const A=()=>{t.disabled||t.readonly||(s.value=!s.value)},F=(q,Q)=>{let ce=t.format;if(ce==="auto"&&(t.modelValue?l(t.modelValue)?ce="rgb":c(t.modelValue)?ce="hsl":ce="hex":t.color?l(t.color)?ce="rgb":c(t.color)?ce="hsl":ce="hex":ce="hex"),d(q)){const[ie,Ce,ae]=u(q);switch(ce){case"rgb":return v(ie,Ce,ae,Q);case"hsl":{const[be,De,Te]=g(ie,Ce,ae);return C(be,De,Te,Q)}default:return q}}else if(l(q)){const[ie,Ce,ae]=S(q);switch(ce){case"hex":return f(ie,Ce,ae);case"hsl":{const[be,De,Te]=g(ie,Ce,ae);return C(be,De,Te,Q)}default:return v(ie,Ce,ae,Q)}}else if(c(q)){const[ie,Ce,ae]=w(q),[be,De,Te]=m(ie,Ce,ae);switch(ce){case"hex":return f(be,De,Te);case"rgb":return v(be,De,Te,Q);default:return C(ie,Ce,ae,Q)}}return q},B=q=>{const Q=F(q,r.value);i("update:modelValue",Q),i("on-change",Q),s.value=!1},W=q=>{if(/^#[0-9A-Fa-f]{6}$/.test(q)){const Q=F(q,r.value);i("update:modelValue",Q),i("on-change",Q)}},G=(q,Q)=>{if(isNaN(Q)||Q<0||Q>255)return;const ce=[...I.value];ce[q]=Q;const ie=f(...ce),Ce=F(ie,r.value);i("update:modelValue",Ce),i("on-change",Ce)},j=(q,Q)=>{const ce=q===0?360:100;if(isNaN(Q)||Q<0||Q>ce)return;const ie=[...N.value];ie[q]=Q;const Ce=m(...ie),ae=f(...Ce),be=F(ae,r.value);i("update:modelValue",be),i("on-change",be)},K=q=>{r.value=q;const Q=F(T.value,r.value);i("update:modelValue",Q),i("on-change",Q)},ee=q=>{s.value&&(q.target.closest(".shadcn-color-picker-container")||(s.value=!1))},U=q=>{const Q=F(q,r.value);i("update:modelValue",Q),i("on-change",Q)};return onMounted(()=>{document.addEventListener("click",ee)}),onUnmounted(()=>{document.removeEventListener("click",ee)}),(q,Q)=>{const ce=resolveComponent("ShadcnSelectOption"),ie=resolveComponent("ShadcnSelect"),Ce=resolveComponent("ShadcnInput"),ae=resolveComponent("ShadcnNumber"),be=resolveComponent("ShadcnSlider");return openBlock(),createElementBlock("div",$E,[createBaseVNode("div",{class:normalizeClass$1(["w-8 h-8 rounded-md border",[{"cursor-pointer":!q.disabled&&!q.readonly},{"cursor-not-allowed opacity-50":q.disabled}]]),style:normalizeStyle$1({backgroundColor:R.value}),onClick:A},null,6),s.value?(openBlock(),createElementBlock("div",SE,[createBaseVNode("div",VE,[createBaseVNode("div",EE,[(openBlock(!0),createElementBlock(Fragment,null,renderList(a.value,De=>(openBlock(),createElementBlock("div",{class:"w-6 h-6 rounded-md cursor-pointer",key:De,style:normalizeStyle$1({backgroundColor:De}),onClick:Te=>B(De)},null,12,TE))),128))]),createBaseVNode("div",RE,[q.showFormat?(openBlock(),createElementBlock("div",AE,[createBaseVNode("div",ME,[createBaseVNode("span",NE,toDisplayString$1(unref(P)("colorPicker.text.format")),1),createVNode(ie,{modelValue:o.value,"onUpdate:modelValue":Q[0]||(Q[0]=De=>o.value=De)},{options:withCtx(()=>[createVNode(ce,{value:"hex",label:"HEX"}),createVNode(ce,{value:"rgb",label:"RGB"}),createVNode(ce,{value:"hsl",label:"HSL"})]),_:1},8,["modelValue"])]),o.value==="hex"?(openBlock(),createBlock$1(Ce,{key:0,modelValue:L.value,"onUpdate:modelValue":Q[1]||(Q[1]=De=>L.value=De),placeholder:"#000000",onOnChange:W},null,8,["modelValue"])):createCommentVNode("",!0),o.value==="rgb"?(openBlock(),createElementBlock("div",IE,[(openBlock(!0),createElementBlock(Fragment,null,renderList(I.value,(De,Te)=>(openBlock(),createElementBlock("div",{key:Te},[createVNode(ae,{"model-value":De,min:0,max:255,onOnChange:xe=>G(Te,xe)},null,8,["model-value","onOnChange"])]))),128))])):createCommentVNode("",!0),o.value==="hsl"?(openBlock(),createElementBlock("div",LE,[createBaseVNode("div",null,[createVNode(ae,{placeholder:"H","model-value":N.value[0],min:0,max:360,onOnChange:Q[2]||(Q[2]=De=>j(0,De))},null,8,["model-value"])]),createBaseVNode("div",null,[createVNode(ae,{placeholder:"S","model-value":N.value[1],min:0,max:100,onOnChange:Q[3]||(Q[3]=De=>j(1,De))},null,8,["model-value"])]),createBaseVNode("div",null,[createVNode(ae,{placeholder:"L","model-value":N.value[2],min:0,max:100,onOnChange:Q[4]||(Q[4]=De=>j(2,De))},null,8,["model-value"])])])):createCommentVNode("",!0)])):createCommentVNode("",!0),q.showPanel?(openBlock(),createElementBlock("div",OE,[createVNode(kE,{"model-value":q.modelValue,"show-dropper":q.showDropper,onOnChange:U},null,8,["model-value","show-dropper"])])):createCommentVNode("",!0),q.showTransparency?(openBlock(),createElementBlock("div",BE,[createBaseVNode("span",DE,toDisplayString$1(unref(P)("colorPicker.text.transparency")),1),createVNode(be,{modelValue:r.value,"onUpdate:modelValue":Q[5]||(Q[5]=De=>r.value=De),class:"flex-1",min:0,max:100,"show-tip":"",onOnChange:K},null,8,["modelValue"])])):createCommentVNode("",!0)])])])):createCommentVNode("",!0)])}}}),Ft=(n,e="YYYY-MM-DD")=>{if(!n)return"";const t=n instanceof Date?n:new Date(n);if(isNaN(t.getTime()))return"";const i=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(i)).replace("MM",s).replace("DD",r).replace("HH",o).replace("mm",a).replace("ss",l)},FE={class:"relative w-full"},UE={class:"relative flex space-x-2"},zE={class:"w-50"},WE={class:"flex justify-between items-center mb-4 text-sm"},HE={class:"flex items-center gap-2"},GE={class:"font-medium"},qE={class:"grid grid-cols-7 gap-1 mb-2"},jE={class:"grid grid-cols-7 gap-1"},YE=["onClick","onMouseenter"],KE={key:1},JE={key:0,class:"w-50"},XE={class:"flex justify-between items-center mb-4 text-sm"},ZE={class:"flex items-center gap-2"},QE={class:"font-medium"},e5={class:"grid grid-cols-7 gap-1 mb-2"},t5={class:"grid grid-cols-7 gap-1"},n5=["onClick","onMouseenter"],o5={key:1},a5=["onClick"],r5=defineComponent({__name:"ShadcnDatePicker",props:{modelValue:{},type:{default:"date"},placeholder:{default:P("datePicker.placeholder.date")},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},format:{default:"YYYY-MM-DD"},clearable:{type:Boolean,default:!0},showShortcuts:{type:Boolean,default:!0}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=ref(!1),r=ref(!1),o=ref(new Date),a=ref(new Date),l=ref(""),c=ref(""),d=[{label:P("datePicker.text.today"),value:"today"},{label:P("datePicker.text.yesterday"),value:"yesterday"},{label:P("datePicker.text.thisWeek"),value:"thisWeek"},{label:P("datePicker.text.lastWeek"),value:"lastWeek"},{label:P("datePicker.text.thisMonth"),value:"thisMonth"},{label:P("datePicker.text.lastMonth"),value:"lastMonth"}];t.type==="range"&&d.push({label:P("datePicker.text.last3Months"),value:"last3Months"});const u=[P("datePicker.text.sunday"),P("datePicker.text.monday"),P("datePicker.text.tuesday"),P("datePicker.text.wednesday"),P("datePicker.text.thursday"),P("datePicker.text.friday"),P("datePicker.text.saturday")],f=computed(()=>{const U=o.value.getFullYear(),q=o.value.getMonth()+1;return`${U}${P("datePicker.text.year")} ${q}${P("datePicker.text.month")}`}),g=computed(()=>{const U=a.value.getFullYear(),q=a.value.getMonth()+1;return`${U}${P("datePicker.text.year")} ${q}${P("datePicker.text.month")}`}),m=computed(()=>v(o.value)),_=computed(()=>v(a.value)),v=U=>{const q=U.getFullYear(),Q=U.getMonth(),ce=new Date(q,Q,1),ie=new Date(q,Q+1,0),Ce=new Date,ae=xe=>xe.getFullYear()===Ce.getFullYear()&&xe.getMonth()===Ce.getMonth()&&xe.getDate()===Ce.getDate(),be=[],De=ce.getDay();for(let xe=De-1;xe>=0;xe--){const ze=new Date(q,Q,-xe);be.push({date:Ft(ze),day:ze.getDate(),currentMonth:!1,isToday:ae(ze)})}for(let xe=1;xe<=ie.getDate();xe++){const ze=new Date(q,Q,xe);be.push({date:Ft(ze),day:xe,currentMonth:!0,isToday:ae(ze)})}const Te=42-be.length;for(let xe=1;xe<=Te;xe++){const ze=new Date(q,Q+1,xe);be.push({date:Ft(ze),day:ze.getDate(),currentMonth:!1,isToday:ae(ze)})}return be},C=computed(()=>{if(!t.modelValue)return"";if(t.type==="range"&&Array.isArray(t.modelValue)){const[U,q]=t.modelValue;return!U||!q?"":`${Ft(U,t.format)} ~ ${Ft(q,t.format)}`}return Ft(t.modelValue,t.format)}),S=U=>{if(typeof U=="string"){const q=new Date(U.replace(/\//g,"-"));return Ft(q)}return Ft(U)},w=U=>{if(t.type==="range"){if(t.modelValue&&Array.isArray(t.modelValue)){const[q,Q]=t.modelValue,ce=new Date(U).getTime(),ie=q?new Date(q).getTime():null,Ce=Q?new Date(Q).getTime():null;return ie&&ce>=ie&&Ce&&ce<=Ce}return!1}return t.modelValue?S(t.modelValue)===S(U):!1},L=U=>{if(!t.modelValue||!Array.isArray(t.modelValue))return!1;const[q,Q]=t.modelValue;if(!q||!Q)return!1;const ce=new Date(U).getTime(),ie=new Date(q).getTime(),Ce=new Date(Q).getTime();return ce>=ie&&ce<=Ce},I=()=>{if(!t.disabled&&!t.readonly&&(s.value=!s.value,s.value)){if(t.modelValue)if(t.type==="range"&&Array.isArray(t.modelValue)){const[U,q]=t.modelValue;if(U){o.value=new Date(S(U)),l.value=S(U);const Q=new Date(o.value);Q.setMonth(Q.getMonth()+1),a.value=Q}q&&(c.value=S(q))}else{const U=new Date(S(t.modelValue));isNaN(U.getTime())||(o.value=U,l.value=S(t.modelValue))}if(t.type==="range"){const U=new Date(o.value);U.setMonth(U.getMonth()+1),a.value<=o.value&&(a.value=U)}}},N=U=>{const q=U==="start"?o:a,Q=new Date(q.value.getFullYear(),q.value.getMonth()-1);if(U==="end"){q.value=Q;const ce=new Date(Q);ce.setMonth(ce.getMonth()-1),t.type==="range"&&Q<=o.value&&(o.value=ce)}else q.value=Q},R=U=>{const q=U==="start"?o:a,Q=new Date(q.value.getFullYear()-1,q.value.getMonth());if(U==="end"){q.value=Q;const ce=new Date(Q);ce.setMonth(ce.getMonth()-1),t.type==="range"&&Q<=o.value&&(o.value=ce)}else q.value=Q},T=U=>{const q=U==="start"?o:a,Q=new Date(q.value.getFullYear(),q.value.getMonth()+1);if(U==="start"){q.value=Q;const ce=new Date(Q);ce.setMonth(ce.getMonth()+1),t.type==="range"&&a.value<=Q&&(a.value=ce)}else q.value=Q},A=U=>{const q=U==="start"?o:a,Q=new Date(q.value.getFullYear()+1,q.value.getMonth());if(U==="start"){q.value=Q;const ce=new Date(Q);ce.setMonth(ce.getMonth()+1),t.type==="range"&&a.value<=Q&&(a.value=ce)}else q.value=Q},F=(U,q="start")=>{const Q=new Date(U);if(t.type==="range"){if(!l.value||l.value&&c.value)l.value=U,c.value="";else{const ce=new Date(l.value).getTime();new Date(U).getTime()>=ce?c.value=U:(c.value=l.value,l.value=U)}if(l.value&&c.value){const ce=[Ft(new Date(l.value),t.format),Ft(new Date(c.value),t.format)];i("update:modelValue",ce),i("on-change",ce),s.value=!1}}else i("update:modelValue",Ft(Q,t.format)),i("on-change",Ft(Q,t.format)),s.value=!1},B=()=>{l.value="",c.value="",t.type==="range"?(i("update:modelValue",["",""]),i("on-change",["",""])):(i("update:modelValue",""),i("on-change",""))},W=U=>{const q=new Date,Q=q.getFullYear(),ce=q.getMonth();switch(U){case"today":return q;case"yesterday":{const ie=new Date(q);return ie.setDate(q.getDate()-1),ie}case"thisWeek":return q;case"lastWeek":{const ie=new Date(q),Ce=new Date(q);return Ce.setDate(ie.getDate()-7),t.type==="range"?[Ce,ie]:ie}case"thisMonth":{const ie=new Date(Q,ce,1),Ce=new Date(Q,ce+1,0);return t.type==="range"?[ie,Ce]:Ce}case"lastMonth":{const ie=new Date(Q,ce-1,1),Ce=new Date(Q,ce,0);return t.type==="range"?[ie,Ce]:Ce}case"last3Months":{const ie=new Date(q);return[new Date(Q,ce-3,1),ie]}case"thisYear":{const ie=new Date(Q,0,1),Ce=new Date(Q,11,31);return[ie,Ce]}case"lastYear":{const ie=new Date(Q-1,0,1),Ce=new Date(Q-1,11,31);return[ie,Ce]}default:return q}},G=U=>{const q=W(U);if(t.type==="range"&&Array.isArray(q)){const[Q,ce]=q,ie=Ft(Q,t.format),Ce=Ft(ce,t.format);l.value=S(Q),c.value=S(ce),o.value=Q,a.value=ce,i("update:modelValue",[ie,Ce]),i("on-change",[ie,Ce])}else{const Q=q,ce=Ft(Q,t.format);l.value=S(Q),o.value=Q,i("update:modelValue",ce),i("on-change",ce)}s.value=!1},j=U=>{U.target.closest(".relative")||(s.value=!1,r.value=!1)},K=ref(""),ee=U=>{if(t.type!=="range"||!K.value||l.value&&c.value)return!1;const q=new Date(U).getTime(),Q=new Date(K.value).getTime();if(l.value){const ce=new Date(l.value).getTime();return Q>=ce?q>=ce&&q<=Q:q>=Q&&q<=ce}else return q===Q};return onMounted(()=>{document.addEventListener("click",j)}),onUnmounted(()=>{document.removeEventListener("click",j)}),(U,q)=>{const Q=resolveComponent("ShadcnInput"),ce=resolveComponent("ShadcnBadge");return openBlock(),createElementBlock("div",FE,[createBaseVNode("div",UE,[createVNode(Q,{"model-value":C.value,placeholder:U.placeholder,disabled:U.disabled,readonly:!0,clearable:U.clearable,onClick:I,onOnClear:B},null,8,["model-value","placeholder","disabled","clearable"])]),s.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["absolute z-20 mt-1 bg-white rounded-lg shadow-lg border border-gray-200 p-4",{"w-64":U.type==="date","w-auto":U.type==="range"}])},[createBaseVNode("div",{class:normalizeClass$1(["flex",{"space-x-4":U.type==="range"}])},[createBaseVNode("div",zE,[createBaseVNode("div",WE,[createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[0]||(q[0]=ie=>R("start"))},[createVNode(unref(jd),{class:"w-4 h-4"})]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[1]||(q[1]=ie=>N("start"))},[createVNode(unref(Gd),{class:"w-4 h-4"})]),createBaseVNode("div",HE,[createBaseVNode("span",GE,toDisplayString$1(f.value),1)]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[2]||(q[2]=ie=>T("start"))},[createVNode(unref(qd),{class:"w-4 h-4"})]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[3]||(q[3]=ie=>A("start"))},[createVNode(unref(Yd),{class:"w-4 h-4"})])]),createBaseVNode("div",qE,[(openBlock(),createElementBlock(Fragment,null,renderList(u,ie=>createBaseVNode("span",{key:ie,class:"text-xs text-gray-500"},toDisplayString$1(ie),1)),64))]),createBaseVNode("div",jE,[(openBlock(!0),createElementBlock(Fragment,null,renderList(m.value,ie=>(openBlock(),createElementBlock("button",{class:normalizeClass$1(["w-6 h-6 text-xs text-center rounded-sm relative",{"bg-blue-500 text-white hover:bg-blue-500":w(ie.date),"text-gray-400":!ie.currentMonth,"hover:bg-gray-100":!w(ie.date),"bg-blue-500":U.type==="range"&&L(ie.date),"bg-blue-100":U.type==="range"&&ee(ie.date)&&!w(ie.date),"hover:bg-blue-200":U.type==="range"&&l.value&&!c.value}]),key:ie.date,onClick:Ce=>F(ie.date,"start"),onMouseenter:Ce=>U.type==="range"&&(K.value=ie.date),onMouseleave:q[4]||(q[4]=Ce=>U.type==="range"&&(K.value=""))},[ie.isToday?(openBlock(),createBlock$1(ce,{key:0,dot:""},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ie.day),1)]),_:2},1024)):(openBlock(),createElementBlock("span",KE,toDisplayString$1(ie.day),1))],42,YE))),128))])]),U.type==="range"?(openBlock(),createElementBlock("div",JE,[createBaseVNode("div",XE,[createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[5]||(q[5]=ie=>R("end"))},[createVNode(unref(jd),{class:"w-4 h-4"})]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[6]||(q[6]=ie=>N("end"))},[createVNode(unref(Gd),{class:"w-4 h-4"})]),createBaseVNode("div",ZE,[createBaseVNode("span",QE,toDisplayString$1(g.value),1)]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[7]||(q[7]=ie=>T("end"))},[createVNode(unref(qd),{class:"w-4 h-4"})]),createBaseVNode("button",{class:"p-1 hover:bg-gray-100 rounded-full",onClick:q[8]||(q[8]=ie=>A("end"))},[createVNode(unref(Yd),{class:"w-4 h-4"})])]),createBaseVNode("div",e5,[(openBlock(),createElementBlock(Fragment,null,renderList(u,ie=>createBaseVNode("span",{key:ie,class:"text-xs text-gray-500"},toDisplayString$1(ie),1)),64))]),createBaseVNode("div",t5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_.value,ie=>(openBlock(),createElementBlock("button",{class:normalizeClass$1(["w-6 h-6 text-xs text-center rounded-sm relative",{"bg-blue-500 text-white hover:bg-blue-500":w(ie.date),"text-gray-400":!ie.currentMonth,"hover:bg-gray-100":!w(ie.date),"bg-blue-500":U.type==="range"&&L(ie.date),"bg-blue-100":U.type==="range"&&ee(ie.date)&&!w(ie.date),"hover:bg-blue-200":U.type==="range"&&l.value&&!c.value}]),key:ie.date,onClick:Ce=>F(ie.date,"end"),onMouseenter:Ce=>U.type==="range"&&(K.value=ie.date),onMouseleave:q[9]||(q[9]=Ce=>U.type==="range"&&(K.value=""))},[ie.isToday?(openBlock(),createBlock$1(ce,{key:0,dot:""},{default:withCtx(()=>[createTextVNode(toDisplayString$1(ie.day),1)]),_:2},1024)):(openBlock(),createElementBlock("span",o5,toDisplayString$1(ie.day),1))],42,n5))),128))])])):createCommentVNode("",!0)],2),U.showShortcuts?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass$1(["mt-3 pt-2 border-t border-gray-100",{"grid grid-cols-3 gap-1":U.type==="date","grid grid-cols-5 gap-1 w-50":U.type==="range"}])},[(openBlock(),createElementBlock(Fragment,null,renderList(d,ie=>createBaseVNode("button",{class:"text-xs py-1 px-1 rounded-md hover:bg-gray-100",key:ie.label,onClick:Ce=>G(ie.value)},toDisplayString$1(ie.label),9,a5)),64))],2)):createCommentVNode("",!0)],2)):createCommentVNode("",!0)])}}}),l5={class:"mt-4 space-y-4"},s5={class:"flex items-center space-x-2"},i5={class:"flex items-center space-x-2 select-none"},u5={class:"flex items-center space-x-2"},d5={class:"text-sm"},c5={class:"flex items-center space-x-2 select-none"},f5={class:"flex items-center space-x-2"},p5={class:"text-sm"},h5={class:"text-sm"},m5={class:"text-sm"},v5={class:"flex items-center space-x-2"},g5=defineComponent({__name:"ShadcnSecondPanel",props:{modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=e,s=ref("every"),r=ref(0),o=ref(1),a=ref(0),l=ref(1),c=ref([]),d=Array.from({length:60},(g,m)=>({label:m.toString(),value:m})),u=(g,m,_)=>g_?_:g,f=g=>{if(!g||g==="*"){s.value="every";return}if(g.includes("-")){s.value="period";const[m,_]=g.split("-").map(Number);r.value=m,o.value=_;return}if(g.includes("/")){s.value="start";const[m,_]=g.split("/").map(Number);a.value=m,l.value=_;return}if(g.includes(",")){s.value="specify",c.value=g.split(",").map(Number);return}isNaN(Number(g))||(s.value="specify",c.value=[Number(g)])};return watch(()=>t.modelValue,g=>{g&&f(g)},{immediate:!0}),watch([s,r,o,a,l,c],()=>{let g="";switch(s.value){case"every":g="*";break;case"period":r.value=u(r.value,0,59),o.value=u(o.value,0,59),g=`${r.value}-${o.value}`;break;case"start":a.value=u(a.value,0,59),l.value=u(l.value,1,59),g=`${a.value}/${l.value}`;break;case"specify":g=c.value.join(",")||"*";break}i("update:modelValue",g)},{immediate:!0}),(g,m)=>{const _=resolveComponent("ShadcnRadio"),v=resolveComponent("ShadcnNumber"),C=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",l5,[createBaseVNode("div",s5,[createVNode(_,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=S=>s.value=S),value:"every",name:"second-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everySecond")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",i5,[createVNode(_,{modelValue:s.value,"onUpdate:modelValue":m[1]||(m[1]=S=>s.value=S),value:"period",name:"second-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",u5,[createVNode(v,{modelValue:r.value,"onUpdate:modelValue":m[2]||(m[2]=S=>r.value=S),class:"w-16",min:0,max:59},null,8,["modelValue"]),m[9]||(m[9]=createBaseVNode("span",null,"-",-1)),createVNode(v,{modelValue:o.value,"onUpdate:modelValue":m[3]||(m[3]=S=>o.value=S),class:"w-16",min:0,max:59},null,8,["modelValue"]),createBaseVNode("span",d5,toDisplayString$1(unref(P)("cron.text.second")),1)])]),createBaseVNode("div",c5,[createVNode(_,{modelValue:s.value,"onUpdate:modelValue":m[4]||(m[4]=S=>s.value=S),value:"start",name:"second-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",f5,[createVNode(v,{modelValue:a.value,"onUpdate:modelValue":m[5]||(m[5]=S=>a.value=S),class:"w-16",min:0,max:59},null,8,["modelValue"]),createBaseVNode("span",p5,toDisplayString$1(unref(P)("cron.text.secondStart"))+",",1),createBaseVNode("span",h5,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(v,{modelValue:l.value,"onUpdate:modelValue":m[6]||(m[6]=S=>l.value=S),class:"w-16",min:1,max:59},null,8,["modelValue"]),createBaseVNode("span",m5,toDisplayString$1(unref(P)("cron.text.secondExecute")),1)])]),createBaseVNode("div",v5,[createVNode(_,{modelValue:s.value,"onUpdate:modelValue":m[7]||(m[7]=S=>s.value=S),value:"specify",name:"second-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(C,{modelValue:c.value,"onUpdate:modelValue":m[8]||(m[8]=S=>c.value=S),multiple:"",options:unref(d),placeholder:unref(P)("cron.placeholder.multiple")},null,8,["modelValue","options","placeholder"])])])}}}),y5={class:"mt-4 space-y-4"},b5={class:"flex items-center space-x-2"},w5={class:"flex items-center space-x-2 select-none"},x5={class:"flex items-center space-x-2"},_5={class:"text-sm"},C5={class:"flex items-center space-x-2 select-none"},k5={class:"flex items-center space-x-2"},$5={class:"text-sm"},S5={class:"text-sm"},V5={class:"text-sm"},E5={class:"flex items-center space-x-2"},T5=defineComponent({__name:"ShadcnMinutePanel",props:{modelValue:{},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref("every"),r=ref(0),o=ref(1),a=ref(0),l=ref(1),c=ref([]),d=Array.from({length:60},(m,_)=>({label:_.toString(),value:_})),u=(m,_,v)=>m<_?_:m>v?v:m,f=m=>{if(!m||m==="*"){s.value="every";return}if(m.includes("-")){s.value="period";const[_,v]=m.split("-").map(Number);r.value=_,o.value=v;return}if(m.includes("/")){s.value="start";const[_,v]=m.split("/").map(Number);a.value=_,l.value=v;return}if(m.includes(",")){s.value="specify",c.value=m.split(",").map(Number);return}isNaN(Number(m))||(s.value="specify",c.value=[Number(m)])},g=m=>{var _;s.value!=="every"&&((_=t.cron)==null?void 0:_.second)==="*"&&i("update","second","0","min"),s.value==="every"?(i("update","min","*","min"),i("update","hour","*","min")):i("update","min",m,"min"),i("update:modelValue",m)};return watch(()=>t.modelValue,m=>{m&&f(m)},{immediate:!0}),watch([s,r,o,a,l,c],()=>{let m="";switch(s.value){case"every":m="*";break;case"period":r.value=u(r.value,0,59),o.value=u(o.value,0,59),m=`${r.value}-${o.value}`;break;case"start":a.value=u(a.value,0,59),l.value=u(l.value,1,59),m=`${a.value}/${l.value}`;break;case"specify":m=c.value.join(",")||"*";break}g(m)},{immediate:!0}),(m,_)=>{const v=resolveComponent("ShadcnRadio"),C=resolveComponent("ShadcnNumber"),S=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",y5,[createBaseVNode("div",b5,[createVNode(v,{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=w=>s.value=w),value:"every",name:"minute-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyMinute")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",w5,[createVNode(v,{modelValue:s.value,"onUpdate:modelValue":_[1]||(_[1]=w=>s.value=w),value:"period",name:"minute-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",x5,[createVNode(C,{modelValue:r.value,"onUpdate:modelValue":_[2]||(_[2]=w=>r.value=w),class:"w-16",min:0,max:59},null,8,["modelValue"]),_[9]||(_[9]=createBaseVNode("span",null,"-",-1)),createVNode(C,{modelValue:o.value,"onUpdate:modelValue":_[3]||(_[3]=w=>o.value=w),class:"w-16",min:0,max:59},null,8,["modelValue"]),createBaseVNode("span",_5,toDisplayString$1(unref(P)("cron.text.minute")),1)])]),createBaseVNode("div",C5,[createVNode(v,{modelValue:s.value,"onUpdate:modelValue":_[4]||(_[4]=w=>s.value=w),value:"start",name:"minute-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",k5,[createVNode(C,{modelValue:a.value,"onUpdate:modelValue":_[5]||(_[5]=w=>a.value=w),class:"w-16",min:0,max:59},null,8,["modelValue"]),createBaseVNode("span",$5,toDisplayString$1(unref(P)("cron.text.minuteStart"))+",",1),createBaseVNode("span",S5,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(C,{modelValue:l.value,"onUpdate:modelValue":_[6]||(_[6]=w=>l.value=w),class:"w-16",min:1,max:59},null,8,["modelValue"]),createBaseVNode("span",V5,toDisplayString$1(unref(P)("cron.text.minuteExecute")),1)])]),createBaseVNode("div",E5,[createVNode(v,{modelValue:s.value,"onUpdate:modelValue":_[7]||(_[7]=w=>s.value=w),value:"specify",name:"minute-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(S,{modelValue:c.value,"onUpdate:modelValue":_[8]||(_[8]=w=>c.value=w),multiple:"",options:unref(d),placeholder:unref(P)("cron.placeholder.multiple")},null,8,["modelValue","options","placeholder"])])])}}}),R5={class:"mt-4 space-y-4"},A5={class:"flex items-center space-x-2"},M5={class:"flex items-center space-x-2 select-none"},N5={class:"flex items-center space-x-2"},I5={class:"text-sm"},L5={class:"flex items-center space-x-2 select-none"},O5={class:"flex items-center space-x-2"},B5={class:"text-sm"},D5={class:"text-sm"},P5={class:"text-sm"},F5={class:"flex items-center space-x-2"},U5=defineComponent({__name:"ShadcnHourPanel",props:{modelValue:{},checkNumber:{type:Function,default:(n,e,t)=>nt?t:n},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref(1),r=ref(0),o=ref(1),a=ref(0),l=ref(1),c=ref([]),d=Array.from({length:24},(w,L)=>({label:L.toString(),value:L})),u=computed(()=>({cycle01:r.value,cycle02:o.value})),f=computed(()=>({average01:a.value,average02:l.value})),g=computed(()=>{const w=c.value.join();return w===""?"*":w}),m=()=>{var w,L;s.value===1?(i("update","hour","*","hour"),i("update","day","*","hour")):(((w=t.cron)==null?void 0:w.minute)==="*"&&i("update","min","0","hour"),((L=t.cron)==null?void 0:L.second)==="*"&&i("update","second","0","hour"));const I=_();i("update:modelValue",I),i("update","hour",I)},_=()=>{switch(s.value){case 1:return"*";case 2:return`${r.value}-${o.value}`;case 3:return`${a.value}/${l.value}`;case 4:return g.value;default:return"*"}},v=()=>{if(s.value===2){r.value=t.checkNumber(r.value,0,23),o.value=t.checkNumber(o.value,0,23);const w=`${r.value}-${o.value}`;i("update","hour",w),i("update:modelValue",w)}},C=()=>{if(s.value===3){a.value=t.checkNumber(a.value,0,23),l.value=t.checkNumber(l.value,1,23);const w=`${a.value}/${l.value}`;i("update","hour",w),i("update:modelValue",w)}},S=w=>{if(!w||w==="*"){s.value=1;return}if(w.includes("-")){s.value=2;const[L,I]=w.split("-").map(Number);r.value=L,o.value=I;return}if(w.includes("/")){s.value=3;const[L,I]=w.split("/").map(Number);a.value=L,l.value=I;return}if(w.includes(",")){s.value=4,c.value=w.split(",").map(Number);return}isNaN(Number(w))||(s.value=4,c.value=[Number(w)])};return watch(()=>t.modelValue,w=>{w&&S(w)}),watch(s,m),watch(u,v),watch(f,C),watch(g,w=>{s.value===4&&(i("update","hour",w),i("update:modelValue",w))}),(w,L)=>{const I=resolveComponent("ShadcnRadio"),N=resolveComponent("ShadcnNumber"),R=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",R5,[createBaseVNode("div",A5,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[0]||(L[0]=T=>s.value=T),value:1,name:"hour-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyHour")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",M5,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[1]||(L[1]=T=>s.value=T),value:2,name:"hour-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",N5,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":L[2]||(L[2]=T=>r.value=T),class:"w-16",min:0,max:23},null,8,["modelValue"]),L[9]||(L[9]=createBaseVNode("span",null,"-",-1)),createVNode(N,{modelValue:o.value,"onUpdate:modelValue":L[3]||(L[3]=T=>o.value=T),class:"w-16",min:0,max:23},null,8,["modelValue"]),createBaseVNode("span",I5,toDisplayString$1(unref(P)("cron.text.hour")),1)])]),createBaseVNode("div",L5,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[4]||(L[4]=T=>s.value=T),value:3,name:"hour-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",O5,[createVNode(N,{modelValue:a.value,"onUpdate:modelValue":L[5]||(L[5]=T=>a.value=T),class:"w-16",min:0,max:23},null,8,["modelValue"]),createBaseVNode("span",B5,toDisplayString$1(unref(P)("cron.text.hourStart"))+",",1),createBaseVNode("span",D5,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(N,{modelValue:l.value,"onUpdate:modelValue":L[6]||(L[6]=T=>l.value=T),class:"w-16",min:1,max:23},null,8,["modelValue"]),createBaseVNode("span",P5,toDisplayString$1(unref(P)("cron.text.hourExecute")),1)])]),createBaseVNode("div",F5,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[7]||(L[7]=T=>s.value=T),value:4,name:"hour-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(R,{modelValue:c.value,"onUpdate:modelValue":L[8]||(L[8]=T=>c.value=T),multiple:"",options:unref(d),placeholder:unref(P)("cron.placeholder.multiple")},null,8,["modelValue","options","placeholder"])])])}}}),z5={class:"mt-4 space-y-4"},W5={class:"flex items-center space-x-2"},H5={class:"flex items-center space-x-2"},G5={class:"flex items-center space-x-2 select-none"},q5={class:"flex items-center space-x-2"},j5={class:"text-sm"},Y5={class:"flex items-center space-x-2 select-none"},K5={class:"flex items-center space-x-2"},J5={class:"text-sm"},X5={class:"text-sm"},Z5={class:"text-sm"},Q5={class:"flex items-center space-x-2 select-none"},eT={class:"flex items-center space-x-2"},tT={class:"text-sm"},nT={class:"flex items-center space-x-2"},oT={class:"flex items-center space-x-2"},aT=defineComponent({__name:"ShadcnDayPanel",props:{modelValue:{},checkNumber:{type:Function,default:(n,e,t)=>nt?t:n},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref(1),r=ref(1),o=ref(1),a=ref(2),l=ref(1),c=ref(1),d=ref([]),u=Array.from({length:31},(N,R)=>({label:(R+1).toString(),value:R+1})),f=computed(()=>({cycle01:o.value,cycle02:a.value})),g=computed(()=>({average01:l.value,average02:c.value})),m=computed(()=>{const N=d.value.join();return N===""?"*":N}),_=()=>{var N,R,T;s.value===1?(i("update","day","*","day"),i("update","week","?","day"),i("update","month","*","day")):(((N=t.cron)==null?void 0:N.hour)==="*"&&i("update","hour","0","day"),((R=t.cron)==null?void 0:R.minute)==="*"&&i("update","min","0","day"),((T=t.cron)==null?void 0:T.second)==="*"&&i("update","second","0","day"));const A=v();i("update:modelValue",A),i("update","day",A)},v=()=>{switch(s.value){case 1:return"*";case 2:return"?";case 3:return`${o.value}-${a.value}`;case 4:return`${l.value}/${c.value}`;case 5:return`${r.value}W`;case 6:return"L";case 7:return m.value;default:return"*"}},C=()=>{if(s.value===3){o.value=t.checkNumber(o.value,1,31),a.value=t.checkNumber(a.value,1,31);const N=`${o.value}-${a.value}`;i("update","day",N),i("update:modelValue",N)}},S=()=>{if(s.value===4){l.value=t.checkNumber(l.value,1,31),c.value=t.checkNumber(c.value,1,31);const N=`${l.value}/${c.value}`;i("update","day",N),i("update:modelValue",N)}},w=()=>{if(s.value===5){r.value=t.checkNumber(r.value,1,31);const N=`${r.value}W`;i("update","day",N),i("update:modelValue",N)}},L=()=>{var N,R;((N=t.cron)==null?void 0:N.week)==="?"&&s.value===2?s.value=1:((R=t.cron)==null?void 0:R.week)!=="?"&&s.value!==2&&(s.value=2)},I=N=>{if(!N||N==="*"){s.value=1;return}if(N==="?"){s.value=2;return}if(N==="L"){s.value=6;return}if(N.includes("W")){s.value=5,r.value=parseInt(N.replace("W",""));return}if(N.includes("-")){s.value=3;const[R,T]=N.split("-").map(Number);o.value=R,a.value=T;return}if(N.includes("/")){s.value=4;const[R,T]=N.split("/").map(Number);l.value=R,c.value=T;return}if(N.includes(",")){s.value=7,d.value=N.split(",").map(Number);return}isNaN(Number(N))||(s.value=7,d.value=[Number(N)])};return watch(()=>t.modelValue,N=>{N&&I(N)}),watch(()=>{var N;return(N=t.cron)==null?void 0:N.week},()=>{L()}),watch(s,_),watch(f,C),watch(g,S),watch(r,w),watch(m,N=>{s.value===7&&(i("update","day",N),i("update:modelValue",N))}),(N,R)=>{const T=resolveComponent("ShadcnRadio"),A=resolveComponent("ShadcnNumber"),F=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",z5,[createBaseVNode("div",W5,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[0]||(R[0]=B=>s.value=B),value:1,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyDay")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",H5,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[1]||(R[1]=B=>s.value=B),value:2,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.notSpecified")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",G5,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[2]||(R[2]=B=>s.value=B),value:3,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",q5,[createVNode(A,{modelValue:o.value,"onUpdate:modelValue":R[3]||(R[3]=B=>o.value=B),max:31,min:1,class:"w-16"},null,8,["modelValue"]),R[13]||(R[13]=createBaseVNode("span",null,"-",-1)),createVNode(A,{modelValue:a.value,"onUpdate:modelValue":R[4]||(R[4]=B=>a.value=B),max:31,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",j5,toDisplayString$1(unref(P)("cron.text.day")),1)])]),createBaseVNode("div",Y5,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[5]||(R[5]=B=>s.value=B),value:4,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",K5,[createVNode(A,{modelValue:l.value,"onUpdate:modelValue":R[6]||(R[6]=B=>l.value=B),max:31,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",J5,toDisplayString$1(unref(P)("cron.text.dayStart"))+",",1),createBaseVNode("span",X5,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(A,{modelValue:c.value,"onUpdate:modelValue":R[7]||(R[7]=B=>c.value=B),max:31,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",Z5,toDisplayString$1(unref(P)("cron.text.dayExecute")),1)])]),createBaseVNode("div",Q5,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[8]||(R[8]=B=>s.value=B),value:5,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.workday")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",eT,[createVNode(A,{modelValue:r.value,"onUpdate:modelValue":R[9]||(R[9]=B=>r.value=B),max:31,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",tT,toDisplayString$1(unref(P)("cron.text.nearestWorkday")),1)])]),createBaseVNode("div",nT,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[10]||(R[10]=B=>s.value=B),value:6,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.lastDayOfMonth")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",oT,[createVNode(T,{modelValue:s.value,"onUpdate:modelValue":R[11]||(R[11]=B=>s.value=B),value:7,name:"day-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(F,{modelValue:d.value,"onUpdate:modelValue":R[12]||(R[12]=B=>d.value=B),options:unref(u),placeholder:unref(P)("cron.placeholder.multiple"),multiple:""},null,8,["modelValue","options","placeholder"])])])}}}),rT={class:"mt-4 space-y-4"},lT={class:"flex items-center space-x-2"},sT={class:"flex items-center space-x-2 select-none"},iT={class:"flex items-center space-x-2"},uT={class:"text-sm"},dT={class:"flex items-center space-x-2 select-none"},cT={class:"flex items-center space-x-2"},fT={class:"text-sm"},pT={class:"text-sm"},hT={class:"text-sm"},mT={class:"flex items-center space-x-2"},vT=defineComponent({__name:"ShadcnMonthPanel",props:{modelValue:{},checkNumber:{type:Function,default:(n,e,t)=>nt?t:n},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref(1),r=ref(1),o=ref(2),a=ref(1),l=ref(1),c=ref([]),d=Array.from({length:12},(w,L)=>({label:(L+1).toString(),value:L+1})),u=computed(()=>({cycle01:r.value,cycle02:o.value})),f=computed(()=>({average01:a.value,average02:l.value})),g=computed(()=>{const w=c.value.join();return w===""?"*":w}),m=()=>{var w,L,I,N;s.value===1?(i("update","month","*"),i("update","year","*")):(((w=t.cron)==null?void 0:w.day)==="*"&&i("update","day","0","month"),((L=t.cron)==null?void 0:L.hour)==="*"&&i("update","hour","0","month"),((I=t.cron)==null?void 0:I.minute)==="*"&&i("update","min","0","month"),((N=t.cron)==null?void 0:N.second)==="*"&&i("update","second","0","month"));const R=_();i("update:modelValue",R),i("update","month",R)},_=()=>{switch(s.value){case 1:return"*";case 2:return`${r.value}-${o.value}`;case 3:return`${a.value}/${l.value}`;case 4:return g.value;default:return"*"}},v=()=>{if(s.value===2){r.value=t.checkNumber(r.value,1,12),o.value=t.checkNumber(o.value,1,12);const w=`${r.value}-${o.value}`;i("update","month",w),i("update:modelValue",w)}},C=()=>{if(s.value===3){a.value=t.checkNumber(a.value,1,12),l.value=t.checkNumber(l.value,1,12);const w=`${a.value}/${l.value}`;i("update","month",w),i("update:modelValue",w)}},S=w=>{if(!w||w==="*"){s.value=1;return}if(w.includes("-")){s.value=2;const[L,I]=w.split("-").map(Number);r.value=L,o.value=I;return}if(w.includes("/")){s.value=3;const[L,I]=w.split("/").map(Number);a.value=L,l.value=I;return}if(w.includes(",")){s.value=4,c.value=w.split(",").map(Number);return}isNaN(Number(w))||(s.value=4,c.value=[Number(w)])};return watch(()=>t.modelValue,w=>{w&&S(w)}),watch(s,m),watch(u,v),watch(f,C),watch(g,w=>{s.value===4&&(i("update","month",w),i("update:modelValue",w))}),(w,L)=>{const I=resolveComponent("ShadcnRadio"),N=resolveComponent("ShadcnNumber"),R=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",rT,[createBaseVNode("div",lT,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[0]||(L[0]=T=>s.value=T),value:1,name:"month-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyMonth")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",sT,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[1]||(L[1]=T=>s.value=T),value:2,name:"month-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",iT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":L[2]||(L[2]=T=>r.value=T),max:12,min:1,class:"w-16"},null,8,["modelValue"]),L[9]||(L[9]=createBaseVNode("span",null,"-",-1)),createVNode(N,{modelValue:o.value,"onUpdate:modelValue":L[3]||(L[3]=T=>o.value=T),max:12,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",uT,toDisplayString$1(unref(P)("cron.text.month")),1)])]),createBaseVNode("div",dT,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[4]||(L[4]=T=>s.value=T),value:3,name:"month-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",cT,[createVNode(N,{modelValue:a.value,"onUpdate:modelValue":L[5]||(L[5]=T=>a.value=T),max:12,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",fT,toDisplayString$1(unref(P)("cron.text.monthStart"))+",",1),createBaseVNode("span",pT,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(N,{modelValue:l.value,"onUpdate:modelValue":L[6]||(L[6]=T=>l.value=T),max:12,min:1,class:"w-16"},null,8,["modelValue"]),createBaseVNode("span",hT,toDisplayString$1(unref(P)("cron.text.monthExecute")),1)])]),createBaseVNode("div",mT,[createVNode(I,{modelValue:s.value,"onUpdate:modelValue":L[7]||(L[7]=T=>s.value=T),value:4,name:"month-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(R,{modelValue:c.value,"onUpdate:modelValue":L[8]||(L[8]=T=>c.value=T),options:unref(d),placeholder:unref(P)("cron.placeholder.multiple"),multiple:""},null,8,["modelValue","options","placeholder"])])])}}}),gT={class:"mt-4 space-y-4"},yT={class:"flex items-center space-x-2"},bT={class:"flex items-center space-x-2"},wT={class:"flex items-center space-x-2 select-none"},xT={class:"flex items-center space-x-2"},_T={class:"flex items-center space-x-2 select-none"},CT={class:"flex items-center space-x-2"},kT={class:"text-sm"},$T={class:"text-sm"},ST={class:"flex items-center space-x-2 select-none"},VT={class:"flex items-center space-x-2"},ET={class:"flex items-center space-x-2"},TT=defineComponent({__name:"ShadcnWeekPanel",props:{modelValue:{},checkNumber:{type:Function,default:(n,e,t)=>nt?t:n},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref(2),r=ref(1),o=ref(1),a=ref(2),l=ref(1),c=ref(1),d=ref([]),u=[P("datePicker.text.monday"),P("datePicker.text.tuesday"),P("datePicker.text.wednesday"),P("datePicker.text.thursday"),P("datePicker.text.friday"),P("datePicker.text.saturday"),P("datePicker.text.sunday")].map((I,N)=>({label:I,value:N+1})),f=computed(()=>({cycle01:o.value,cycle02:a.value})),g=computed(()=>({average01:l.value,average02:c.value})),m=computed(()=>{const I=d.value.join();return I===""?"*":I}),_=()=>{var I,N,R,T,A;s.value===1?(i("update","week","*"),i("update","year","*")):(((I=t.cron)==null?void 0:I.month)==="*"&&i("update","month","0","week"),((N=t.cron)==null?void 0:N.day)==="*"&&i("update","day","0","week"),((R=t.cron)==null?void 0:R.hour)==="*"&&i("update","hour","0","week"),((T=t.cron)==null?void 0:T.minute)==="*"&&i("update","min","0","week"),((A=t.cron)==null?void 0:A.second)==="*"&&i("update","second","0","week"));const F=v();i("update:modelValue",F),i("update","week",F)},v=()=>{switch(s.value){case 1:return"*";case 2:return"?";case 3:return`${o.value}-${a.value}`;case 4:return`${l.value}#${c.value}`;case 5:return`${r.value}L`;case 6:return m.value;default:return"?"}},C=()=>{if(s.value===3){o.value=t.checkNumber(o.value,1,7),a.value=t.checkNumber(a.value,1,7);const I=`${o.value}-${a.value}`;i("update","week",I),i("update:modelValue",I)}},S=()=>{if(s.value===4){l.value=t.checkNumber(l.value,1,4),c.value=t.checkNumber(c.value,1,7);const I=`${l.value}#${c.value}`;i("update","week",I),i("update:modelValue",I)}},w=()=>{if(s.value===5){r.value=t.checkNumber(r.value,1,7);const I=`${r.value}L`;i("update","week",I),i("update:modelValue",I)}},L=I=>{if(!I||I==="*"){s.value=1;return}if(I==="?"){s.value=2;return}if(I.includes("L")){s.value=5,r.value=parseInt(I.replace("L",""));return}if(I.includes("#")){s.value=4;const[N,R]=I.split("#").map(Number);l.value=N,c.value=R;return}if(I.includes("-")){s.value=3;const[N,R]=I.split("-").map(Number);o.value=N,a.value=R;return}if(I.includes(",")){s.value=6,d.value=I.split(",").map(Number);return}isNaN(Number(I))||(s.value=6,d.value=[Number(I)])};return watch(()=>t.modelValue,I=>{I&&L(I)}),watch(s,_),watch(f,C),watch(g,S),watch(r,w),watch(m,I=>{s.value===6&&(i("update","week",I),i("update:modelValue",I))}),(I,N)=>{const R=resolveComponent("ShadcnRadio"),T=resolveComponent("ShadcnNumber"),A=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",gT,[createBaseVNode("div",yT,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[0]||(N[0]=F=>s.value=F),value:1,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyWeek")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",bT,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[1]||(N[1]=F=>s.value=F),value:2,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.notSpecified")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",wT,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[2]||(N[2]=F=>s.value=F),value:3,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.weekPeriodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",xT,[createVNode(T,{modelValue:o.value,"onUpdate:modelValue":N[3]||(N[3]=F=>o.value=F),class:"w-16",min:1,max:7},null,8,["modelValue"]),N[12]||(N[12]=createBaseVNode("span",null,"-",-1)),createVNode(T,{modelValue:a.value,"onUpdate:modelValue":N[4]||(N[4]=F=>a.value=F),class:"w-16",min:1,max:7},null,8,["modelValue"])])]),createBaseVNode("div",_T,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[5]||(N[5]=F=>s.value=F),value:4,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specificWeek")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",CT,[createBaseVNode("span",kT,toDisplayString$1(unref(P)("cron.text.the")),1),createVNode(T,{modelValue:l.value,"onUpdate:modelValue":N[6]||(N[6]=F=>l.value=F),class:"w-16",min:1,max:4},null,8,["modelValue"]),createBaseVNode("span",$T,toDisplayString$1(unref(P)("cron.text.weekOf")),1),createVNode(T,{modelValue:c.value,"onUpdate:modelValue":N[7]||(N[7]=F=>c.value=F),class:"w-16",min:1,max:7},null,8,["modelValue"])])]),createBaseVNode("div",ST,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[8]||(N[8]=F=>s.value=F),value:5,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.lastWeek")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",VT,[createVNode(T,{modelValue:r.value,"onUpdate:modelValue":N[9]||(N[9]=F=>r.value=F),class:"w-16",min:1,max:7},null,8,["modelValue"])])]),createBaseVNode("div",ET,[createVNode(R,{modelValue:s.value,"onUpdate:modelValue":N[10]||(N[10]=F=>s.value=F),value:6,name:"week-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(A,{modelValue:d.value,"onUpdate:modelValue":N[11]||(N[11]=F=>d.value=F),multiple:"",options:unref(u),placeholder:unref(P)("cron.placeholder.multiple")},null,8,["modelValue","options","placeholder"])])])}}});class RT{constructor(){Pt(this,"dayRule",""),Pt(this,"dayRuleSup",""),Pt(this,"dateArr",[])}getRecentTriggerTime(e,t=5){const i=e.split(" ");let s=0;const r=[],o=new Date,a=o.getFullYear();let l=o.getMonth()+1,c=o.getDate(),d=o.getHours(),u=o.getMinutes(),f=o.getSeconds();this.getSecondArr(i[0]),this.getMinArr(i[1]),this.getHourArr(i[2]),this.getDayArr(i[3]),this.getMouthArr(i[4]),this.getWeekArr(i[5]),this.getYearArr(i[6],a);const g=this.dateArr[0],m=this.dateArr[1],_=this.dateArr[2],v=this.dateArr[3],C=this.dateArr[4],S=this.dateArr[5];let w=this.getIndex(g,f),L=this.getIndex(m,u),I=this.getIndex(_,d),N=this.getIndex(v,c),R=this.getIndex(C,l);const T=this.getIndex(S,a),A=()=>{w=0,f=g[w]},F=()=>{L=0,u=m[L],A()},B=()=>{I=0,d=_[I],F()},W=()=>{N=0,c=v[N],B()},G=()=>{R=0,l=C[R],W()};a!==S[T]&&G(),l!==C[R]&&W(),c!==v[N]&&B(),d!==_[I]&&F(),u!==m[L]&&A();e:for(let j=T;jC[C.length-1]){G();continue}t:for(let ee=R;eev[v.length-1]){if(W(),ee==C.length-1){G();continue e}continue}i:for(let q=N;q_[_.length-1]){if(B(),q==v.length-1){if(W(),ee==C.length-1){G();continue e}continue t}continue}if(!this.checkDate(`${K}-${U}-${ce} 00:00:00`)&&this.dayRule!=="workDay"&&this.dayRule!=="lastWeek"&&this.dayRule!=="lastDay"){W();continue t}if(this.dayRule=="lastDay"){if(!this.checkDate(`${K}-${U}-${ce} 00:00:00`))for(;Q>0&&!this.checkDate(`${K}-${U}-${ce} 00:00:00`);)Q--,ce=Q<10?`0${Q}`:Q}else if(this.dayRule=="workDay"){if(!this.checkDate(`${K}-${U}-${ce} 00:00:00`))for(;Q>0&&!this.checkDate(`${K}-${U}-${ce} 00:00:00`);)Q--,ce=Q<10?`0${Q}`:Q;const ie=this.formatDate(new Date(`${K}-${U}-${ce} 00:00:00`),"week");ie==0?(Q++,ce=Q<10?`0${Q}`:Q,this.checkDate(`${K}-${U}-${ce} 00:00:00`)||(Q-=3)):ie==6&&(this.dayRuleSup!==1?Q--:Q+=2)}else if(this.dayRule=="weekDay"){const ie=this.formatDate(new Date(`${K}-${U}-${Q} 00:00:00`),"week");if(this.dayRuleSup.indexOf(Number(ie))<0){if(q==v.length-1){if(W(),ee==C.length-1){G();continue e}continue t}continue}}n:for(let ie=I;ie<_.length;ie++){const Ce=_[ie]<10?`0${_[ie]}`:_[ie];if(u>m[m.length-1]){if(F(),ie==_.length-1){if(B(),q==v.length-1){if(W(),ee==C.length-1){G();continue e}continue t}continue i}continue}s:for(let ae=L;aeg[g.length-1]){if(A(),ae==m.length-1){if(F(),ie==_.length-1){if(B(),q==v.length-1){if(W(),ee==C.length-1){G();continue e}continue t}continue i}continue n}continue}for(let De=w;De<=g.length-1;De++){const Te=g[De]<10?`0${g[De]}`:g[De];if(String(U)!=="00"&&String(Q)!=="00"&&(r.push(`${K}-${U}-${ce} ${Ce}:${be}:${Te}`),s++),s==t)break e;if(De==g.length-1){if(A(),ae==m.length-1){if(F(),ie==_.length-1){if(B(),q==v.length-1){if(W(),ee==C.length-1){G();continue e}continue t}continue i}continue n}continue s}}}}}}}return r}getIndex(e,t){if(t<=e[0]||t>e[e.length-1])return 0;for(let i=0;ie[i]&&t<=e[i+1])return i+1;return 0}getYearArr(e,t){this.dateArr[5]=this.getOrderArr(t,t+100),e!==void 0&&(e.indexOf("-")>=0?this.dateArr[5]=this.getCycleArr(e,t+100,!1):e.indexOf("/")>=0?this.dateArr[5]=this.getAverageArr(e,t+100):e!=="*"&&(this.dateArr[5]=this.getAssignArr(e)))}getMouthArr(e){this.dateArr[4]=this.getOrderArr(1,12),e.indexOf("-")>=0?this.dateArr[4]=this.getCycleArr(e,12,!1):e.indexOf("/")>=0?this.dateArr[4]=this.getAverageArr(e,12):e!=="*"&&(this.dateArr[4]=this.getAssignArr(e))}getWeekArr(e){if(this.dayRule==""&&this.dayRuleSup==""){if(e.indexOf("-")>=0)this.dayRule="weekDay",this.dayRuleSup=this.getCycleArr(e,7,!1);else if(e.indexOf("#")>=0){this.dayRule="assWeek";const t=e.match(/[0-9]{1}/g);this.dayRuleSup=[Number(t[0]),Number(t[1])],this.dateArr[3]=[1],this.dayRuleSup[1]==7&&(this.dayRuleSup[1]=0)}else e.indexOf("L")>=0?(this.dayRule="lastWeek",this.dayRuleSup=Number(e.match(/[0-9]{1,2}/g)[0]),this.dateArr[3]=[31],this.dayRuleSup==7&&(this.dayRuleSup=0)):e!=="*"&&e!=="?"&&(this.dayRule="weekDay",this.dayRuleSup=this.getAssignArr(e));if(this.dayRule==="weekDay")for(let t=0;t=0?(this.dateArr[3]=this.getCycleArr(e,31,!1),this.dayRuleSup="null"):e.indexOf("/")>=0?(this.dateArr[3]=this.getAverageArr(e,31),this.dayRuleSup="null"):e.indexOf("W")>=0?(this.dayRule="workDay",this.dayRuleSup=Number(e.match(/[0-9]{1,2}/g)[0]),this.dateArr[3]=[this.dayRuleSup]):e.indexOf("L")>=0?(this.dayRule="lastDay",this.dayRuleSup="null",this.dateArr[3]=[31]):e!=="*"&&e!=="?"?(this.dateArr[3]=this.getAssignArr(e),this.dayRuleSup="null"):e==="*"&&(this.dayRuleSup="null")}getHourArr(e){this.dateArr[2]=this.getOrderArr(0,23),e.indexOf("-")>=0?this.dateArr[2]=this.getCycleArr(e,24,!0):e.indexOf("/")>=0?this.dateArr[2]=this.getAverageArr(e,23):e!=="*"&&(this.dateArr[2]=this.getAssignArr(e))}getMinArr(e){this.dateArr[1]=this.getOrderArr(0,59),e.indexOf("-")>=0?this.dateArr[1]=this.getCycleArr(e,60,!0):e.indexOf("/")>=0?this.dateArr[1]=this.getAverageArr(e,59):e!=="*"&&(this.dateArr[1]=this.getAssignArr(e))}getSecondArr(e){this.dateArr[0]=this.getOrderArr(0,59),e.indexOf("-")>=0?this.dateArr[0]=this.getCycleArr(e,60,!0):e.indexOf("/")>=0?this.dateArr[0]=this.getAverageArr(e,59):e!=="*"&&(this.dateArr[0]=this.getAssignArr(e))}getOrderArr(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}getAssignArr(e){const t=[],i=e.split(",");for(let s=0;sa&&(a+=t);for(let l=o;l<=a;l++){let c=0;i===!1&&l%t==0&&(c=t),s.push(Math.round(l%t+c))}return s.sort(this.compare),s}compare(e,t){return t-e>0?-1:1}formatDate(e,t){const i=e.getFullYear(),s=e.getMonth()+1,r=e.getDate(),o=e.getHours(),a=e.getMinutes(),l=e.getSeconds(),c=e.getDay();if(t==null)return`${i}-${s<10?`0${s}`:s}-${r<10?`0${r}`:r} ${o<10?`0${o}`:o}:${a<10?`0${a}`:a}:${l<10?`0${l}`:l}`;if(t==="week")return c}checkDate(e){const t=new Date(e),i=this.formatDate(t);return e===i}}const AT=new RT;function MT(n,e=5){return AT.getRecentTriggerTime(n,e)}const NT={class:"mt-4 space-y-4"},IT={class:"flex items-center space-x-2"},LT={class:"flex items-center space-x-2"},OT={class:"flex items-center space-x-2 select-none"},BT={class:"flex items-center space-x-2"},DT={class:"flex items-center space-x-2 select-none"},PT={class:"flex items-center space-x-2"},FT={class:"text-sm"},UT={class:"text-sm"},zT={class:"text-sm"},WT={class:"flex items-center space-x-2"},HT=defineComponent({__name:"ShadcnYearPanel",props:{modelValue:{},checkNumber:{type:Function,default:(n,e,t)=>nt?t:n},cron:{default:()=>({})}},emits:["update:modelValue","update"],setup(n,{emit:e}){const t=n,i=e,s=ref(new Date().getFullYear()),r=ref(1),o=ref(s.value),a=ref(s.value+1),l=ref(s.value),c=ref(1),d=ref([]),u=computed(()=>Array.from({length:9},(L,I)=>({label:(s.value+I).toString(),value:s.value+I}))),f=computed(()=>({cycle01:o.value,cycle02:a.value})),g=computed(()=>({average01:l.value,average02:c.value})),m=computed(()=>d.value.join()),_=()=>{var L,I,N,R,T;((L=t.cron)==null?void 0:L.month)==="*"&&i("update","month","0","year"),((I=t.cron)==null?void 0:I.day)==="*"&&i("update","day","0","year"),((N=t.cron)==null?void 0:N.hour)==="*"&&i("update","hour","0","year"),((R=t.cron)==null?void 0:R.minute)==="*"&&i("update","min","0","year"),((T=t.cron)==null?void 0:T.second)==="*"&&i("update","second","0","year");const A=v();i("update:modelValue",A),i("update","year",A)},v=()=>{switch(r.value){case 1:return"";case 2:return"*";case 3:return`${o.value}-${a.value}`;case 4:return`${l.value}/${c.value}`;case 5:return m.value;default:return""}},C=()=>{if(r.value===3){o.value=t.checkNumber(o.value,s.value,s.value+100),a.value=t.checkNumber(a.value,s.value+1,s.value+101);const L=`${o.value}-${a.value}`;i("update","year",L),i("update:modelValue",L)}},S=()=>{if(r.value===4){l.value=t.checkNumber(l.value,s.value,s.value+100),c.value=t.checkNumber(c.value,1,10);const L=`${l.value}/${c.value}`;i("update","year",L),i("update:modelValue",L)}},w=L=>{if(!L){r.value=1;return}if(L==="*"){r.value=2;return}if(L.includes("-")){r.value=3;const[I,N]=L.split("-").map(Number);o.value=I,a.value=N;return}if(L.includes("/")){r.value=4;const[I,N]=L.split("/").map(Number);l.value=I,c.value=N;return}if(L.includes(",")){r.value=5,d.value=L.split(",").map(Number);return}isNaN(Number(L))||(r.value=5,d.value=[Number(L)])};return watch(()=>t.modelValue,L=>{L!==void 0&&w(L)}),watch(r,_),watch(f,C),watch(g,S),watch(m,L=>{r.value===5&&(i("update","year",L),i("update:modelValue",L))}),(L,I)=>{const N=resolveComponent("ShadcnRadio"),R=resolveComponent("ShadcnNumber"),T=resolveComponent("ShadcnSelect");return openBlock(),createElementBlock("div",NT,[createBaseVNode("div",IT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":I[0]||(I[0]=A=>r.value=A),value:1,name:"year-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.yearNotFilled")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",LT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":I[1]||(I[1]=A=>r.value=A),value:2,name:"year-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.everyYear")),1)]),_:1},8,["modelValue"])]),createBaseVNode("div",OT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":I[2]||(I[2]=A=>r.value=A),value:3,name:"year-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.periodFrom")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",BT,[createVNode(R,{modelValue:o.value,"onUpdate:modelValue":I[3]||(I[3]=A=>o.value=A),class:"w-24",min:s.value,max:s.value+100},null,8,["modelValue","min","max"]),I[10]||(I[10]=createBaseVNode("span",null,"-",-1)),createVNode(R,{modelValue:a.value,"onUpdate:modelValue":I[4]||(I[4]=A=>a.value=A),class:"w-24",min:s.value,max:s.value+100},null,8,["modelValue","min","max"])])]),createBaseVNode("div",DT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":I[5]||(I[5]=A=>r.value=A),value:4,name:"year-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.fromStart")),1)]),_:1},8,["modelValue"]),createBaseVNode("div",PT,[createVNode(R,{modelValue:l.value,"onUpdate:modelValue":I[6]||(I[6]=A=>l.value=A),class:"w-24",min:s.value,max:s.value+100},null,8,["modelValue","min","max"]),createBaseVNode("span",FT,toDisplayString$1(unref(P)("cron.text.yearStart"))+",",1),createBaseVNode("span",UT,toDisplayString$1(unref(P)("cron.text.every")),1),createVNode(R,{modelValue:c.value,"onUpdate:modelValue":I[7]||(I[7]=A=>c.value=A),class:"w-16",min:1,max:10},null,8,["modelValue"]),createBaseVNode("span",zT,toDisplayString$1(unref(P)("cron.text.yearExecute")),1)])]),createBaseVNode("div",WT,[createVNode(N,{modelValue:r.value,"onUpdate:modelValue":I[8]||(I[8]=A=>r.value=A),value:5,name:"year-type"},{default:withCtx(()=>[createTextVNode(toDisplayString$1(unref(P)("cron.text.specify")),1)]),_:1},8,["modelValue"]),createVNode(T,{modelValue:d.value,"onUpdate:modelValue":I[9]||(I[9]=A=>d.value=A),multiple:"",options:u.value,placeholder:unref(P)("cron.placeholder.multiple")},null,8,["modelValue","options","placeholder"])])])}}}),GT={class:"flex flex-col gap-2 relative"},qT={class:"flex space-x-2"},jT={key:0,class:"text-gray-500 space-y-1 mt-4 border-t rounded-sm p-2"},YT={class:"items-center"},KT=defineComponent({__name:"ShadcnCron",props:{modelValue:{default:"* * * * * ?"}},emits:["update:modelValue","on-change"],setup(n,{emit:e}){const t=n,i=e,s=ref(t.modelValue),r=ref([]),o=ref(!1),a=ref(null),l=ref(null),c=ref("seconds"),d=computed(()=>{const T=(s.value||"* * * * * ?").trim().split(" ");return{second:T[0]||"*",minute:T[1]||"*",hour:T[2]||"*",day:T[3]||"*",month:T[4]||"*",week:T[5]||"?",year:T[6]||void 0}}),u=computed(()=>({second:f.value,minute:g.value,hour:m.value,day:_.value,month:v.value,week:C.value,year:S.value})),f=ref(d.value.second),g=ref(d.value.minute),m=ref(d.value.hour),_=ref(d.value.day),v=ref(d.value.month),C=ref(d.value.week),S=ref(d.value.year),w=[{label:P("cron.text.second"),value:"seconds"},{label:P("cron.text.minute"),value:"minutes"},{label:P("cron.text.hour"),value:"hours"},{label:P("cron.text.day"),value:"day"},{label:P("cron.text.month"),value:"month"},{label:P("cron.text.week"),value:"week"},{label:P("cron.text.year"),value:"year"}],L=(T,A)=>{switch(T){case"second":f.value=A;break;case"minute":g.value=A;break;case"hour":m.value=A;break;case"day":_.value=A,A!=="?"&&C.value!=="?"&&(C.value="?");break;case"month":v.value=A;break;case"week":C.value=A,A!=="?"&&_.value!=="?"&&(_.value="?");break;case"year":S.value=A;break}},I=T=>{T?r.value=N(T,5):r.value=[]};function N(T,A=5){try{return MT(T,A)}catch(F){return console.error(F),[]}}onMounted(()=>{const T=s.value||"* * * * * ?";I(T)});const R=T=>{a.value&&l.value&&!a.value.contains(T.target)&&!l.value.contains(T.target)&&(o.value=!1)};return onMounted(()=>{document.addEventListener("click",R)}),onUnmounted(()=>{document.removeEventListener("click",R)}),watch([f,g,m,_,v,C,S],()=>{const T=[f.value||"*",g.value||"*",m.value||"*",_.value||"*",v.value||"*",C.value||"?"];S.value!==void 0&&T.push(S.value);const A=T.join(" ");s.value=A,I(A),i("on-change",A),i("update:modelValue",A)}),watch(c,()=>{const T=s.value||"* * * * * ?";I(T)}),watch(s,T=>{try{const A=(T||"* * * * * ?").trim().split(" ");if(A.length>=6)f.value=A[0]||"*",g.value=A[1]||"*",m.value=A[2]||"*",_.value=A[3]||"*",v.value=A[4]||"*",C.value=A[5]||"?",S.value=A.length>6?A[6]:void 0,I(T);else throw new Error("Invalid cron expression")}catch{r.value=[]}}),(T,A)=>{const F=resolveComponent("ShadcnInput"),B=resolveComponent("ShadcnTabItem"),W=resolveComponent("ShadcnTab");return openBlock(),createElementBlock("div",GT,[createBaseVNode("div",{ref_key:"inputRef",ref:a,class:"flex items-center space-x-2"},[createVNode(F,{modelValue:s.value,"onUpdate:modelValue":A[0]||(A[0]=G=>s.value=G),readonly:"",class:"text-sm text-gray-500",onClick:A[1]||(A[1]=G=>o.value=!o.value)},null,8,["modelValue"])],512),o.value?(openBlock(),createElementBlock("div",{key:0,ref_key:"panelRef",ref:l,class:"absolute top-full mt-1 bg-white rounded-sm shadow-lg border w-[530px] border-gray-200 p-2 z-20"},[createBaseVNode("div",qT,[createVNode(W,{modelValue:c.value,"onUpdate:modelValue":A[9]||(A[9]=G=>c.value=G),size:"small"},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(w,G=>createVNode(B,{label:G.label,value:G.value},{default:withCtx(()=>[G.value==="seconds"?(openBlock(),createBlock$1(g5,{key:0,modelValue:f.value,"onUpdate:modelValue":A[2]||(A[2]=j=>f.value=j),onUpdate:L},null,8,["modelValue"])):createCommentVNode("",!0),G.value==="minutes"?(openBlock(),createBlock$1(T5,{key:1,modelValue:g.value,"onUpdate:modelValue":A[3]||(A[3]=j=>g.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0),G.value==="hours"?(openBlock(),createBlock$1(U5,{key:2,modelValue:m.value,"onUpdate:modelValue":A[4]||(A[4]=j=>m.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0),G.value==="day"?(openBlock(),createBlock$1(aT,{key:3,modelValue:_.value,"onUpdate:modelValue":A[5]||(A[5]=j=>_.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0),G.value==="month"?(openBlock(),createBlock$1(vT,{key:4,modelValue:v.value,"onUpdate:modelValue":A[6]||(A[6]=j=>v.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0),G.value==="week"?(openBlock(),createBlock$1(TT,{key:5,modelValue:C.value,"onUpdate:modelValue":A[7]||(A[7]=j=>C.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0),G.value==="year"?(openBlock(),createBlock$1(HT,{key:6,modelValue:S.value,"onUpdate:modelValue":A[8]||(A[8]=j=>S.value=j),cron:u.value,onUpdate:L},null,8,["modelValue","cron"])):createCommentVNode("",!0)]),_:2},1032,["label","value"])),64))]),_:1},8,["modelValue"])]),r.value.length?(openBlock(),createElementBlock("div",jT,[createBaseVNode("div",YT,toDisplayString$1(unref(P)("cron.text.nextExecutionTime"))+":",1),(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(G,j)=>(openBlock(),createElementBlock("div",{key:j,class:"text-xs"},toDisplayString$1(unref(P)("cron.text.nextExecutionTimeAtOnN",{n:j+1,time:G})),1))),128))])):createCommentVNode("",!0)],512)):createCommentVNode("",!0)])}}}),JT={class:"flex"},XT={class:"grid grid-flow-col gap-1"},ZT=["onMouseenter","onClick"],QT={key:0,class:"absolute z-20 p-2 text-xs text-white bg-gray-800 rounded whitespace-nowrap transition-all duration-200",style:{bottom:"100%",left:"50%",transform:"translateX(-50%)","margin-bottom":"4px"}},e3={class:"flex flex-col space-y-1"},t3={key:1,class:"w-full h-full rounded-sm"},n3={key:1,class:"flex items-center gap-2 mt-2 text-xs text-gray-500 justify-end"},o3={class:"flex flex-col gap-1.5"},vc=20,a3=defineComponent({__name:"ShadcnContribution",props:{data:{},colorScheme:{default:()=>["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},yearCount:{default:1},showLegend:{type:Boolean,default:!0},showWeek:{type:Boolean,default:!0},showMonth:{type:Boolean,default:!0},cellSize:{default:16},cellGap:{default:4},year:{}},emits:["on-select"],setup(n,{emit:e}){const t=n,i=e,s=computed(()=>{const C=[];if(t.year!==void 0){const S=new Date(Date.UTC(t.year,0,1)),w=new Date(Date.UTC(t.year,11,31)),L=new Date(S);for(console.log("Start Date UTC:",S.toISOString()),console.log("Start Date Local:",S.toLocaleDateString(),"Weekday:",S.getDay()),console.log("Starting date:",S.toISOString(),"Day:",S.getDay());L<=w;){const I=L.toISOString().split("T")[0],N=L.getDay(),R=t.data.find(T=>T.date===I);C.push({date:I,count:R?R.count:0,weekday:N}),L.setDate(L.getDate()+1)}}else{const S=new Date,w=new Date;w.setFullYear(S.getFullYear()-t.yearCount);const L=new Date(w);for(;L<=S;){const I=L.toISOString().split("T")[0],N=t.data.find(R=>R.date===I);C.push({date:I,count:N?N.count:0,weekday:L.getDay()}),L.setDate(L.getDate()+1)}}return C}),r=computed(()=>{var C;const S=s.value,w=[];let L=Array(7).fill(null),I=((C=S[0])==null?void 0:C.weekday)||0;for(let N=0;N{L[N.weekday]=N,(N.weekday===6||R===S.length-1)&&(w.push([...L]),L=Array(7).fill(null))}),w}),o=computed(()=>{const C=[P("datePicker.text.january"),P("datePicker.text.february"),P("datePicker.text.march"),P("datePicker.text.april"),P("datePicker.text.may"),P("datePicker.text.june"),P("datePicker.text.july"),P("datePicker.text.august"),P("datePicker.text.september"),P("datePicker.text.october"),P("datePicker.text.november"),P("datePicker.text.december")],S=[];let w=-1,L=0;return s.value.forEach((I,N)=>{if(N%7===0){const R=new Date(I.date).getMonth();R!==w&&(S.push({label:C[R],offset:L*(t.cellSize+t.cellGap)}),w=R),L++}}),S}),a=C=>C==null||C===0?t.colorScheme[0]:C<=3?t.colorScheme[1]:C<=6?t.colorScheme[2]:C<=9?t.colorScheme[3]:t.colorScheme[4],l=C=>{C&&i("on-select",C)},c=ref(null),d=(C,S)=>{S&&(c.value=S)},u=()=>{c.value=null},f=C=>new Date(C).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric",weekday:"long"}),g=ref(!1),m=()=>{g.value=!0},_=()=>{g.value=!1},v=computed(()=>["0","1-3","4-6","7-9","10+"]);return(C,S)=>(openBlock(),createElementBlock("div",JT,[C.showWeek?(openBlock(),createElementBlock("div",{key:0,class:"flex flex-col mt-6 justify-between mr-2 text-xs text-gray-500 text-center h-[94px] select-none",style:normalizeStyle$1({height:`${7*C.cellSize+6*C.cellGap}px`,marginTop:`${vc}px`})},[createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.sunday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.monday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.tuesday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.wednesday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.thursday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.friday")),1),createBaseVNode("span",null,toDisplayString$1(unref(P)("datePicker.text.saturday")),1)],4)):createCommentVNode("",!0),createBaseVNode("div",null,[C.showMonth?(openBlock(),createElementBlock("div",{key:0,class:"relative select-none",style:normalizeStyle$1({height:`${vc}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(o.value,(w,L)=>(openBlock(),createElementBlock("div",{key:L,class:"absolute text-xs text-gray-500",style:normalizeStyle$1({left:`${w.offset}px`})},toDisplayString$1(w.label),5))),128))],4)):createCommentVNode("",!0),createBaseVNode("div",XT,[(openBlock(!0),createElementBlock(Fragment,null,renderList(r.value,(w,L)=>(openBlock(),createElementBlock("div",{key:L,class:"grid grid-rows-7 gap-1"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(w,(I,N)=>{var R;return openBlock(),createElementBlock("div",{key:N,class:normalizeClass$1(["relative cursor-pointer transition-all duration-200","hover:scale-125 hover:z-10"]),style:normalizeStyle$1({width:`${C.cellSize}px`,height:`${C.cellSize}px`}),onMouseenter:T=>d(T,I),onMouseleave:u,onClick:T=>l(I)},[I?(openBlock(),createElementBlock(Fragment,{key:0},[renderSlot(C.$slots,"cell",{item:I,color:a(I.count)},()=>[createBaseVNode("div",{class:"w-full h-full rounded-sm",style:normalizeStyle$1({backgroundColor:a(I.count)})},null,4)]),((R=c.value)==null?void 0:R.date)===I.date?(openBlock(),createElementBlock("div",QT,[createBaseVNode("div",e3,[createBaseVNode("div",null,toDisplayString$1(f(I.date)),1),createBaseVNode("div",null,toDisplayString$1(I.count)+" "+toDisplayString$1(unref(P)("contribution.text.contribution")),1)])])):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",t3))],44,ZT)}),128))]))),128))]),C.showLegend?(openBlock(),createElementBlock("div",n3,[createBaseVNode("span",null,toDisplayString$1(unref(P)("contribution.text.less")),1),createBaseVNode("div",{class:"flex gap-1 relative group",onMouseenter:m,onMouseleave:_},[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.colorScheme,(w,L)=>(openBlock(),createElementBlock("div",{key:L,style:normalizeStyle$1({backgroundColor:w,width:`${C.cellSize}px`,height:`${C.cellSize}px`}),class:"rounded-sm cursor-help"},null,4))),128)),createBaseVNode("div",{class:normalizeClass$1(["absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 p-2 bg-gray-800 rounded text-white whitespace-nowrap z-50 transition-opacity duration-200",[g.value?"visible opacity-100":"invisible opacity-0"]])},[createBaseVNode("div",o3,[(openBlock(!0),createElementBlock(Fragment,null,renderList(v.value,(w,L)=>(openBlock(),createElementBlock("div",{key:L,class:"flex items-center gap-1"},[createBaseVNode("div",{style:normalizeStyle$1({backgroundColor:t.colorScheme[L],width:`${Math.max(C.cellSize-2,8)}px`,height:`${Math.max(C.cellSize-2,8)}px`}),class:"rounded-sm"},null,4),createBaseVNode("span",null,toDisplayString$1(w),1)]))),128))])],2)],32),createBaseVNode("span",null,toDisplayString$1(unref(P)("contribution.text.more")),1)])):createCommentVNode("",!0)])]))}}),uo=ref(0),Ks=ref(!1),Vr=ref("default"),Er=ref({height:2,animate:!0,duration:300}),go=document.createElement("div");go.style.position="fixed";go.style.top="0";go.style.left="0";go.style.right="0";go.style.zIndex="9999";document.body.appendChild(go);const r3=createApp({render:()=>Ks.value?h$1(Lf,{modelValue:uo.value,class:"w-full",status:Vr.value,height:Er.value.height,duration:Er.value.duration,animate:Er.value.animate}):null});r3.mount(go);let l3=[Nr,q1,Pc,Ob,sw,Uc,at,Yb,Po,uw,dw,cw,pw,Os,vw,gw,kw,Sw,xa,Rw,Iw,Pw,Qc,Dw,oi,ef,Xw,tx,ax,lx,dx,tf,fx,hx,vx,_x,kx,Sx,Ex,Lx,Fx,Ux,Hx,qx,Yx,wc,a2,s2,d2,m2,Mr,v2,k2,S2,A2,L2,q2,wa,Y2,Z2,e_,m_,y_,x_,io,$_,E_,N_,H_,G_,q_,j_,Y_,K_,Q_,tC,nC,rf,af,lf,JC,XC,Y$,lS,iS,SS,AS,MS,T4,B4,F4,If,Lf,H4,rV,bV,dE,bE,PE,r5,KT,a3];const s3=(n,e={})=>{e.locale&&Hd(e.locale),l3.map(t=>{n.component(t.__name,t)}),n.config.globalProperties.$Message=I1,n.config.globalProperties.$Spin=D1,n.config.globalProperties.$setLocale=Hd};let Ms=window;if(typeof Ms<"u"&&Ms.Vue){const n=Ms.Vue.createApp({});s3(n)}typeof window<"u"&&__vitePreload(()=>Promise.resolve({}),["assets/view-shadcn-ui.min-ec946c8d.css"]);const _hoisted_1$1={class:"border-b border-gray-200"},_hoisted_2$1={class:"container mx-auto px-4 h-16"},_hoisted_3$1={class:"flex items-center justify-between h-full"},_hoisted_4$1={class:"flex items-center space-x-4"},_hoisted_5$1={class:"flex items-center"},_hoisted_6$1={class:"text-xl font-semibold text-gray-900 select-none"},_hoisted_7$1={class:"flex items-center space-x-4"},_hoisted_8$1={class:"flex items-center space-x-2"},_hoisted_9$1={href:"https://github.com/devlive-community/view-shadcn-ui/issues/new",target:"_blank"},_sfc_main$1=defineComponent({__name:"header",props:{modelValue:{},title:{},examples:{}},emits:["update:modelValue","onMore"],setup(n){const e=n,t=computed(()=>e.examples.filter(s=>!s.group)),i=computed(()=>e.examples.filter(s=>s.group).reduce((s,r)=>(r.group&&(s[r.group]||(s[r.group]=[]),s[r.group].push(r)),s),{}));return(s,r)=>{const o=resolveComponent("ShadcnSelectOption"),a=resolveComponent("ShadcnSelectGroup"),l=resolveComponent("ShadcnSelect"),c=resolveComponent("ShadcnIcon"),d=resolveComponent("ShadcnButton"),u=resolveComponent("ShadcnTooltip");return openBlock(),createElementBlock("header",_hoisted_1$1,[createBaseVNode("div",_hoisted_2$1,[createBaseVNode("div",_hoisted_3$1,[createBaseVNode("div",_hoisted_4$1,[createBaseVNode("div",_hoisted_5$1,[r[2]||(r[2]=createBaseVNode("img",{src:"https://view-shadcn-ui.devlive.org/logo.svg",alt:"Logo",class:"w-8 h-8 mr-2"},null,-1)),createBaseVNode("h1",_hoisted_6$1,toDisplayString$1(s.title),1)])]),createBaseVNode("div",_hoisted_7$1,[createVNode(l,{"model-value":s.modelValue,"onUpdate:modelValue":r[0]||(r[0]=f=>s.$emit("update:modelValue",f)),style:{"min-width":"200px"},placeholder:"Choose example"},{options:withCtx(()=>[t.value.length>0?(openBlock(),createBlock$1(a,{key:0,label:"General"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(t.value,f=>(openBlock(),createBlock$1(o,{key:f.key,label:f.label,value:f.key},null,8,["label","value"]))),128))]),_:1})):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(i.value,(f,g)=>(openBlock(),createBlock$1(a,{key:g,label:g},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(f,m=>(openBlock(),createBlock$1(o,{key:m.key,label:m.label,value:m.key},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["model-value"]),createBaseVNode("div",_hoisted_8$1,[createVNode(u,{content:"New Example",position:"bottom"},{default:withCtx(()=>[createBaseVNode("a",_hoisted_9$1,[createVNode(d,{circle:"",type:"text"},{default:withCtx(()=>[createVNode(c,{icon:"Plus",size:"18",class:"text-black"})]),_:1})])]),_:1}),createBaseVNode("button",{class:"px-3 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",onClick:r[1]||(r[1]=f=>s.$emit("onMore"))},r[3]||(r[3]=[createBaseVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},[createBaseVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"})],-1)]))])])])])])}}});/** +* @vue/compiler-sfc v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function makeMap(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const EMPTY_OBJ=Object.freeze({}),NOOP=()=>{},NO=()=>!1,isOn=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),extend=Object.assign,hasOwnProperty$3=Object.prototype.hasOwnProperty,hasOwn=(n,e)=>hasOwnProperty$3.call(n,e),isArray$3=Array.isArray,isMap=n=>toTypeString(n)==="[object Map]",isSet=n=>toTypeString(n)==="[object Set]",isFunction$1=n=>typeof n=="function",isString$1=n=>typeof n=="string",isSymbol$1=n=>typeof n=="symbol",isObject$2=n=>n!==null&&typeof n=="object",objectToString$1=Object.prototype.toString,toTypeString=n=>objectToString$1.call(n),isPlainObject=n=>toTypeString(n)==="[object Object]",isReservedProp=makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),isBuiltInDirective=makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),cacheStringFunction=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},camelizeRE=/-(\w)/g,camelize=cacheStringFunction(n=>n.replace(camelizeRE,(e,t)=>t?t.toUpperCase():"")),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(n=>n.replace(hyphenateRE,"-$1").toLowerCase()),capitalize=cacheStringFunction(n=>n.charAt(0).toUpperCase()+n.slice(1)),toHandlerKey=cacheStringFunction(n=>n?`on${capitalize(n)}`:""),identRE=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;function genPropsAccessExp(n){return identRE.test(n)?`__props.${n}`:`__props[${JSON.stringify(n)}]`}function genCacheKey(n,e){return n+JSON.stringify(e,(t,i)=>typeof i=="function"?i.toString():i)}const PatchFlagNames={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},slotFlagsText={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},GLOBALS_ALLOWED="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",isGloballyAllowed=makeMap(GLOBALS_ALLOWED),range=2;function generateCodeFrame(n,e=0,t=n.length){if(e=Math.max(0,Math.min(e,n.length)),t=Math.max(0,Math.min(t,n.length)),e>t)return"";let i=n.split(/(\r?\n)/);const s=i.filter((a,l)=>l%2===1);i=i.filter((a,l)=>l%2===0);let r=0;const o=[];for(let a=0;a=e){for(let l=a-range;l<=a+range||t>r;l++){if(l<0||l>=i.length)continue;const c=l+1;o.push(`${c}${" ".repeat(Math.max(3-String(c).length,0))}| ${i[l]}`);const d=i[l].length,u=s[l]&&s[l].length||0;if(l===a){const f=e-(r-(d+u)),g=Math.max(1,t>r?d-f:t-e);o.push(" | "+" ".repeat(f)+"^".repeat(g))}else if(l>a){if(t>r){const f=Math.max(Math.min(t-r,d),1);o.push(" | "+"^".repeat(f))}r+=d+u}}break}return o.join(` +`)}function normalizeStyle(n){if(isArray$3(n)){const e={};for(let t=0;t{if(t){const i=t.split(propertyDelimiterRE);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function stringifyStyle(n){if(!n)return"";if(isString$1(n))return n;let e="";for(const t in n){const i=n[t];if(isString$1(i)||typeof i=="number"){const s=t.startsWith("--")?t:hyphenate(t);e+=`${s}:${i};`}}return e}function normalizeClass(n){let e="";if(isString$1(n))e=n;else if(isArray$3(n))for(let t=0;t]/;function escapeHtml$1(n){const e=""+n,t=escapeRE.exec(e);if(!t)return e;let i="",s,r,o=0;for(r=t.index;r!!(n&&n.__v_isRef===!0),toDisplayString=n=>isString$1(n)?n:n==null?"":isArray$3(n)||isObject$2(n)&&(n.toString===objectToString$1||!isFunction$1(n.toString))?isRef(n)?toDisplayString(n.value):JSON.stringify(n,replacer,2):String(n),replacer=(n,e)=>isRef(e)?replacer(n,e.value):isMap(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[stringifySymbol(i,r)+" =>"]=s,t),{})}:isSet(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>stringifySymbol(t))}:isSymbol$1(e)?stringifySymbol(e):isObject$2(e)&&!isArray$3(e)&&!isPlainObject(e)?String(e):e,stringifySymbol=(n,e="")=>{var t;return isSymbol$1(n)?`Symbol(${(t=n.description)!=null?t:e})`:n},FRAGMENT=Symbol("Fragment"),TELEPORT=Symbol("Teleport"),SUSPENSE=Symbol("Suspense"),KEEP_ALIVE=Symbol("KeepAlive"),BASE_TRANSITION=Symbol("BaseTransition"),OPEN_BLOCK=Symbol("openBlock"),CREATE_BLOCK=Symbol("createBlock"),CREATE_ELEMENT_BLOCK=Symbol("createElementBlock"),CREATE_VNODE=Symbol("createVNode"),CREATE_ELEMENT_VNODE=Symbol("createElementVNode"),CREATE_COMMENT=Symbol("createCommentVNode"),CREATE_TEXT=Symbol("createTextVNode"),CREATE_STATIC=Symbol("createStaticVNode"),RESOLVE_COMPONENT=Symbol("resolveComponent"),RESOLVE_DYNAMIC_COMPONENT=Symbol("resolveDynamicComponent"),RESOLVE_DIRECTIVE=Symbol("resolveDirective"),RESOLVE_FILTER=Symbol("resolveFilter"),WITH_DIRECTIVES=Symbol("withDirectives"),RENDER_LIST=Symbol("renderList"),RENDER_SLOT=Symbol("renderSlot"),CREATE_SLOTS=Symbol("createSlots"),TO_DISPLAY_STRING=Symbol("toDisplayString"),MERGE_PROPS=Symbol("mergeProps"),NORMALIZE_CLASS=Symbol("normalizeClass"),NORMALIZE_STYLE=Symbol("normalizeStyle"),NORMALIZE_PROPS=Symbol("normalizeProps"),GUARD_REACTIVE_PROPS=Symbol("guardReactiveProps"),TO_HANDLERS=Symbol("toHandlers"),CAMELIZE=Symbol("camelize"),CAPITALIZE=Symbol("capitalize"),TO_HANDLER_KEY=Symbol("toHandlerKey"),SET_BLOCK_TRACKING=Symbol("setBlockTracking"),PUSH_SCOPE_ID=Symbol("pushScopeId"),POP_SCOPE_ID=Symbol("popScopeId"),WITH_CTX=Symbol("withCtx"),UNREF=Symbol("unref"),IS_REF=Symbol("isRef"),WITH_MEMO=Symbol("withMemo"),IS_MEMO_SAME=Symbol("isMemoSame"),helperNameMap={[FRAGMENT]:"Fragment",[TELEPORT]:"Teleport",[SUSPENSE]:"Suspense",[KEEP_ALIVE]:"KeepAlive",[BASE_TRANSITION]:"BaseTransition",[OPEN_BLOCK]:"openBlock",[CREATE_BLOCK]:"createBlock",[CREATE_ELEMENT_BLOCK]:"createElementBlock",[CREATE_VNODE]:"createVNode",[CREATE_ELEMENT_VNODE]:"createElementVNode",[CREATE_COMMENT]:"createCommentVNode",[CREATE_TEXT]:"createTextVNode",[CREATE_STATIC]:"createStaticVNode",[RESOLVE_COMPONENT]:"resolveComponent",[RESOLVE_DYNAMIC_COMPONENT]:"resolveDynamicComponent",[RESOLVE_DIRECTIVE]:"resolveDirective",[RESOLVE_FILTER]:"resolveFilter",[WITH_DIRECTIVES]:"withDirectives",[RENDER_LIST]:"renderList",[RENDER_SLOT]:"renderSlot",[CREATE_SLOTS]:"createSlots",[TO_DISPLAY_STRING]:"toDisplayString",[MERGE_PROPS]:"mergeProps",[NORMALIZE_CLASS]:"normalizeClass",[NORMALIZE_STYLE]:"normalizeStyle",[NORMALIZE_PROPS]:"normalizeProps",[GUARD_REACTIVE_PROPS]:"guardReactiveProps",[TO_HANDLERS]:"toHandlers",[CAMELIZE]:"camelize",[CAPITALIZE]:"capitalize",[TO_HANDLER_KEY]:"toHandlerKey",[SET_BLOCK_TRACKING]:"setBlockTracking",[PUSH_SCOPE_ID]:"pushScopeId",[POP_SCOPE_ID]:"popScopeId",[WITH_CTX]:"withCtx",[UNREF]:"unref",[IS_REF]:"isRef",[WITH_MEMO]:"withMemo",[IS_MEMO_SAME]:"isMemoSame"};function registerRuntimeHelpers(n){Object.getOwnPropertySymbols(n).forEach(e=>{helperNameMap[e]=n[e]})}const Namespaces={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},NodeTypes={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},ElementTypes={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},ConstantTypes={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},locStub={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function createRoot(n,e=""){return{type:0,source:e,children:n,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:locStub}}function createVNodeCall(n,e,t,i,s,r,o,a=!1,l=!1,c=!1,d=locStub){return n&&(a?(n.helper(OPEN_BLOCK),n.helper(getVNodeBlockHelper(n.inSSR,c))):n.helper(getVNodeHelper(n.inSSR,c)),o&&n.helper(WITH_DIRECTIVES)),{type:13,tag:e,props:t,children:i,patchFlag:s,dynamicProps:r,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:d}}function createArrayExpression(n,e=locStub){return{type:17,loc:e,elements:n}}function createObjectExpression(n,e=locStub){return{type:15,loc:e,properties:n}}function createObjectProperty(n,e){return{type:16,loc:locStub,key:isString$1(n)?createSimpleExpression(n,!0):n,value:e}}function createSimpleExpression(n,e=!1,t=locStub,i=0){return{type:4,loc:t,content:n,isStatic:e,constType:e?3:i}}function createInterpolation(n,e){return{type:5,loc:e,content:isString$1(n)?createSimpleExpression(n,!1,e):n}}function createCompoundExpression(n,e=locStub){return{type:8,loc:e,children:n}}function createCallExpression(n,e=[],t=locStub){return{type:14,loc:t,callee:n,arguments:e}}function createFunctionExpression(n,e=void 0,t=!1,i=!1,s=locStub){return{type:18,params:n,returns:e,newline:t,isSlot:i,loc:s}}function createConditionalExpression(n,e,t,i=!0){return{type:19,test:n,consequent:e,alternate:t,newline:i,loc:locStub}}function createCacheExpression(n,e,t=!1,i=!1){return{type:20,index:n,value:e,needPauseTracking:t,inVOnce:i,needArraySpread:!1,loc:locStub}}function createBlockStatement(n){return{type:21,body:n,loc:locStub}}function createTemplateLiteral(n){return{type:22,elements:n,loc:locStub}}function createIfStatement(n,e,t){return{type:23,test:n,consequent:e,alternate:t,loc:locStub}}function createAssignmentExpression(n,e){return{type:24,left:n,right:e,loc:locStub}}function createSequenceExpression(n){return{type:25,expressions:n,loc:locStub}}function createReturnStatement(n){return{type:26,returns:n,loc:locStub}}function getVNodeHelper(n,e){return n||e?CREATE_VNODE:CREATE_ELEMENT_VNODE}function getVNodeBlockHelper(n,e){return n||e?CREATE_BLOCK:CREATE_ELEMENT_BLOCK}function convertToBlock(n,{helper:e,removeHelper:t,inSSR:i}){n.isBlock||(n.isBlock=!0,t(getVNodeHelper(i,n.isComponent)),e(OPEN_BLOCK),e(getVNodeBlockHelper(i,n.isComponent)))}var htmlDecodeTree=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(n=>n.charCodeAt(0))),xmlDecodeTree=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0))),_a$1;const decodeMap=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fromCodePoint=(_a$1=String.fromCodePoint)!==null&&_a$1!==void 0?_a$1:function(n){let e="";return n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),e+=String.fromCharCode(n),e};function replaceCodePoint(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=decodeMap.get(n))!==null&&e!==void 0?e:n}var CharCodes;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.EQUALS=61]="EQUALS",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.LOWER_Z=122]="LOWER_Z",n[n.UPPER_A=65]="UPPER_A",n[n.UPPER_F=70]="UPPER_F",n[n.UPPER_Z=90]="UPPER_Z"})(CharCodes||(CharCodes={}));const TO_LOWER_BIT=32;var BinTrieFlags;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(BinTrieFlags||(BinTrieFlags={}));function isNumber$1(n){return n>=CharCodes.ZERO&&n<=CharCodes.NINE}function isHexadecimalCharacter(n){return n>=CharCodes.UPPER_A&&n<=CharCodes.UPPER_F||n>=CharCodes.LOWER_A&&n<=CharCodes.LOWER_F}function isAsciiAlphaNumeric(n){return n>=CharCodes.UPPER_A&&n<=CharCodes.UPPER_Z||n>=CharCodes.LOWER_A&&n<=CharCodes.LOWER_Z||isNumber$1(n)}function isEntityInAttributeInvalidEnd(n){return n===CharCodes.EQUALS||isAsciiAlphaNumeric(n)}var EntityDecoderState;(function(n){n[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity"})(EntityDecoderState||(EntityDecoderState={}));var DecodingMode;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(DecodingMode||(DecodingMode={}));class EntityDecoder{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=EntityDecoderState.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=DecodingMode.Strict}startEntity(e){this.decodeMode=e,this.state=EntityDecoderState.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case EntityDecoderState.EntityStart:return e.charCodeAt(t)===CharCodes.NUM?(this.state=EntityDecoderState.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=EntityDecoderState.NamedEntity,this.stateNamedEntity(e,t));case EntityDecoderState.NumericStart:return this.stateNumericStart(e,t);case EntityDecoderState.NumericDecimal:return this.stateNumericDecimal(e,t);case EntityDecoderState.NumericHex:return this.stateNumericHex(e,t);case EntityDecoderState.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|TO_LOWER_BIT)===CharCodes.LOWER_X?(this.state=EntityDecoderState.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=EntityDecoderState.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,s){if(t!==i){const r=i-t;this.result=this.result*Math.pow(s,r)+parseInt(e.substr(t,r),s),this.consumed+=r}}stateNumericHex(e,t){const i=t;for(;t>14;for(;t>14,r!==0){if(o===CharCodes.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==DecodingMode.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,s=(i[t]&BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~BinTrieFlags.VALUE_LENGTH:s[e+1],i),t===3&&this.emitCodePoint(s[e+2],i),i}end(){var e;switch(this.state){case EntityDecoderState.NamedEntity:return this.result!==0&&(this.decodeMode!==DecodingMode.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case EntityDecoderState.NumericDecimal:return this.emitNumericEntity(0,2);case EntityDecoderState.NumericHex:return this.emitNumericEntity(0,3);case EntityDecoderState.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case EntityDecoderState.EntityStart:return 0}}}function getDecoder(n){let e="";const t=new EntityDecoder(n,i=>e+=fromCodePoint(i));return function(s,r){let o=0,a=0;for(;(a=s.indexOf("&",a))>=0;){e+=s.slice(o,a),t.startEntity(r);const c=t.write(s,a+1);if(c<0){o=a+t.end();break}o=a+c,a=c===0?o+1:o}const l=e+s.slice(o);return e="",l}}function determineBranch(n,e,t,i){const s=(e&BinTrieFlags.BRANCH_LENGTH)>>7,r=e&BinTrieFlags.JUMP_TABLE;if(s===0)return r!==0&&i===r?t:-1;if(r){const l=i-r;return l<0||l>=s?-1:n[t+l]-1}let o=t,a=o+s-1;for(;o<=a;){const l=o+a>>>1,c=n[l];if(ci)a=l-1;else return n[l+s]}return-1}const htmlDecoder=getDecoder(htmlDecodeTree);getDecoder(xmlDecodeTree);function decodeHTML(n,e=DecodingMode.Legacy){return htmlDecoder(n,e)}const defaultDelimitersOpen=new Uint8Array([123,123]),defaultDelimitersClose=new Uint8Array([125,125]);function isTagStartChar(n){return n>=97&&n<=122||n>=65&&n<=90}function isWhitespace(n){return n===32||n===10||n===9||n===12||n===13}function isEndOfTagSection(n){return n===47||n===62||isWhitespace(n)}function toCharCodes(n){const e=new Uint8Array(n.length);for(let t=0;tthis.emitCodePoint(i,s))}get inSFCRoot(){return this.mode===2&&this.stack.length===0}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=defaultDelimitersOpen,this.delimiterClose=defaultDelimitersClose}getPos(e){let t=1,i=e+1;for(let s=this.newlines.length-1;s>=0;s--){const r=this.newlines[s];if(e>r){t=s+2,i=e-r;break}}return{column:i,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):e===38?this.startEntity():!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const t=this.index+1-this.delimiterOpen.length;t>this.sectionStart&&this.cbs.ontext(this.sectionStart,t),this.state=3,this.sectionStart=t}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(!(t?isEndOfTagSection(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!t){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||isWhitespace(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart=0?(this.state=this.baseState,e===0&&(this.index=this.entityStart)):this.index=this.buffer.length-1}}parse(e){for(this.buffer=e;this.index=e||(this.state===28?this.currentSequence===Sequences.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==1&&this.baseState!==32?(this.sectionStart`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${n}.sync\` should be changed to \`v-model:${n}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with