@chillicream/nitro-embedded 30.0.0 → 30.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/assets/{context-providers.a6cbd8ae.-xn453sc.js → context-providers.32393d3f.4lja1-Yv.js} +7 -5
  2. package/assets/{editor.worker.a6cbd8ae.DKTbkej7.js → editor.worker.32393d3f.BtBOsr77.js} +1 -1
  3. package/assets/{graphql-engine-scheduler.a6cbd8ae.CRCZH9eT.js → graphql-engine-scheduler.32393d3f.BKOKUF1h.js} +1 -1
  4. package/assets/{graphql-indexer-scheduler.a6cbd8ae.Bvw8ykb0.js → graphql-indexer-scheduler.32393d3f.ClPGWCSG.js} +1 -1
  5. package/assets/{graphql.worker.a6cbd8ae.DrQju_5S.js → graphql.worker.32393d3f.DCbruaJI.js} +1 -1
  6. package/assets/{index.a6cbd8ae.DH9clVIb.js → index.32393d3f.C6Jm2J7w.js} +1 -1
  7. package/assets/{json.worker.a6cbd8ae.BAHwolUd.js → json.worker.32393d3f.8ac-t4iI.js} +1 -1
  8. package/assets/{jsonMode.a6cbd8ae.D9G33m7j.js → jsonMode.32393d3f.Da25eQ7o.js} +1 -1
  9. package/assets/{main.a6cbd8ae.nI2HRy2W.js → main.32393d3f.Cjljin1C.js} +7 -7
  10. package/assets/{monaco.a6cbd8ae.yVFOAV5a.css → monaco.32393d3f.CDcGk4NI.css} +1 -1
  11. package/assets/{monaco.a6cbd8ae.DRTmByXd.js → monaco.32393d3f.CRafqNYy.js} +2 -2
  12. package/assets/{monaco.a6cbd8ae.Cx26j2kT.css → monaco.32393d3f.C_iiYC8A.css} +1 -1
  13. package/assets/{session-scheduler.a6cbd8ae.Cs3Lp-R6.js → session-scheduler.32393d3f.l7O1I_X6.js} +1 -1
  14. package/assets/{yaml.a6cbd8ae.BrAx0Nnq.js → yaml.32393d3f.CV00odnb.js} +1 -1
  15. package/assets/{yaml.worker.a6cbd8ae.BOVYkCVk.js → yaml.worker.32393d3f.B4fVFlVP.js} +1 -1
  16. package/index.html +4 -4
  17. package/package.json +1 -1
  18. package/service-worker.js +1 -1
  19. /package/assets/{FiraCode-Medium.a6cbd8ae.-YTCSZkP.woff2 → FiraCode-Medium.32393d3f.-YTCSZkP.woff2} +0 -0
  20. /package/assets/{codicon.a6cbd8ae.Hscy-R9e.ttf → codicon.32393d3f.Hscy-R9e.ttf} +0 -0
  21. /package/assets/{context-providers.a6cbd8ae.3HkX5s82.css → context-providers.32393d3f.3HkX5s82.css} +0 -0
  22. /package/assets/{main.a6cbd8ae.O2wwCX4n.css → main.32393d3f.O2wwCX4n.css} +0 -0
  23. /package/assets/{monaco.a6cbd8ae.DPHEUpPG.js → monaco.32393d3f.B9m8JSsx.js} +0 -0
  24. /package/assets/{monaco.a6cbd8ae.v2QsmtMC.js → monaco.32393d3f.BAXraPs4.js} +0 -0
  25. /package/assets/{monaco.a6cbd8ae.CX283ebn.js → monaco.32393d3f.DLGK8xR9.js} +0 -0
  26. /package/assets/{monaco.a6cbd8ae.EZduqCri.js → monaco.32393d3f.FxNpxLqs.js} +0 -0
  27. /package/assets/{monaco.a6cbd8ae.B_bsp91k.js → monaco.32393d3f.GGEmU9pB.js} +0 -0
@@ -643,12 +643,12 @@ ${e.toString()}`}}class Dw{constructor(e=new xv,t=!1,i,n=gre){var s;this._servic
643
643
  * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
644
644
  * Released under the MIT license
645
645
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
646
- *-----------------------------------------------------------------------------*/var Bde=Object.defineProperty,Wde=Object.getOwnPropertyDescriptor,Vde=Object.getOwnPropertyNames,Hde=Object.prototype.hasOwnProperty,zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vde(e))!Hde.call(o,n)&&n!==t&&Bde(o,n,{get:()=>e[n],enumerable:!(i=Wde(e,n))||i.enumerable});return o},Ude=(o,e,t)=>(zde(o,e,"default"),t),qm={};Ude(qm,c6);var h6={},Jx={},u6=class{static getOrCreate(o){return Jx[o]||(Jx[o]=new u6(o)),Jx[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,h6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function $de(o){const e=o.id;h6[e]=o,qm.languages.register(o);const t=u6.getOrCreate(e);qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();qm.languages.setLanguageConfiguration(e,i.conf)})}$de({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>l3(()=>import("./yaml.a6cbd8ae.BrAx0Nnq.js"),[],import.meta.url)});/*!-----------------------------------------------------------------------------
646
+ *-----------------------------------------------------------------------------*/var Bde=Object.defineProperty,Wde=Object.getOwnPropertyDescriptor,Vde=Object.getOwnPropertyNames,Hde=Object.prototype.hasOwnProperty,zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vde(e))!Hde.call(o,n)&&n!==t&&Bde(o,n,{get:()=>e[n],enumerable:!(i=Wde(e,n))||i.enumerable});return o},Ude=(o,e,t)=>(zde(o,e,"default"),t),qm={};Ude(qm,c6);var h6={},Jx={},u6=class{static getOrCreate(o){return Jx[o]||(Jx[o]=new u6(o)),Jx[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,h6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function $de(o){const e=o.id;h6[e]=o,qm.languages.register(o);const t=u6.getOrCreate(e);qm.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),qm.languages.onLanguageEncountered(e,async()=>{const i=await t.load();qm.languages.setLanguageConfiguration(e,i.conf)})}$de({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>l3(()=>import("./yaml.32393d3f.CV00odnb.js"),[],import.meta.url)});/*!-----------------------------------------------------------------------------
647
647
  * Copyright (c) Microsoft Corporation. All rights reserved.
648
648
  * Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
649
649
  * Released under the MIT license
650
650
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
651
- *-----------------------------------------------------------------------------*/var Kde=Object.defineProperty,jde=Object.getOwnPropertyDescriptor,qde=Object.getOwnPropertyNames,Gde=Object.prototype.hasOwnProperty,Zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qde(e))!Gde.call(o,n)&&n!==t&&Kde(o,n,{get:()=>e[n],enumerable:!(i=jde(e,n))||i.enumerable});return o},Yde=(o,e,t)=>(Zde(o,e,"default"),t),Wv={};Yde(Wv,c6);var Xde=class{_onDidChange=new Wv.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(o,e,t){this._languageId=o,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(this)}},Qde={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Jde={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},g6=new Xde("json",Qde,Jde);Wv.languages.json={jsonDefaults:g6};function ece(){return l3(()=>import("./jsonMode.a6cbd8ae.D9G33m7j.js"),[],import.meta.url)}Wv.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Wv.languages.onLanguage("json",()=>{ece().then(o=>o.setupMode(g6))});function eD(o,e){return e&&(o.stack||o.stacktrace)?p("stackTrace.format","{0}: {1}",UF(o),zF(o.stack)||zF(o.stacktrace)):UF(o)}function zF(o){return Array.isArray(o)?o.join(`
651
+ *-----------------------------------------------------------------------------*/var Kde=Object.defineProperty,jde=Object.getOwnPropertyDescriptor,qde=Object.getOwnPropertyNames,Gde=Object.prototype.hasOwnProperty,Zde=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qde(e))!Gde.call(o,n)&&n!==t&&Kde(o,n,{get:()=>e[n],enumerable:!(i=jde(e,n))||i.enumerable});return o},Yde=(o,e,t)=>(Zde(o,e,"default"),t),Wv={};Yde(Wv,c6);var Xde=class{_onDidChange=new Wv.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(o,e,t){this._languageId=o,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(this)}},Qde={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Jde={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},g6=new Xde("json",Qde,Jde);Wv.languages.json={jsonDefaults:g6};function ece(){return l3(()=>import("./jsonMode.32393d3f.Da25eQ7o.js"),[],import.meta.url)}Wv.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Wv.languages.onLanguage("json",()=>{ece().then(o=>o.setupMode(g6))});function eD(o,e){return e&&(o.stack||o.stacktrace)?p("stackTrace.format","{0}: {1}",UF(o),zF(o.stack)||zF(o.stacktrace)):UF(o)}function zF(o){return Array.isArray(o)?o.join(`
652
652
  `):o}function UF(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?p("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function f6(o=null,e=!1){if(!o)return p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Qr(o),i=f6(t[0],e);return t.length>1?p("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(ds(o))return o;if(o.detail){const t=o.detail;if(t.error)return eD(t.error,e);if(t.exception)return eD(t.exception,e)}return o.stack?eD(o,e):o.message?o.message:p("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function tce(o){var e;const t=new Map;for(const i of o)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class S_{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&s.push({key:r,score:d})}}return s}static termFrequencies(e){return tce(S_.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const n=[];for(const s of i.textChunks){const r=S_.termFrequencies(s);for(const a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);n.push({text:s,tf:r})}this.chunkCount+=n.length,this.documents.set(i.key,{chunks:n})}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 n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const r=s-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,r]of Object.entries(t)){const a=e.tf.get(s);if(!a)continue;let l=i.get(s);typeof l!="number"&&(l=this.computeIdf(s),i.set(s,l));const d=a*l;n+=d*r}return n}computeEmbedding(e){const t=S_.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function ice(o){var e,t;const i=o.slice(0);i.sort((s,r)=>r.score-s.score);const n=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(n>0)for(const s of i)s.score/=n;return i}var hf;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(hf||(hf={}));function tD(o){const e=o;return Array.isArray(e.items)}function $F(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class nce extends K{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const s=new se;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const a=s.add(new Cn),l=async()=>{const d=a.value=new se;r?.dispose(!0),e.busy=!1,r=new Wi(t);const c=r.token,h=e.value.substr(this.prefix.length).trim(),u=this._getPicks(h,d,c,i),g=(m,_)=>{var v;let b,C;if(tD(m)?(b=m.items,C=m.active):b=m,b.length===0){if(_)return!1;(h.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(P_(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},f=async m=>{let _=!1,v=!1;await Promise.all([(async()=>{typeof m.mergeDelay=="number"&&(await Mc(m.mergeDelay),c.isCancellationRequested)||v||(_=g(m.picks,!0))})(),(async()=>{e.busy=!0;try{const b=await m.additionalPicks;if(c.isCancellationRequested)return;let C,w;tD(m.picks)?(C=m.picks.items,w=m.picks.active):C=m.picks;let y,I;if(tD(b)?(y=b.items,I=b.active):y=b,y.length>0||!_){let D;if(!w&&!I){const T=e.activeItems[0];T&&C.indexOf(T)!==-1&&(D=T)}g({items:[...C,...y],active:w||I||D})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}})()])};if(u!==null)if($F(u))await f(u);else if(!(u instanceof Promise))g(u);else{e.busy=!0;try{const m=await u;if(c.isCancellationRequested)return;$F(m)?await f(m):g(m)}finally{c.isCancellationRequested||(e.busy=!1)}}};return s.add(e.onDidChangeValue(()=>l())),l(),s.add(e.onDidAccept(d=>{const[c]=e.selectedItems;typeof c?.accept=="function"&&(d.inBackground||e.hide(),c.accept(e.keyMods,d))})),s.add(e.onDidTriggerItemButton(async({button:d,item:c})=>{var h,u;if(typeof c.trigger=="function"){const g=(u=(h=c.buttons)===null||h===void 0?void 0:h.indexOf(d))!==null&&u!==void 0?u:-1;if(g>=0){const f=c.trigger(g,e.keyMods),m=typeof f=="number"?f:await f;if(t.isCancellationRequested)return;switch(m){case hf.NO_ACTION:break;case hf.CLOSE_PICKER:e.hide();break;case hf.REFRESH_PICKER:l();break;case hf.REMOVE_ITEM:{const _=e.items.indexOf(c);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),C=e.activeItems.filter(y=>y!==b[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,C&&(e.activeItems=C),e.keepScrollPosition=w}break}}}}})),s}}var p6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qh=function(o,e){return function(t,i){e(t,i,o)}},Fh,zi;let Ou=Fh=class extends nce{constructor(e,t,i,n,s,r){super(Fh.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(Kc)),this.options=e}async _getPicks(e,t,i,n){var s,r,a,l;const d=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const c=_u(()=>{const v=new S_;v.updateDocuments(d.map(C=>({key:C.commandId,textChunks:[this.getTfIdfChunk(C)]})));const b=v.calculateScores(e,i);return ice(b).filter(C=>C.score>Fh.TFIDF_THRESHOLD).slice(0,Fh.TFIDF_MAX_RESULTS)}),h=[];for(const v of d){const b=(s=Fh.WORD_FILTER(e,v.label))!==null&&s!==void 0?s:void 0,C=v.commandAlias&&(r=Fh.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(b||C)v.highlights={label:b,detail:this.options.showAlias?C:void 0},h.push(v);else if(e===v.commandId)h.push(v);else if(e.length>=3){const w=c();if(i.isCancellationRequested)return[];const y=w.find(I=>I.key===v.commandId);y&&(v.tfIdfScore=y.score,h.push(v))}}const u=new Map;for(const v of h){const b=u.get(v.label);b?(v.description=v.commandId,b.description=b.commandId):u.set(v.label,v)}h.sort((v,b)=>{if(v.tfIdfScore&&b.tfIdfScore)return v.tfIdfScore===b.tfIdfScore?v.label.localeCompare(b.label):b.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const C=this.commandsHistory.peek(v.commandId),w=this.commandsHistory.peek(b.commandId);if(C&&w)return C>w?-1:1;if(C)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const y=this.options.suggestedCommandIds.has(v.commandId),I=this.options.suggestedCommandIds.has(b.commandId);if(y&&I)return 0;if(y)return-1;if(I)return 1}return v.label.localeCompare(b.label)});const g=[];let f=!1,m=!0,_=!!this.options.suggestedCommandIds;for(let v=0;v<h.length;v++){const b=h[v];v===0&&this.commandsHistory.peek(b.commandId)&&(g.push({type:"separator",label:p("recentlyUsed","recently used")}),f=!0),m&&b.tfIdfScore!==void 0&&(g.push({type:"separator",label:p("suggested","similar commands")}),m=!1),_&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(b.commandId))&&(g.push({type:"separator",label:p("commonlyUsed","commonly used")}),f=!0,_=!1),f&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(b.commandId))&&(g.push({type:"separator",label:p("morecCommands","other commands")}),f=!1),g.push(this.toCommandPick(b,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:g,additionalPicks:(async()=>{var v;const b=await this.getAdditionalCommandPicks(d,h,e,i);if(i.isCancellationRequested)return[];const C=b.map(w=>this.toCommandPick(w,n));return m&&((v=C[0])===null||v===void 0?void 0:v.type)!=="separator"&&C.unshift({type:"separator",label:p("suggested","similar commands")}),C})()}:g}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?p("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var s,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(s=t?.from)!==null&&s!==void 0?s:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){oa(a)||this.dialogService.error(p("canNotRun","Command '{0}' resulted in an error",e.label),f6(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}};Ou.PREFIX=">";Ou.TFIDF_THRESHOLD=.5;Ou.TFIDF_MAX_RESULTS=5;Ou.WORD_FILTER=CM(S0,die,B7);Ou=Fh=p6([qh(1,Oe),qh(2,Pt),qh(3,ui),qh(4,Gs),qh(5,Dv)],Ou);let Kc=zi=class extends K{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===y0.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=zi.getConfiguredCommandHistoryLength(this.configurationService),zi.cache&&zi.cache.limit!==this.configuredCommandsHistoryLength&&(zi.cache.limit=this.configuredCommandsHistoryLength,zi.hasChanges=!0))}load(){const e=this.storageService.get(zi.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=zi.cache=new oh(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,r)=>s.value-r.value),n.forEach(s=>i.set(s.key,s.value))}zi.counter=this.storageService.getNumber(zi.PREF_KEY_COUNTER,0,zi.counter)}push(e){zi.cache&&(zi.cache.set(e,zi.counter++),zi.hasChanges=!0)}peek(e){var t;return(t=zi.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!zi.cache||!zi.hasChanges)return;const e={usesLRU:!0,entries:[]};zi.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(zi.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(zi.PREF_KEY_COUNTER,zi.counter,0,0),zi.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,i;const s=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof s=="number"?s:zi.DEFAULT_COMMANDS_HISTORY_LENGTH}};Kc.DEFAULT_COMMANDS_HISTORY_LENGTH=50;Kc.PREF_KEY_CACHE="commandPalette.mru.cache";Kc.PREF_KEY_COUNTER="commandPalette.mru.counter";Kc.counter=1;Kc.hasChanges=!1;Kc=zi=p6([qh(0,da),qh(1,ft)],Kc);class sce extends Ou{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:DM(i.label)||i.id});return t}}var oce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Dg=function(o,e){return function(t,i){e(t,i,o)}};let B0=class extends sce{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,n,s,r){super({showAlias:!1},e,i,n,s,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};B0=oce([Dg(0,Oe),Dg(1,Dt),Dg(2,Pt),Dg(3,ui),Dg(4,Gs),Dg(5,Dv)],B0);class Vv extends we{constructor(){super({id:Vv.ID,label:iw.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(dh).quickAccess.show(B0.PREFIX)}}Vv.ID="editor.action.quickCommand";de(Vv);Ri.as(XM.Quickaccess).registerQuickAccessProvider({ctor:B0,prefix:B0.PREFIX,helpEntries:[{description:iw.quickCommandHelp,commandId:Vv.ID}]});class rce extends ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:p("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:he.map,toggled:te.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:te.has("isInDiffEditor"),menu:{when:te.has("isInDiffEditor"),id:N.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}Xt(rce);class m6 extends ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:p("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:te.has("isInDiffEditor")})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}Xt(m6);class _6 extends ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:p("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:te.has("isInDiffEditor")})}run(e,...t){const i=e.get(ft),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}Xt(_6);vn.appendMenuItem(N.EditorTitle,{command:{id:new _6().desc.id,title:p("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:te.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:te.has("isInDiffEditor")},order:11,group:"1_diff",when:te.and(M.diffEditorRenderSideBySideInlineBreakpointReached,te.has("isInDiffEditor"))});vn.appendMenuItem(N.EditorTitle,{command:{id:new m6().desc.id,title:p("showMoves","Show Moved Code Blocks"),icon:he.move,toggled:Rp.create("config.diffEditor.experimental.showMoves",!0),precondition:te.has("isInDiffEditor")},order:10,group:"1_diff",when:te.has("isInDiffEditor")});const Ny={value:p("diffEditor","Diff Editor"),original:"Diff Editor"};class ace extends aa{constructor(){super({id:"diffEditor.switchSide",title:{value:p("switchSide","Switch Side"),original:"Switch Side"},icon:he.arrowSwap,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof zc){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}Xt(ace);class lce extends aa{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:p("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:he.close,precondition:M.comparingMovedCode,f1:!1,category:Ny,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.exitCompareMove()}}Xt(lce);class dce extends aa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:p("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:he.fold,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.collapseAllUnchangedRegions()}}Xt(dce);class cce extends aa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:p("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:he.unfold,precondition:te.has("isInDiffEditor"),f1:!0,category:Ny})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof zc&&n.showAllUnchangedRegions()}}Xt(cce);const v6={value:p("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class jp extends ko{constructor(){super({id:jp.id,title:{value:p("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:v6,precondition:te.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerNext()}}jp.id="editor.action.accessibleDiffViewer.next";vn.appendMenuItem(N.EditorTitle,{command:{id:jp.id,title:p("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:te.has("isInDiffEditor")},order:10,group:"2_diff",when:te.and(M.accessibleDiffViewerVisible.negate(),te.has("isInDiffEditor"))});class Hv extends ko{constructor(){super({id:Hv.id,title:{value:p("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:v6,precondition:te.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t?.accessibleDiffViewerPrev()}}Hv.id="editor.action.accessibleDiffViewer.prev";function qp(o){var e;const t=o.get(Dt),i=t.listDiffEditors(),n=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!n)return null;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(l.getModifiedEditor().getId()===n.getId()||l.getOriginalEditor().getId()===n.getId())return l}const s=wo();if(s)for(const r of i){const a=r.getContainerDomNode();if(hce(a,s))return r}return null}function hce(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}gt.registerCommandAlias("editor.action.diffReview.next",jp.id);Xt(jp);gt.registerCommandAlias("editor.action.diffReview.prev",Hv.id);Xt(Hv);var uce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gce=function(o,e){return function(t,i){e(t,i,o)}},JE;const Ty=new be("selectionAnchorSet",!1);let fd=JE=class{static get(e){return e.getContribution(JE.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Ty.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(xe.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fn().appendText(p("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),js(p("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(xe.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()}};fd.ID="editor.contrib.selectionAnchorController";fd=JE=uce([gce(1,We)],fd);class fce extends we{constructor(){super({id:"editor.action.setSelectionAnchor",label:p("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2080),weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.setSelectionAnchor()}}class pce extends we{constructor(){super({id:"editor.action.goToSelectionAnchor",label:p("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Ty})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.goToSelectionAnchor()}}class mce extends we{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:p("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Ty,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2089),weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}}class _ce extends we{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:p("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Ty,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=fd.get(t))===null||i===void 0||i.cancelSelectionAnchor()}}yt(fd.ID,fd,4);de(fce);de(pce);de(mce);de(_ce);const vce=R("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},p("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class bce extends we{constructor(){super({id:"editor.action.jumpToBracket",label:p("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=mr.get(t))===null||i===void 0||i.jumpToBracket()}}class Cce extends we{constructor(){super({id:"editor.action.selectToBracket",label:p("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:fH("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 n;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(n=mr.get(t))===null||n===void 0||n.selectToBracket(s)}}class wce extends we{constructor(){super({id:"editor.action.removeBrackets",label:p("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=mr.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class Sce{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class mr extends K{static get(e){return e.getContribution(mr.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Rt(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(r=l.range.getStartPosition())}}return r?new xe(r.lineNumber,r.column,r.lineNumber,r.column):new xe(n.lineNumber,n.column,n.lineNumber,n.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(n=>{const s=n.getStartPosition();let r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const d=t.bracketPairs.findNextBracket(s);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(k.compareRangesUsingStarts);const[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(s)){const h=a;a=l,l=h}}a&&l&&i.push(new xe(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 n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[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 n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[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 n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let r=0;for(let h=0,u=e.length;h<u;h++){const g=e[h];g.isEmpty()&&(s[r++]=g.getStartPosition())}s.length>1&&s.sort(V.compare);const a=[];let l=0,d=0;const c=n.length;for(let h=0,u=s.length;h<u;h++){const g=s[h];for(;d<c&&n[d].position.isBefore(g);)d++;if(d<c&&n[d].position.equals(g))a[l++]=n[d];else{let f=t.bracketPairs.matchBracket(g,20),m=mr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!f&&this._matchBrackets==="always"&&(f=t.bracketPairs.findEnclosingBrackets(g,20),m=mr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Sce(g,f,m)}}this._lastBracketsData=a,this._lastVersionId=i}}mr.ID="editor.contrib.bracketMatchingController";mr._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ze.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:fi(vce),position:Ko.Center}});mr._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ze.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});yt(mr.ID,mr,1);de(Cce);de(bce);de(wce);vn.appendMenuItem(N.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p({},"Go to &&Bracket")},order:2});class yce{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const r=new k(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new k(i,s,i,s),a)}else{const r=new k(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new k(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new xe(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new xe(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class b6 extends we{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new yce(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Lce extends b6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:p("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class xce extends b6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:p("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}de(Lce);de(xce);class Dce extends we{constructor(){super({id:"editor.action.transposeLetters",label:p("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const c=l===d?r.getPosition():It.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),h=It.leftPosition(i,c),u=It.leftPosition(i,h),g=i.getValueInRange(k.fromPositions(u,h)),f=i.getValueInRange(k.fromPositions(h,c)),m=k.fromPositions(u,c);n.push(new kn(m,f+g))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}de(Dce);const Fu="9_cutcopypaste",kce=ol||document.queryCommandSupported("cut"),C6=ol||document.queryCommandSupported("copy"),Ice=typeof navigator.clipboard>"u"||zo?document.queryCommandSupported("paste"):!0;function fR(o){return o.register(),o}const Ece=kce?fR(new Pp({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:ol?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"Cu&&t"),order:1},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.cutLabel","Cut"),when:M.writable,order:1},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.cutLabel","Cut"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.cutLabel","Cut"),when:M.writable,order:1}]})):void 0,Nce=C6?fR(new Pp({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:ol?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Copy"),order:2},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.copyLabel","Copy"),order:2},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.copyLabel","Copy"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;vn.appendMenuItem(N.MenubarEditMenu,{submenu:N.MenubarCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextCopy,title:{value:p("copy as","Copy As"),original:"Copy As"},group:Fu,order:3});vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1,when:te.and(te.notEquals("resourceScheme","output"),M.editorTextFocus)});vn.appendMenuItem(N.EditorTitleContext,{submenu:N.EditorTitleContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});vn.appendMenuItem(N.ExplorerContext,{submenu:N.ExplorerContextShare,title:{value:p("share","Share"),original:"Share"},group:"11_share",order:-1});const iD=Ice?fR(new Pp({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:ol?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:N.MenubarEditMenu,group:"2_ccp",title:p({},"&&Paste"),order:4},{menuId:N.EditorContext,group:Fu,title:p("actions.clipboard.pasteLabel","Paste"),when:M.writable,order:4},{menuId:N.CommandPalette,group:"",title:p("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:N.SimpleEditorContext,group:Fu,title:p("actions.clipboard.pasteLabel","Paste"),when:M.writable,order:4}]})):void 0;class Tce extends we{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:p("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(sI.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),sI.forceCopyWithSyntaxHighlighting=!1)}}function w6(o,e){o&&(o.addImplementation(1e4,"code-editor",(t,i)=>{const n=t.get(Dt).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const s=n.getOption(37),r=n.getSelection();return r&&r.isEmpty()&&!s||n.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),o.addImplementation(0,"generic-dom",(t,i)=>(Ap().execCommand(e),!0)))}w6(Ece,"cut");w6(Nce,"copy");iD&&(iD.addImplementation(1e4,"code-editor",(o,e)=>{const t=o.get(Dt),i=o.get(Sd),n=t.getFocusedCodeEditor();return n&&n.hasTextFocus()?!n.getContainerDomNode().ownerDocument.execCommand("paste")&&th?(async()=>{const r=await i.readText();if(r!==""){const a=a0.INSTANCE.get(r);let l=!1,d=null,c=null;a&&(l=n.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),n.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),iD.addImplementation(0,"generic-dom",(o,e)=>(Ap().execCommand("paste"),!0)));C6&&de(Tce);class Be{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+Be.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Be(this.value+Be.sep+e)}}Be.sep=".";Be.None=new Be("@@none@@");Be.Empty=new Be("");Be.QuickFix=new Be("quickfix");Be.Refactor=new Be("refactor");Be.RefactorExtract=Be.Refactor.append("extract");Be.RefactorInline=Be.Refactor.append("inline");Be.RefactorMove=Be.Refactor.append("move");Be.RefactorRewrite=Be.Refactor.append("rewrite");Be.Notebook=new Be("notebook");Be.Source=new Be("source");Be.SourceOrganizeImports=Be.Source.append("organizeImports");Be.SourceFixAll=Be.Source.append("fixAll");Be.SurroundWith=Be.Refactor.append("surround");var qs;(function(o){o.Refactor="refactor",o.RefactorPreview="refactor preview",o.Lightbulb="lightbulb",o.Default="other (default)",o.SourceAction="source action",o.QuickFix="quick fix action",o.FixAll="fix all",o.OrganizeImports="organize imports",o.AutoFix="auto fix",o.QuickFixHover="quick fix hover window",o.OnSave="save participants",o.ProblemsView="problems view"})(qs||(qs={}));function Mce(o,e){return!(o.include&&!o.include.intersects(e)||o.excludes&&o.excludes.some(t=>S6(e,t,o.include))||!o.includeSourceActions&&Be.Source.contains(e))}function Rce(o,e){const t=e.kind?new Be(e.kind):void 0;return!(o.include&&(!t||!o.include.contains(t))||o.excludes&&t&&o.excludes.some(i=>S6(t,i,o.include))||!o.includeSourceActions&&t&&Be.Source.contains(t)||o.onlyIncludePreferredActions&&!e.isPreferred)}function S6(o,e,t){return!(!e.contains(o)||t&&e.contains(t))}class Va{static fromUser(e,t){return!e||typeof e!="object"?new Va(t.kind,t.apply,!1):new Va(Va.getKindFromUser(e,t.kind),Va.getApplyFromUser(e,t.apply),Va.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 Be(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 Ace{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(n){Mi(n)}i&&(this.action.edit=i.edit)}return this}}const y6="editor.action.codeAction",pR="editor.action.quickFix",L6="editor.action.autoFix",x6="editor.action.refactor",D6="editor.action.sourceAction",mR="editor.action.organizeImports",_R="editor.action.fixAll";class y_ extends K{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Bn(e.diagnostics)?Bn(t.diagnostics)?y_.codeActionsPreferredComparator(e,t):-1:Bn(t.diagnostics)?1:y_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(y_.codeActionsComparator),this.validActions=this.allActions.filter(({action:n})=>!n.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Be.QuickFix.contains(new Be(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 KF={actions:[],documentation:void 0};async function L_(o,e,t,i,n,s){var r;const a=i.filter||{},l={...a,excludes:[...a.excludes||[],Be.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new gR(e,s),h=i.type===2,u=Pce(o,e,h?l:a),g=new se,f=u.map(async _=>{try{n.report(_);const v=await _.provideCodeActions(e,t,d,c.token);if(v&&g.add(v),c.token.isCancellationRequested)return KF;const b=(v?.actions||[]).filter(w=>w&&Rce(a,w)),C=Fce(_,b,a.include);return{actions:b.map(w=>new Ace(w,_)),documentation:C}}catch(v){if(oa(v))throw v;return Mi(v),KF}}),m=o.onDidChange(()=>{const _=o.all(e);_i(_,u)||c.cancel()});try{const _=await Promise.all(f),v=_.map(C=>C.actions).flat(),b=[...Qr(_.map(C=>C.documentation)),...Oce(o,e,i,v)];return new y_(v,b,g)}finally{m.dispose(),c.dispose()}}function Pce(o,e,t){return o.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(n=>Mce(t,new Be(n))):!0)}function*Oce(o,e,t,i){var n,s,r;if(e&&i.length)for(const a of o.all(e))a._getAdditionalMenuItems&&(yield*(n=a._getAdditionalMenuItems)===null||n===void 0?void 0:n.call(a,{trigger:t.type,only:(r=(s=t.filter)===null||s===void 0?void 0:s.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function Fce(o,e,t){if(!o.documentation)return;const i=o.documentation.map(n=>({kind:new Be(n.kind),command:n.command}));if(t){let n;for(const s of i)s.kind.contains(t)&&(n?n.kind.contains(s.kind)&&(n=s):n=s);if(n)return n?.command}for(const n of e)if(n.kind){for(const s of i)if(s.kind.contains(new Be(n.kind)))return s.command}}var Bw;(function(o){o.OnSave="onSave",o.FromProblemsView="fromProblemsView",o.FromCodeActions="fromCodeActions"})(Bw||(Bw={}));async function Bce(o,e,t,i,n=st.None){var s;const r=o.get(kv),a=o.get(ui),l=o.get(Gs),d=o.get(Vi);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(n),!n.isCancellationRequested&&!(!((s=e.action.edit)===null||s===void 0)&&s.edits.length&&!(await r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Bw.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){const h=Wce(c);d.error(typeof h=="string"?h:p("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Wce(o){return typeof o=="string"?o:o instanceof Error&&typeof o.message=="string"?o.message:void 0}gt.registerCommand("_executeCodeActionProvider",async function(o,e,t,i,n){if(!(e instanceof Me))throw Wo();const{codeActionProvider:s}=o.get(Se),r=o.get(ii).getModel(e);if(!r)throw Wo();const a=xe.isISelection(t)?xe.liftSelection(t):k.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Wo();const l=typeof i=="string"?new Be(i):void 0,d=await L_(s,r,a,{type:1,triggerAction:qs.Default,filter:{includeSourceActions:!0,include:l}},ld.None,st.None),c=[],h=Math.min(d.validActions.length,typeof n=="number"?n:0);for(let u=0;u<h;u++)c.push(d.validActions[u].resolve(st.None));try{return await Promise.all(c),d.validActions.map(u=>u.action)}finally{setTimeout(()=>d.dispose(),100)}});var Vce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hce=function(o,e){return function(t,i){e(t,i,o)}},eN;let Ww=eN=class{constructor(e){this.keybindingService=e}getResolver(){const e=new sh(()=>this.keybindingService.getKeybindings().filter(t=>eN.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===mR?i={kind:Be.SourceOrganizeImports.value}:t.command===_R&&(i={kind:Be.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Va.fromUser(i,{kind:Be.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Be(e.kind);return t.filter(n=>n.kind.contains(i)).filter(n=>n.preferred?e.isPreferred:!0).reduceRight((n,s)=>n?n.kind.contains(s.kind)?s:n:s,void 0)}};Ww.codeActionCommands=[x6,y6,D6,mR,_R];Ww=eN=Vce([Hce(0,Pt)],Ww);R("symbolIcon.arrayForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.booleanForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.colorForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.constantForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.fileForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.folderForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.keyForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.keywordForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.moduleForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.namespaceForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.nullForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.numberForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.objectForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.operatorForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.packageForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.propertyForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.referenceForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.snippetForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.stringForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.structForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.textForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.typeParameterForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.unitForeground",{dark:le,light:le,hcDark:le,hcLight:le},p("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));R("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const k6=Object.freeze({kind:Be.Empty,title:p("codeAction.widget.id.more","More Actions...")}),zce=Object.freeze([{kind:Be.QuickFix,title:p("codeAction.widget.id.quickfix","Quick Fix")},{kind:Be.RefactorExtract,title:p("codeAction.widget.id.extract","Extract"),icon:he.wrench},{kind:Be.RefactorInline,title:p("codeAction.widget.id.inline","Inline"),icon:he.wrench},{kind:Be.RefactorRewrite,title:p("codeAction.widget.id.convert","Rewrite"),icon:he.wrench},{kind:Be.RefactorMove,title:p("codeAction.widget.id.move","Move"),icon:he.wrench},{kind:Be.SurroundWith,title:p("codeAction.widget.id.surround","Surround With"),icon:he.symbolSnippet},{kind:Be.Source,title:p("codeAction.widget.id.source","Source Action"),icon:he.symbolFile},k6]);function Uce(o,e,t){if(!e)return o.map(s=>{var r;return{kind:"action",item:s,group:k6,disabled:!!s.action.disabled,label:s.action.disabled||s.action.title,canPreview:!!(!((r=s.action.edit)===null||r===void 0)&&r.edits.length)}});const i=zce.map(s=>({group:s,actions:[]}));for(const s of o){const r=s.action.kind?new Be(s.action.kind):Be.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(s);break}}const n=[];for(const s of i)if(s.actions.length){n.push({kind:"header",group:s.group});for(const r of s.actions){const a=s.group;n.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:he.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return n}var $ce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jF=function(o,e){return function(t,i){e(t,i,o)}},tN,uf;(function(o){o.Hidden={type:0};class e{constructor(i,n,s,r){this.actions=i,this.trigger=n,this.editorPosition=s,this.widgetPosition=r,this.type=1}}o.Showing=e})(uf||(uf={}));let Bu=tN=class extends K{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new W),this.onClick=this._onClick.event,this._state=uf.Hidden,this._iconClasses=[],this._domNode=pe("div.lightBulbWidget"),this._register(Ot.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(n=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(F$(this._domNode,n=>{var s;if(this.state.type!==1)return;const r=this._editor.getOption(64).experimental.showAiIcon;if((r===As.On||r===As.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){const h=this.state.actions.validActions[0].action;if(!((s=h.command)===null||s===void 0)&&s.id){i.executeCommand(h.command.id,...h.command.arguments||[]),n.preventDefault();return}}this._editor.focus(),n.preventDefault();const{top:a,height:l}=ji(this._domNode),d=this._editor.getOption(66);let c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(c+=d),this._onClick.fire({x:n.posx,y:a+l+c,actions:this.state.actions,trigger:this.state.trigger})})),this._register(Q(this._domNode,"mouseenter",n=>{(n.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(fe.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var n,s,r,a;this._preferredKbLabel=(s=(n=this._keybindingService.lookupKeybinding(L6))===null||n===void 0?void 0:n.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(pR))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(i),l=s.getOptions().tabSize,d=n.get(50),c=s.getLineContent(r),h=YS(c,l),u=d.spaceWidth*h>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let f=r;if(!u){if(r>1&&!g(r-1))f-=1;else if(!g(r+1))f+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new uf.Showing(e,t,i,{position:{lineNumber:f,column:s.getLineContent(f).match(/^\S\s*$/)?2:1},preference:tN._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==uf.Hidden&&(this.state=uf.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;const n=()=>{this._preferredKbLabel&&(this.title=p("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},s=()=>{this._quickFixKbLabel?this.title=p("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=p("codeAction","Show Code Actions")};let r;const a=this._editor.getOption(64).experimental.showAiIcon;if(a===As.On||a===As.OnCode)if(a===As.On&&this.state.actions.allAIFixes)if(r=he.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){const l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?p("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):p("codeActionStartInlineChat","Start Inline Chat")}else this.title=p("codeActionTriggerAiAction","Trigger AI Action");else s();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=he.lightbulbSparkleAutofix:r=he.lightbulbAutofix,n()):this.state.actions.hasAIFix?(r=he.lightbulbSparkle,s()):(r=he.lightBulb,s());else this.state.actions.hasAutoFix?(r=he.lightbulbAutofix,n()):(r=he.lightBulb,s());this._iconClasses=Re.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};Bu.ID="editor.contrib.lightbulbWidget";Bu._posPref=[0];Bu=tN=$ce([jF(1,Pt),jF(2,ui)],Bu);var Kce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qF=function(o,e){return function(t,i){e(t,i,o)}},iN;let pd=iN=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new W,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new se,s=n.add(ly(e,{...this._getRenderOptions(e,n),...t},i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var s,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(s=this._options.editor.getModel())===null||s===void 0?void 0:s.getLanguageId()),l||(l=So);const d=await ree(this._languageService,n,l),c=document.createElement("span");if(c.innerHTML=(a=(r=iN._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){const h=this._options.editor.getOption(50);Tn(c,h)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>I6(this._openerService,i,e.isTrusted),disposables:t}}}};pd._ttpTokenizer=vd("tokenizeToString",{createHTML(o){return o}});pd=iN=Kce([qF(1,ni),qF(2,Qs)],pd);async function I6(o,e,t){try{return await o.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:jce(t)})}catch(i){return Ge(i),!1}}function jce(o){return o===!0?!0:o&&Array.isArray(o.enabledCommands)?o.enabledCommands:!1}var qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},GF=function(o,e){return function(t,i){e(t,i,o)}},ZC;let zs=ZC=class{static get(e){return e.getContribution(ZC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Cn,this._messageListeners=new se,this._mouseOverMessage=!1,this._editor=e,this._visible=ZC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){js(_c(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=_c(e)?ly(e,{actionHandler:{callback:n=>I6(this._openerService,n,_c(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new ZF(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(fe.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Nn(wo(),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(Q(this._messageWidget.value.getDomNode(),ge.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Q(this._messageWidget.value.getDomNode(),ge.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new k(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(ZF.fadeOut(this._messageWidget.value))}};zs.ID="editor.contrib.messageController";zs.MESSAGE_VISIBLE=new be("messageVisible",!1,p("messageVisible","Whether the editor is currently showing an inline message"));zs=ZC=qce([GF(1,We),GF(2,Qs)],zs);const Gce=cn.bindToContribution(zs.get);ue(new Gce({id:"leaveEditorMessage",precondition:zs.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let ZF=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},n){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 s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};yt(zs.ID,zs,4);var E6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nN=function(o,e){return function(t,i){e(t,i,o)}};const N6="acceptSelectedCodeAction",T6="previewSelectedCodeAction";class Zce{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 n,s;i.text.textContent=(s=(n=e.group)===null||n===void 0?void 0:n.title)!==null&&s!==void 0?s:""}disposeTemplate(e){}}let sN=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 n=new Mv(e,mo);return{container:e,icon:t,text:i,keybinding:n}}renderElement(e,t,i){var n,s,r;if(!((n=e.group)===null||n===void 0)&&n.icon?(i.icon.className=Re.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ce(e.group.icon.color.id))):(i.icon.className=Re.asClassName(he.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=M6(e.label),i.keybinding.set(e.keybinding),J$(!!e.keybinding,i.keybinding.element);const a=(s=this._keybindingService.lookupKeybinding(N6))===null||s===void 0?void 0:s.getLabel(),l=(r=this._keybindingService.lookupKeybinding(T6))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=p({},"{0} to apply, {1} to preview",a,l):i.container.title=p({},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};sN=E6([nN(1,Pt)],sN);class Yce extends UIEvent{constructor(){super("acceptSelectedAction")}}class YF extends UIEvent{constructor(){super("previewSelectedAction")}}function Xce(o){if(o.kind==="action")return o.label}let oN=class extends K{constructor(e,t,i,n,s,r){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Wi),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 yr(e,this.domNode,a,[new sN(t,this._keybindingService),new Zce],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Xce},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?M6(l?.label):"";return l.disabled&&(d=p({},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>p({},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(sg),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,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(n);let s=e;if(this._allMenuItems.length>=50)s=380;else{const l=this._allMenuItems.map((d,c)=>{const h=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(h){h.style.width="auto";const u=h.getBoundingClientRect().width;return h.style.width="",u}return 0});s=Math.max(...l,e)}const a=Math.min(n,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,s),this.domNode.style.height=`${a}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new YF:new Yce;this._list.setSelection([i],s)}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 YF):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const n=i[0],s=this._list.element(n);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,s.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([])}};oN=E6([nN(4,bd),nN(5,Pt)],oN);function M6(o){return o.replace(/\r\n|\r|\n/g," ")}var Qce=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nD=function(o,e){return function(t,i){e(t,i,o)}};R("actionBar.toggledBackground",{dark:Qh,light:Qh,hcDark:Qh,hcLight:Qh},p("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Wu={Visible:new be("codeActionMenuVisible",!1,p("codeActionMenuVisible","Whether the action widget list is visible"))},ag=ot("actionWidgetService");let Vu=class extends K{get isVisible(){return Wu.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Cn)}show(e,t,i,n,s,r,a){const l=Wu.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(oN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;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 se,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(Q(l,ge.MOUSE_DOWN,f=>f.stopPropagation()));const d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(Q(c,ge.POINTER_MOVE,()=>c.remove())),r.add(Q(c,ge.MOUSE_DOWN,()=>c.remove()));let h=0;if(i.length){const f=this._createActionBar(".action-widget-action-bar",i);f&&(s.appendChild(f.getContainer().parentElement),r.add(f),h=f.getContainer().offsetWidth)}const u=(n=this._list.value)===null||n===void 0?void 0:n.layout(h);s.style.width=`${u}px`;const g=r.add(dl(e));return r.add(g.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=pe(e),n=new Go(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Vu=Qce([nD(0,bd),nD(1,We),nD(2,Oe)],Vu);ct(ag,Vu,1);const zv=1100;Xt(class extends ko{constructor(){super({id:"hideCodeActionWidget",title:{value:p("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Wu.Visible,keybinding:{weight:zv,primary:9,secondary:[1033]}})}run(o){o.get(ag).hide()}});Xt(class extends ko{constructor(){super({id:"selectPrevCodeAction",title:{value:p("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(o){const e=o.get(ag);e instanceof Vu&&e.focusPrevious()}});Xt(class extends ko{constructor(){super({id:"selectNextCodeAction",title:{value:p("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(o){const e=o.get(ag);e instanceof Vu&&e.focusNext()}});Xt(class extends ko{constructor(){super({id:N6,title:{value:p("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:3,secondary:[2137]}})}run(o){const e=o.get(ag);e instanceof Vu&&e.acceptSelected()}});Xt(class extends ko{constructor(){super({id:T6,title:{value:p("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Wu.Visible,keybinding:{weight:zv,primary:2051}})}run(o){const e=o.get(ag);e instanceof Vu&&e.acceptSelected(!0)}});const R6=new be("supportedCodeAction","");class Jce extends K{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new Cr),this._register(this._markerService.onMarkerChanged(s=>this._onMarkerChanges(s))),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=>J2(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:qs.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._editor.getSelection();if(n.isEmpty()&&e.type===2){const{lineNumber:s,column:r}=n.getPosition(),a=i.getLineContent(s);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===As.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(s)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return n}}var Gh;(function(o){o.Empty={type:0};class e{constructor(i,n,s){this.trigger=i,this.position=n,this._cancellablePromise=s,this.type=1,this.actions=s.catch(r=>{if(oa(r))return A6;throw r})}cancel(){this._cancellablePromise.cancel()}}o.Triggered=e})(Gh||(Gh={}));const A6=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class ehe extends K{constructor(e,t,i,n,s,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=r,this._codeActionOracle=this._register(new Cn),this._state=Gh.Empty,this._onDidChangeState=this._register(new W),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=R6.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Gh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Gh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var n;return(n=i.providedCodeActionKinds)!==null&&n!==void 0?n:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Jce(this._editor,this._markerService,i=>{var n;if(!i){this.setState(Gh.Empty);return}const s=i.selection.getStartPosition(),r=Zi(async a=>{var l,d,c,h,u,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===qs.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(Be.QuickFix))){const f=await L_(this._registry,e,i.selection,i.trigger,ld.None,a),m=[...f.allActions];if(a.isCancellationRequested)return A6;if(!((c=f.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?Be.QuickFix.contains(new Be(v.action.kind)):!1))){const v=this._markerService.read({resource:e.uri});if(v.length>0){const b=i.selection.getPosition();let C=b,w=Number.MAX_VALUE;const y=[...f.validActions];for(const D of v){const T=D.endColumn,P=D.endLineNumber,H=D.startLineNumber;if(P===b.lineNumber||H===b.lineNumber){C=new V(P,T);const Y={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((h=i.trigger.filter)===null||h===void 0)&&h.include?(u=i.trigger.filter)===null||u===void 0?void 0:u.include:Be.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:C}},B=new xe(C.lineNumber,C.column,C.lineNumber,C.column),U=await L_(this._registry,e,B,Y,ld.None,a);if(U.validActions.length!==0){for(const G of U.validActions)G.highlightRange=G.action.isPreferred;f.allActions.length===0&&m.push(...U.allActions),Math.abs(b.column-T)<w?y.unshift(...U.validActions):y.push(...U.validActions)}w=Math.abs(b.column-T)}}const I=y.filter((D,T,P)=>P.findIndex(H=>H.action.title===D.action.title)===T);return I.sort((D,T)=>D.action.isPreferred&&!T.action.isPreferred?-1:!D.action.isPreferred&&T.action.isPreferred||D.action.isAI&&!T.action.isAI?1:!D.action.isAI&&T.action.isAI?-1:0),{validActions:I,allActions:m,documentation:f.documentation,hasAutoFix:f.hasAutoFix,hasAIFix:f.hasAIFix,allAIFixes:f.allAIFixes,dispose:()=>{f.dispose()}}}}}return L_(this._registry,e,i.selection,i.trigger,ld.None,a)});i.trigger.type===1&&((n=this._progressService)===null||n===void 0||n.showWhile(r,250)),this.setState(new Gh.Triggered(i.trigger,s,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:qs.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var the=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},El=function(o,e){return function(t,i){e(t,i,o)}},YC;const ihe="quickfix-edit-highlight";let jc=YC=class extends K{static get(e){return e.getContribution(YC.ID)}constructor(e,t,i,n,s,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new Cn),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new ehe(this._editor,s.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(h=>this.update(h))),this._lightBulbWidget=new sh(()=>{const h=this._editor.getContribution(Bu.ID);return h&&this._register(h.onClick(u=>this.showCodeActionList(u.actions,u,{includeDisabledActions:!1,fromLightbulb:!0}))),h}),this._resolver=n.createInstance(Ww),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;(s=zs.get(this._editor))===null||s===void 0||s.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(Bce,e,Bw.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:qs.QuickFix,filter:{}})}}async update(e){var t,i,n,s,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){Ge(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((n=e.trigger.filter)===null||n===void 0)&&n.include){const h=this.tryGetValidActionToApply(e.trigger,d);if(h){try{(s=this._lightBulbWidget.value)===null||s===void 0||s.hide(),await this._applyCodeAction(h,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){const u=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(u&&u.action.disabled){(r=zs.get(this._editor))===null||r===void 0||r.showMessage(u.action.disabled,e.trigger.context.position),d.dispose();return}}}const c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=zs.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}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 n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=V.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),n.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),n.clear()},onHover:async(d,c)=>{var h;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((h=d.action.edit)===null||h===void 0)&&h.edits.length)}},onFocus:d=>{var c,h;if(d&&d.highlightRange&&d.action.diagnostics){const u=[{range:d.action.diagnostics[0],options:YC.DECORATION}];n.set(u);const g=d.action.diagnostics[0],f=(h=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||h===void 0?void 0:h.word;Du(p("editingNewSelection","Context: {0} at line {1} and column {2}.",f,g.startLineNumber,g.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Uce(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,s,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=ji(this._editor.getDomNode()),n=i.left+t.left,s=i.top+t.top+t.height;return{x:n,y:s}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(s=>{var r;return{id:s.id,label:s.title,tooltip:(r=s.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(s.id,...(a=s.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:p("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};jc.ID="editor.contrib.codeActionController";jc.DECORATION=Ze.register({description:"quickfix-highlight",className:ihe});jc=YC=the([El(1,yl),El(2,We),El(3,Oe),El(4,Se),El(5,lh),El(6,ui),El(7,ft),El(8,ag),El(9,Oe)],jc);Sr((o,e)=>{((n,s)=>{s&&e.addRule(`.monaco-editor ${n} { background-color: ${s}; }`)})(".quickfix-edit-highlight",o.getColor(Ga));const i=o.getColor(Jd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${il(o.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function Uv(o){return te.regex(R6.keys()[0],new RegExp("(\\s|^)"+yo(o.value)+"\\b"))}const vR={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:p("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p("args.schema.apply.first","Always apply the first returned code action."),p("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),p("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function lg(o,e,t,i,n=qs.Default){if(o.hasModel()){const s=jc.get(o);s?.manualTriggerAtCurrentPosition(e,n,t,i)}}class nhe extends we{constructor(){super({id:pR,label:p("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:te.and(M.writable,M.hasCodeActionsProvider),kbOpts:{kbExpr:M.textInputFocus,primary:2137,weight:100}})}run(e,t){return lg(t,p("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,qs.QuickFix)}}class she extends cn{constructor(){super({id:y6,precondition:te.and(M.writable,M.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:vR}]}})}runEditorCommand(e,t,i){const n=Va.fromUser(i,{kind:Be.Empty,apply:"ifSingle"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):p("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?p("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):p("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class ohe extends we{constructor(){super({id:x6,label:p("refactor.label","Refactor..."),alias:"Refactor...",precondition:te.and(M.writable,M.hasCodeActionsProvider),kbOpts:{kbExpr:M.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:te.and(M.writable,Uv(Be.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:vR}]}})}run(e,t,i){const n=Va.fromUser(i,{kind:Be.Refactor,apply:"never"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):p("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?p("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):p("editor.action.refactor.noneMessage","No refactorings available"),{include:Be.Refactor.contains(n.kind)?n.kind:Be.None,onlyIncludePreferredActions:n.preferred},n.apply,qs.Refactor)}}class rhe extends we{constructor(){super({id:D6,label:p("source.label","Source Action..."),alias:"Source Action...",precondition:te.and(M.writable,M.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:te.and(M.writable,Uv(Be.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:vR}]}})}run(e,t,i){const n=Va.fromUser(i,{kind:Be.Source,apply:"never"});return lg(t,typeof i?.kind=="string"?n.preferred?p("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):p("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?p("editor.action.source.noneMessage.preferred","No preferred source actions available"):p("editor.action.source.noneMessage","No source actions available"),{include:Be.Source.contains(n.kind)?n.kind:Be.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,qs.SourceAction)}}class ahe extends we{constructor(){super({id:mR,label:p("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:te.and(M.writable,Uv(Be.SourceOrganizeImports)),kbOpts:{kbExpr:M.textInputFocus,primary:1581,weight:100}})}run(e,t){return lg(t,p("editor.action.organize.noneMessage","No organize imports action available"),{include:Be.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",qs.OrganizeImports)}}class lhe extends we{constructor(){super({id:_R,label:p("fixAll.label","Fix All"),alias:"Fix All",precondition:te.and(M.writable,Uv(Be.SourceFixAll))})}run(e,t){return lg(t,p("fixAll.noneMessage","No fix all action available"),{include:Be.SourceFixAll,includeSourceActions:!0},"ifSingle",qs.FixAll)}}class dhe extends we{constructor(){super({id:L6,label:p("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:te.and(M.writable,Uv(Be.QuickFix)),kbOpts:{kbExpr:M.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return lg(t,p("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Be.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",qs.AutoFix)}}yt(jc.ID,jc,3);yt(Bu.ID,Bu,4);de(nhe);de(ohe);de(rhe);de(ahe);de(dhe);de(lhe);ue(new she);Ri.as(la.Configuration).registerConfiguration({...iy,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:p("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ri.as(la.Configuration).registerConfiguration({...iy,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:p("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class rN{constructor(){this.lenses=[],this._disposables=new se}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 P6(o,e,t){const i=o.ordered(e),n=new Map,s=new rN,r=i.map(async(a,l)=>{n.set(a,l);try{const d=await Promise.resolve(a.provideCodeLenses(e,t));d&&s.add(d,a)}catch(d){Mi(d)}});return await Promise.all(r),s.lenses=s.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:n.get(a.provider)<n.get(l.provider)?-1:n.get(a.provider)>n.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),s}gt.registerCommand("_executeCodeLensProvider",function(o,...e){let[t,i]=e;Tt(Me.isUri(t)),Tt(typeof i=="number"||!i);const{codeLensProvider:n}=o.get(Se),s=o.get(ii).getModel(t);if(!s)throw Wo();const r=[],a=new se;return P6(n,s,st.None).then(l=>{a.add(l);const d=[];for(const c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(s,c.symbol,st.None)).then(h=>r.push(h||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var che=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hhe=function(o,e){return function(t,i){e(t,i,o)}};const O6=ot("ICodeLensCache");class XF{constructor(e,t){this.lineCount=e,this.data=t}}let aN=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new oh(20,.75);const t="codelens/cache";Mm(hi,()=>e.remove(t,1));const i="codelens/cache2",n=e.get(i,1,"{}");this._deserialize(n),fe.once(e.onWillSaveState)(s=>{s.reason===y0.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),n=new rN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new XF(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}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 n=new Set;for(const s of i.data.lenses)n.add(s.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const n=t[i],s=[];for(const a of n.lines)s.push({range:new k(a,1,a,11)});const r=new rN;r.add({lenses:s,dispose(){}},this._fakeProvider),this._cache.set(i,new XF(n.lineCount,r))}}catch{}}};aN=che([hhe(0,da)],aN);ct(O6,aN,1);class uhe{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class My{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${My._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let n=!1;for(let s=0;s<e.length;s++){const r=e[s];if(r&&(n=!0,r.command)){const a=vc(r.command.title.trim());r.command.id?(i.push(pe("a",{id:String(s),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(s),r.command)):i.push(pe("span",{title:r.command.tooltip},...a)),s+1<e.length&&i.push(pe("span",void 0," | "))}}n?(Wn(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Wn(this._domNode,pe("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){const t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}}My._idPool=0;class sD{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}}const QF=Ze.register({collapseOnReplaceEdit:!0,description:"codelens"});class JF{constructor(e,t,i,n,s,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:QF},h=>this._decorationIds[c]=h),a?a=k.plusRange(a,d.symbol.range):a=k.lift(d.symbol.range)}),this._viewZone=new uhe(a.startLineNumber-1,s,r),this._viewZoneId=n.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new My(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],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),n=this._data[t].symbol;return!!(i&&k.isEmpty(n.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,n)=>{t.addDecoration({range:i.symbol.range,options:QF},s=>this._decorationIds[n]=s)})}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<this._decorationIds.length;t++){const i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:n}=this._data[t];n.command=i.command||n.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}}var ghe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sm=function(o,e){return function(t,i){e(t,i,o)}};let bp=class{constructor(e,t,i,n,s,r){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=r,this._disposables=new se,this._localToDispose=new se,this._lenses=[],this._oldCodeLensModels=new se,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Rt(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Vs.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Rc(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){const s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new Rt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Zi(r=>P6(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Ge)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ae(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var n;this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});const d=new sD;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(s)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(n=this._resolveCodeLensesPromise)===null||n===void 0||n.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ae(()=>{if(this._editor.getModel()){const n=na.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(s,r)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if(s?.tagName==="SPAN"&&(s=s.parentElement),s?.tagName==="A")for(const r of this._lenses){const a=r.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new sD;for(const n of this._lenses)n.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 n;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=na.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new sD;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){const u=i[h][0].symbol.range.startLineNumber,g=this._lenses[c].getLineNumber();g<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):g===u?(this._lenses[c].updateCodeLensSymbols(i[h],d),h++,c++):(this._lenses.splice(c,0,new JF(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new JF(i[h],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;d.commit(a)})}),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),n.push(a))}),i.length===0)return;const s=Date.now(),r=Zi(a=>{const l=i.map((d,c)=>{const h=new Array(d.length),u=d.map((g,f)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{h[f]=m},Mi):(h[f]=g.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!n[c].isDisposed()&&n[c].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Ge(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};bp.ID="css.editor.codeLens";bp=ghe([Sm(1,Se),Sm(2,Zo),Sm(3,ui),Sm(4,Vi),Sm(5,O6)],bp);yt(bp.ID,bp,1);de(class extends we{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:M.hasCodeLensProvider,label:p("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(dh),n=e.get(ui),s=e.get(Vi),r=t.getSelection().positionLineNumber,a=t.getContribution(bp.ID);if(!a)return;const l=await a.getModel();if(!l)return;const d=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&d.push({label:u.symbol.command.title,command:u.symbol.command});if(d.length===0)return;const c=await i.pick(d,{canPickMany:!1,placeHolder:p("placeHolder","Select a command")});if(!c)return;let h=c.command;if(l.isDisposed){const u=await a.getModel(),g=u?.lenses.find(f=>{var m;return f.symbol.range.startLineNumber===r&&((m=f.symbol.command)===null||m===void 0?void 0:m.title)===h.title});if(!g||!g.symbol.command)return;h=g.symbol.command}try{await n.executeCommand(h.id,...h.arguments||[])}catch(u){s.error(u)}}});var fhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oD=function(o,e){return function(t,i){e(t,i,o)}};class bR{constructor(e,t){this._editorWorkerClient=new I2(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,s=t.color,r=s.alpha,a=new q(new ht(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),r)),l=r?q.Format.CSS.formatRGB(a):q.Format.CSS.formatRGBA(a),d=r?q.Format.CSS.formatHSL(a):q.Format.CSS.formatHSLA(a),c=r?q.Format.CSS.formatHex(a):q.Format.CSS.formatHexA(a),h=[];return h.push({label:l,textEdit:{range:n,text:l}}),h.push({label:d,textEdit:{range:n,text:d}}),h.push({label:c,textEdit:{range:n,text:c}}),h}}let lN=class extends K{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new bR(e,t)))}};lN=fhe([oD(0,ii),oD(1,Wt),oD(2,Se)],lN);yy(lN);async function F6(o,e,t,i=!0){return CR(new phe,o,e,t,i)}function B6(o,e,t,i){return Promise.resolve(t.provideColorPresentations(o,e,i))}class phe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({colorInfo:r,provider:e});return Array.isArray(s)}}class mhe{constructor(){}async compute(e,t,i,n){const s=await e.provideDocumentColors(t,i);if(Array.isArray(s))for(const r of s)n.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(s)}}class _he{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const s=await e.provideColorPresentations(t,this.colorInfo,st.None);return Array.isArray(s)&&n.push(...s),Array.isArray(s)}}async function CR(o,e,t,i,n){let s=!1,r;const a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){const c=l[d];if(c instanceof bR)r=c;else try{await o.compute(c,t,i,a)&&(s=!0)}catch(h){Mi(h)}}return s?a:r&&n?(await o.compute(r,t,i,a),a):[]}function W6(o,e){const{colorProvider:t}=o.get(Se),i=o.get(ii).getModel(e);if(!i)throw Wo();const n=o.get(ft).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:n}}gt.registerCommand("_executeDocumentColorProvider",function(o,...e){const[t]=e;if(!(t instanceof Me))throw Wo();const{model:i,colorProviderRegistry:n,isDefaultColorDecoratorsEnabled:s}=W6(o,t);return CR(new mhe,n,i,st.None,s)});gt.registerCommand("_executeColorPresentationProvider",function(o,...e){const[t,i]=e,{uri:n,range:s}=i;if(!(n instanceof Me)||!Array.isArray(t)||t.length!==4||!k.isIRange(s))throw Wo();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=W6(o,n),[d,c,h,u]=t;return CR(new _he({range:s,color:{red:d,green:c,blue:h,alpha:u}}),a,r,st.None,l)});var vhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},rD=function(o,e){return function(t,i){e(t,i,o)}},dN;const V6=Object.create({});let qc=dN=class extends K{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new se),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new vv(this._editor),this._decoratorLimitReporter=new bhe,this._colorDecorationClassRefs=this._register(new se),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:dN.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(s=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=r!==this._isColorDecoratorsEnabled||s.hasChanged(21),l=s.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const n=i.colorDecorators;if(n&&n.enable!==void 0&&!n.enable)return n.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 Cr,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Zi(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Hn(!1),n=await F6(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Ge(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:Ze.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((n,s)=>this._colorDatas.set(n,e[s]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;s<e.length&&t.length<i;s++){const{red:r,green:a,blue:l,alpha:d}=e[s].colorInfo.color,c=new ht(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),h=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:h}));t.push({range:{startLineNumber:e[s].colorInfo.range.startLineNumber,startColumn:e[s].colorInfo.range.startColumn,endLineNumber:e[s].colorInfo.range.endLineNumber,endColumn:e[s].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:J3,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:V6}}})}const n=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(k.fromPositions(e,e)).filter(n=>this._colorDatas.has(n.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};qc.ID="editor.contrib.colorDetector";qc.RECOMPUTE_TIME=1e3;qc=dN=vhe([rD(1,ft),rD(2,Se),rD(3,Zo)],qc);class bhe{constructor(){this._onDidChange=new W,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}yt(qc.ID,qc,1);class Che{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 W,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new W,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new W,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 n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){i=n;break}if(i===-1){const n=t.split("(")[0].toLowerCase();for(let s=0;s<this.colorPresentations.length;s++)if(this.colorPresentations[s].label.toLowerCase().startsWith(n)){i=s;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const po=pe;class whe extends K{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=po(".colorpicker-header"),ie(e,this._domNode),this._pickedColorNode=ie(this._domNode,po(".picked-color")),ie(this._pickedColorNode,po("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ie(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=p("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=ie(this._domNode,po(".original-color")),this._originalColorNode.style.backgroundColor=q.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(A1)||q.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(A1)||q.white})),this._register(Q(this._pickedColorNode,ge.CLICK,()=>this.model.selectNextColorPresentation())),this._register(Q(this._originalColorNode,ge.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=q.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 She(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=q.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 She extends K{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ie(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ie(this._button,t),ie(t,po(".button"+Re.asCSSSelector(Di("color-picker-close",he.close,p("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class yhe extends K{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=po(".colorpicker-body"),ie(e,this._domNode),this._saturationBox=new Lhe(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 xhe(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Dhe(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),n&&(this._insertButton=this._register(new khe(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 q(new za(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new q(new za(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new q(new za(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 Lhe extends K{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,this._domNode=po(".saturation-wrap"),ie(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ie(this._domNode,this._canvas),this.selection=po(".saturation-selection"),ie(this._domNode,this.selection),this.layout(),this._register(Q(this._domNode,ge.POINTER_DOWN,n=>this.onPointerDown(n))),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 Bp);const t=ji(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangePosition(n.pageX-t.left,n.pageY-t.top),()=>null);const i=Q(e.target.ownerDocument,ge.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)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}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 q(new za(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=q.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,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 H6 extends K{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new W,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ie(e,po(".standalone-strip")),this.overlay=ie(this.domNode,po(".standalone-overlay"))):(this.domNode=ie(e,po(".strip")),this.overlay=ie(this.domNode,po(".overlay"))),this.slider=ie(this.domNode,po(".slider")),this.slider.style.top="0px",this._register(Q(this.domNode,ge.POINTER_DOWN,n=>this.onPointerDown(n))),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 Bp),i=ji(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangeTop(s.pageY-i.top),()=>null);const n=Q(e.target.ownerDocument,ge.POINTER_UP,()=>{this._onColorFlushed.fire(),n.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 xhe extends H6{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:n}=e.rgba,s=new q(new ht(t,i,n,1)),r=new q(new ht(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Dhe extends H6{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class khe extends K{constructor(e){super(),this._onClicked=this._register(new W),this.onClicked=this._onClicked.event,this._button=ie(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class Ihe extends wr{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(H_.onDidChange(()=>this.layout()));const r=po(".colorpicker-widget");e.appendChild(r),this.header=this._register(new whe(r,this.model,n,s)),this.body=this._register(new yhe(r,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var z6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},U6=function(o,e){return function(t,i){e(t,i,o)}};class Ehe{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Vw=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Fi.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];const n=qc.get(this._editor);if(!n)return[];for(const s of t){if(!n.isColorDecoration(s))continue;const r=n.getColorData(s.range.getStartPosition());if(r)return[await $6(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return K6(this,this._editor,this._themeService,t,e)}};Vw=z6([U6(1,tn)],Vw);class Nhe{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let W0=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!qc.get(this._editor))return null;const s=await F6(i,this._editor.getModel(),st.None);let r=null,a=null;for(const h of s){const u=h.colorInfo;k.containsRange(u.range,e.range)&&(r=u,a=h.provider)}const l=r??e,d=a??t,c=!!r;return{colorHover:await $6(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new k(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await XC(this._editor.getModel(),t,this._color,i,e),i=j6(this._editor,i,t))}renderHoverParts(e,t){return K6(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};W0=z6([U6(1,tn)],W0);async function $6(o,e,t,i){const n=e.getValueInRange(t.range),{red:s,green:r,blue:a,alpha:l}=t.color,d=new ht(Math.round(s*255),Math.round(r*255),Math.round(a*255),l),c=new q(d),h=await B6(e,t,i,st.None),u=new Che(c,[],0);return u.colorPresentations=h||[],u.guessColorPresentation(c,n),o instanceof Vw?new Ehe(o,k.lift(t.range),u,i):new Nhe(o,k.lift(t.range),u,i)}function K6(o,e,t,i,n){if(i.length===0||!e.hasModel())return K.None;if(n.setMinimumDimensions){const u=e.getOption(66)+8;n.setMinimumDimensions(new bt(302,u))}const s=new se,r=i[0],a=e.getModel(),l=r.model,d=s.add(new Ihe(n.fragment,l,e.getOption(141),t,o instanceof W0));n.setColorPicker(d);let c=!1,h=new k(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(o instanceof W0){const u=i[0].model.color;o.color=u,XC(a,l,u,h,r),s.add(l.onColorFlushed(g=>{o.color=g}))}else s.add(l.onColorFlushed(async u=>{await XC(a,l,u,h,r),c=!0,h=j6(e,h,l,n)}));return s.add(l.onDidChangeColor(u=>{XC(a,l,u,h,r)})),s.add(e.onDidChangeModelContent(u=>{c?c=!1:(n.hide(),e.focus())})),s}function j6(o,e,t,i){let n,s;if(t.presentation.textEdit){n=[t.presentation.textEdit],s=new k(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const r=o.getModel()._setTrackedRange(null,s,3);o.pushUndoStop(),o.executeEdits("colorpicker",n),s=o.getModel()._getTrackedRange(r)||s}else n=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],s=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),o.pushUndoStop(),o.executeEdits("colorpicker",n);return t.presentation.additionalTextEdits&&(n=[...t.presentation.additionalTextEdits],o.executeEdits("colorpicker",n),i&&i.hide()),o.pushUndoStop(),s}async function XC(o,e,t,i,n){const s=await B6(o,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},n.provider,st.None);e.colorPresentations=s||[]}function cN(o,e){return!!o[e]}class aD{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=cN(e.event,t.triggerModifier),this.hasSideBySideModifier=cN(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class e5{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=cN(e,t.triggerModifier)}}class qb{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function t5(o){return o==="altKey"?ut?new qb(57,"metaKey",6,"altKey"):new qb(5,"ctrlKey",6,"altKey"):ut?new qb(6,"altKey",57,"metaKey"):new qb(6,"altKey",5,"ctrlKey")}class Ry extends K{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new W),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new W),this.onExecute=this._onExecute.event,this._onCancel=this._register(new W),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:n=>n.target.position?n.target.position.lineNumber:0,this._opts=t5(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(n=>{if(n.hasChanged(77)){const s=t5(this._editor.getOption(77));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(n=>this._onEditorMouseMove(new aD(n,this._opts)))),this._register(this._editor.onMouseDown(n=>this._onEditorMouseDown(new aD(n,this._opts)))),this._register(this._editor.onMouseUp(n=>this._onEditorMouseUp(new aD(n,this._opts)))),this._register(this._editor.onKeyDown(n=>this._onEditorKeyDown(new e5(n,this._opts)))),this._register(this._editor.onKeyUp(n=>this._onEditorKeyUp(new e5(n,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(n=>this._onDidChangeCursorSelection(n))),this._register(this._editor.onDidChangeModel(n=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(n=>{(n.scrollTopChanged||n.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var The=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nl=function(o,e){return function(t,i){e(t,i,o)}};let Gc=class extends rp{constructor(e,t,i,n,s,r,a,l,d,c,h,u,g){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,s,r,a,l,d,c,h,u,g),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){hS(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Gc=The([Nl(4,Oe),Nl(5,Dt),Nl(6,ui),Nl(7,We),Nl(8,tn),Nl(9,Vi),Nl(10,Sl),Nl(11,Wt),Nl(12,Se)],Gc);const i5=new q(new ht(0,122,204)),Mhe={showArrow:!0,showFrame:!0,className:"",frameColor:i5,arrowColor:i5,keepEditorSelection:!1},Rhe="vs.editor.contrib.zoneWidget";class Ahe{constructor(e,t,i,n,s,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=s,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Phe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Ay{constructor(e){this._editor=e,this._ruleName=Ay._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),Bk(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(){Bk(this._ruleName),S1(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:k.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Ay._IdGenerator=new IM(".arrow-decoration-");class Ohe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new se,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Bl(t),hS(this.options,Mhe,!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 n=this._getWidth(i);this.domNode.style.width=n+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(n)}))}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 Ay(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 n=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(n))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=k.isIRange(e)?k.lift(e):k.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Ze.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const u=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,u)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(u=>{this._viewZone&&u.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new Ahe(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=u.addZone(this._viewZone),this._overlayWidget=new Phe(Rhe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const u=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=u+"px",this.container.style.borderBottomWidth=u+"px"}const c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,s),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const u=h.validateRange(new k(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(u,u.startLineNumber===h.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 An(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}}))}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 q6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},G6=function(o,e){return function(t,i){e(t,i,o)}};const Z6=ot("IPeekViewService");ct(Z6,class{constructor(){this._widgets=new Map}addExclusiveWidget(o,e){const t=this._widgets.get(o);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const n=this._widgets.get(o);n&&n.widget===e&&(n.listener.dispose(),this._widgets.delete(o))};this._widgets.set(o,{widget:e,listener:e.onDidClose(i)})}},1);var xs;(function(o){o.inPeekEditor=new be("inReferenceSearchEditor",!0,p("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),o.notInPeekEditor=o.inPeekEditor.toNegated()})(xs||(xs={}));let V0=class{constructor(e,t){e instanceof Gc&&xs.inPeekEditor.bindTo(t)}dispose(){}};V0.ID="editor.contrib.referenceController";V0=q6([G6(1,We)],V0);yt(V0.ID,V0,0);function Fhe(o){const e=o.get(Dt).getFocusedCodeEditor();return e instanceof Gc?e.getParentEditor():e}const Bhe={headerBackgroundColor:q.white,primaryHeadingColor:q.fromHex("#333333"),secondaryHeadingColor:q.fromHex("#6c6c6cb3")};let Hw=class extends Ohe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new W,this.onDidClose=this._onDidClose.event,hS(this.options,Bhe,!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=pe(".head"),this._bodyElement=pe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=pe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),vi(this._titleElement,"click",s=>this._onTitleClick(s))),ie(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=pe("span.filename"),this._secondaryHeading=pe("span.dirname"),this._metaHeading=pe("span.meta"),ie(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=pe(".peekview-actions");ie(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Go(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new cs("peekview.close",p("label.close","Close"),Re.asClassName(he.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Kne.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:bn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Os(this._metaHeading)):is(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,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`)}};Hw=q6([G6(2,Oe)],Hw);const Whe=R("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:q.black,hcLight:q.white},p("peekViewTitleBackground","Background color of the peek view title area.")),Y6=R("peekViewTitleLabel.foreground",{dark:q.white,light:q.black,hcDark:q.white,hcLight:cr},p("peekViewTitleForeground","Color of the peek view title.")),X6=R("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p("peekViewTitleInfoForeground","Color of the peek view title info.")),Vhe=R("peekView.border",{dark:Ss,light:Ss,hcDark:dt,hcLight:dt},p("peekViewBorder","Color of the peek view borders and arrow.")),Hhe=R("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:q.black,hcLight:q.white},p("peekViewResultsBackground","Background color of the peek view result list."));R("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:q.white,hcLight:cr},p("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));R("peekViewResult.fileForeground",{dark:q.white,light:"#1E1E1E",hcDark:q.white,hcLight:cr},p("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));R("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));R("peekViewResult.selectionForeground",{dark:q.white,light:"#6C6C6C",hcDark:q.white,hcLight:cr},p("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const rc=R("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:q.black,hcLight:q.white},p("peekViewEditorBackground","Background color of the peek view editor."));R("peekViewEditorGutter.background",{dark:rc,light:rc,hcDark:rc,hcLight:rc},p("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));R("peekViewEditorStickyScroll.background",{dark:rc,light:rc,hcDark:rc,hcLight:rc},p("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));R("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));R("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));R("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Zt,hcLight:Zt},p("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class Zc{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=$I.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?p({},"{0} in {1} on line {2} at column {3}",t.value,qo(this.uri),this.range.startLineNumber,this.range.startColumn):p("aria.oneReference","in {0} on line {1} at column {2}",qo(this.uri),this.range.startLineNumber,this.range.startColumn)}}class zhe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:s,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:n,column:s-t}),d=new k(n,l.startColumn,n,s),c=new k(r,a,r,1073741824),h=i.getValueInRange(d).replace(/^\s+/,""),u=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+g,highlight:{start:h.length,end:h.length+u.length}}}}class H0{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new xi}dispose(){Et(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?p("aria.fileReferences.1","1 symbol in {0}, full path {1}",qo(this.uri),this.uri.fsPath):p("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,qo(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 zhe(i))}catch(i){Ge(i)}return this}}class Us{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new W,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Us._compareReferences);let n;for(const s of e)if((!n||!Yt.isEqual(n.uri,s.uri,!0))&&(n=new H0(this,s.uri),this.groups.push(n)),n.children.length===0||Us._compareReferences(s,n.children[n.children.length-1])!==0){const r=new Zc(i===s,n,s,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),n.children.push(r)}}dispose(){Et(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Us(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p("aria.result.0","No results found"):this.references.length===1?p("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const s=i.children.length,r=i.parent.groups.length;return r===1||t&&n+1<s||!t&&n>0?(t?n=(n+1)%s:n=(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%r,i.parent.groups[n].children[0]):(n=(n+r-1)%r,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((n,s)=>({idx:s,prefixLen:bu(n.uri.toString(),e.toString()),offsetDist:Math.abs(n.range.startLineNumber-t.lineNumber)*100+Math.abs(n.range.startColumn-t.column)})).sort((n,s)=>n.prefixLen>s.prefixLen?-1:n.prefixLen<s.prefixLen?1:n.offsetDist<s.offsetDist?-1:n.offsetDist>s.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()&&k.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 Yt.compare(e.uri,t.uri)||k.compareRangesUsingStarts(e.range,t.range)}}var Py=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Oy=function(o,e){return function(t,i){e(t,i,o)}},hN;let uN=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Us||e instanceof H0}getChildren(e){if(e instanceof Us)return e.groups;if(e instanceof H0)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};uN=Py([Oy(0,ks)],uN);class Uhe{getHeight(){return 23}getTemplateId(e){return e instanceof H0?z0.id:$v.id}}let gN=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Zc){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return qo(e.uri)}};gN=Py([Oy(0,Pt)],gN);class $he{getId(e){return e instanceof Zc?e.id:e.uri}}let fN=class extends K{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new Lw(i,{supportHighlights:!0})),this.badge=new gE(ie(i,pe(".count")),{},nB),e.appendChild(i)}set(e,t){const i=QS(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 n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(p("referencesCount","{0} references",n)):this.badge.setTitleFormat(p("referenceCount","{0} reference",n))}};fN=Py([Oy(1,ap)],fN);let z0=hN=class{constructor(e){this._instantiationService=e,this.templateId=hN.id}renderTemplate(e){return this._instantiationService.createInstance(fN,e)}renderElement(e,t,i){i.set(e.element,ry(e.filterData))}disposeTemplate(e){e.dispose()}};z0.id="FileReferencesRenderer";z0=hN=Py([Oy(0,Oe)],z0);class Khe{constructor(e){this.label=new Cc(e)}set(e,t){var i;const n=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!n||!n.value)this.label.set(`${qo(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:s,highlight:r}=n;t&&!Xr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(s,ry(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(s,[r]))}}}class $v{constructor(){this.templateId=$v.id}renderTemplate(e){return new Khe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}$v.id="OneReferenceRenderer";class jhe{getWidgetAriaLabel(){return p("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var qhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tl=function(o,e){return function(t,i){e(t,i,o)}};class Fy{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new se,this._callOnModelChange=new se,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 n=0,s=e.children.length;n<s;n++){const r=e.children[n];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:Fy.DecorationOptions}),i.push(n))}this._editor.changeDecorations(n=>{const s=n.deltaDecorations([],t);for(let r=0;r<s.length;r++)this._decorations.set(s[r],e.children[i[r]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const s=t.getDecorationRange(i);if(!s)continue;let r=!1;if(!k.equalsRange(s,n.range)){if(k.spansMultipleLines(s))r=!0;else{const a=n.range.endColumn-n.range.startColumn,l=s.endColumn-s.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=s}}for(let i=0,n=e.length;i<n;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}Fy.DecorationOptions=Ze.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class Ghe{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class Zhe extends cE{}let pN=class extends Hw{constructor(e,t,i,n,s,r,a,l,d,c,h,u){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=s,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=h,this._languageConfigurationService=u,this._disposeOnNewModel=new se,this._callOnDispose=new se,this._onDidSelectReference=new W,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new bt(0,0),this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Et(this._preview),Et(this._previewNotAvailableMessage),Et(this._tree),Et(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Vhe)||q.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Whe)||q.transparent,primaryHeadingColor:e.getColor(Y6),secondaryHeadingColor:e.getColor(X6)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=ie(e,pe("div.messages")),is(this._messageContainer),this._splitView=new aB(e,{orientation:1}),this._previewContainer=ie(e,pe("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Gc,this._previewContainer,t,{},this.editor),is(this._previewContainer),this._previewNotAvailableMessage=new gl(p("missingPreviewMessage","no preview available"),So,gl.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=ie(e,pe("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new jhe,keyboardNavigationLabelProvider:this._instantiationService.createInstance(gN),identityProvider:new $he,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Hhe}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(vi(this._treeContainer,"keydown",s=>{s.equals(9)&&(this._keybindingService.dispatchEvent(s,s.target),s.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Zhe,"ReferencesWidget",this._treeContainer,new Uhe,[this._instantiationService.createInstance(z0),this._instantiationService.createInstance($v)],this._instantiationService.createInstance(uN),i),this._splitView.addView({onDidChange:fe.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:s=>{this._preview.layout({height:this._dim.height,width:s})}},_w.Distribute),this._splitView.addView({onDidChange:fe.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:s=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${s}px`,this._tree.layout(this._dim.height,s)}},_w.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const n=(s,r)=>{s instanceof Zc&&(r==="show"&&this._revealReference(s,!1),this._onDidSelectReference.fire({element:s,kind:r,source:"tree"}))};this._tree.onDidOpen(s=>{s.sideBySide?n(s.element,"side"):s.editorOptions.pinned?n(s.element,"goto"):n(s.element,"show")}),is(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new bt(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=p("noResults","No results"),Os(this._messageContainer),Promise.resolve(void 0)):(is(this._messageContainer),this._decorationsManager=new Fy(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 n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Os(this._treeContainer),Os(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 Zc)return e;if(e instanceof H0&&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!==Ye.inMemory?this.setTitle(AQ(e.uri),this._uriLabel.getUriLabel(QS(e.uri))):this.setTitle(p("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 n=await i;if(!this._model){n.dispose();return}Et(this._previewModelReference);const s=n.object;if(s){const r=this._preview.getModel()===s.textEditorModel?0:1,a=k.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}};pN=qhe([Tl(3,tn),Tl(4,ks),Tl(5,Oe),Tl(6,Z6),Tl(7,ap),Tl(8,JS),Tl(9,Pt),Tl(10,ni),Tl(11,Wt)],pN);var Yhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kg=function(o,e){return function(t,i){e(t,i,o)}},QC;const dg=new be("referenceSearchVisible",!1,p("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Cp=QC=class{static get(e){return e.getContribution(QC.ID)}constructor(e,t,i,n,s,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new se,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=dg.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))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 s="peekViewLayout",r=Ghe.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(pN,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(p("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.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(p("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const c=this._editor.getModel().uri,h=new V(e.startLineNumber,e.startColumn),u=this._model.nearestReference(c,h);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}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 n=this._model.nextOrPreviousReference(i,e),s=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),s?this._editor.focus():this._widget&&r&&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===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const n=k.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then(s=>{var r;if(this._ignoreModelChangeEvent=!1,!s||!this._widget){this.closeWidget();return}if(this._editor===s)this._widget.show(n),this._widget.focusOnReferenceTree();else{const a=QC.get(s),l=this._model.clone();this.closeWidget(),s.focus(),a?.toggleWidget(n,Zi(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},s=>{this._ignoreModelChangeEvent=!1,Ge(s)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Cp.ID="editor.contrib.referencesController";Cp=QC=Yhe([kg(2,We),kg(3,Dt),kg(4,Vi),kg(5,Oe),kg(6,da),kg(7,ft)],Cp);function cg(o,e){const t=Fhe(o);if(!t)return;const i=Cp.get(t);i&&e(i)}Ls.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:qi(2089,60),when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ls.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.goToNextOrPreviousReference(!0)})}});Ls.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:te.or(dg,xs.inPeekEditor),handler(o){cg(o,e=>{e.goToNextOrPreviousReference(!1)})}});gt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");gt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");gt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");gt.registerCommand("closeReferenceSearch",o=>cg(o,e=>e.closeWidget()));Ls.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:te.and(xs.inPeekEditor,te.not("config.editor.stablePeek"))});Ls.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:te.and(dg,te.not("config.editor.stablePeek"))});Ls.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:te.and(dg,SB,KM.negate(),jM.negate()),handler(o){var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.revealReference(i[0]))}});Ls.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:te.and(dg,SB,KM.negate(),jM.negate()),handler(o){var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.openReference(i[0],!0,!0))}});gt.registerCommand("openReference",o=>{var e;const i=(e=o.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Zc&&cg(o,n=>n.openReference(i[0],!1,!0))});var Q6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Gm=function(o,e){return function(t,i){e(t,i,o)}};const wR=new be("hasSymbols",!1,p("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),By=ot("ISymbolNavigationService");let mN=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=wR.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new _N(this._editorService),n=i.onDidChange(s=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(const h of t.references)if(J2(h.uri,a.uri))d=!0,c=c||k.containsPosition(h.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=fr(i,n)}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:k.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?p("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):p("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};mN=Q6([Gm(0,We),Gm(1,Dt),Gm(2,Vi),Gm(3,Pt)],mN);ct(By,mN,1);ue(new class extends cn{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:wR,kbOpts:{weight:100,primary:70}})}runEditorCommand(o,e){return o.get(By).revealNext(e)}});Ls.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:wR,primary:9,handler(o){o.get(By).reset()}});let _N=class{constructor(e){this._listener=new Map,this._disposables=new se,this._onDidChange=new W,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(),Et(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,fr(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};_N=Q6([Gm(0,Dt)],_N);async function Kv(o,e,t,i){const s=t.ordered(o).map(a=>Promise.resolve(i(a,o,e)).then(void 0,l=>{Mi(l)})),r=await Promise.all(s);return Qr(r.flat())}function Wy(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideDefinition(s,r,i))}function J6(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideDeclaration(s,r,i))}function eW(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideImplementation(s,r,i))}function tW(o,e,t,i){return Kv(e,t,o,(n,s,r)=>n.provideTypeDefinition(s,r,i))}function Vy(o,e,t,i,n){return Kv(e,t,o,async(s,r,a)=>{const l=await s.provideReferences(r,a,{includeDeclaration:!0},n);if(!i||!l||l.length!==2)return l;const d=await s.provideReferences(r,a,{includeDeclaration:!1},n);return d&&d.length===1?d:l})}async function jv(o){const e=await o(),t=new Us(e,""),i=t.references.map(n=>n.link);return t.dispose(),i}Cl("_executeDefinitionProvider",(o,e,t)=>{const i=o.get(Se),n=Wy(i.definitionProvider,e,t,st.None);return jv(()=>n)});Cl("_executeTypeDefinitionProvider",(o,e,t)=>{const i=o.get(Se),n=tW(i.typeDefinitionProvider,e,t,st.None);return jv(()=>n)});Cl("_executeDeclarationProvider",(o,e,t)=>{const i=o.get(Se),n=J6(i.declarationProvider,e,t,st.None);return jv(()=>n)});Cl("_executeReferenceProvider",(o,e,t)=>{const i=o.get(Se),n=Vy(i.referenceProvider,e,t,!1,st.None);return jv(()=>n)});Cl("_executeImplementationProvider",(o,e,t)=>{const i=o.get(Se),n=eW(i.implementationProvider,e,t,st.None);return jv(()=>n)});var ym,Lm,xm,Gb,Zb,Yb,Xb,Qb;vn.appendMenuItem(N.EditorContext,{submenu:N.EditorContextPeek,title:p("peek.submenu","Peek"),group:"navigation",order:100});class wp{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof wp||V.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Yn extends aa{static all(){return Yn._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of rt.wrap(t.menu))(i.id===N.EditorContext||i.id===N.EditorContextPeek)&&(i.when=te.and(e.precondition,i.when));return t}constructor(e,t){super(Yn._patchConfig(t)),this.configuration=e,Yn._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(Vi),r=e.get(Dt),a=e.get(lh),l=e.get(By),d=e.get(Se),c=e.get(Oe),h=t.getModel(),u=t.getPosition(),g=wp.is(i)?i:new wp(h,u),f=new Uc(t,5),m=DS(this._getLocationModel(d,g.model,g.position,f.token),f.token).then(async _=>{var v;if(!_||f.token.isCancellationRequested)return;js(_.ariaMessage);let b;if(_.referenceAt(h.uri,u)){const w=this._getAlternativeCommand(t);!Yn._activeAlternativeCommands.has(w)&&Yn._allSymbolNavigationCommands.has(w)&&(b=Yn._allSymbolNavigationCommands.get(w))}const C=_.references.length;if(C===0){if(!this.configuration.muteMessage){const w=h.getWordAtPosition(u);(v=zs.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),u)}}else if(C===1&&b)Yn._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(w=>b.runEditorCommand(w,t,i,n).finally(()=>{Yn._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,n)},_=>{s.error(_)}).finally(()=>{f.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,s){const r=this._getGoToPreference(i);if(!(i instanceof Gc)&&(this.configuration.openInPeek||r==="peek"&&n.references.length>1))this._openInPeek(i,n,s);else{const a=n.firstReference(),l=n.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,n,s):n.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,n,s){let r;if(Xz(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:k.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){const n=Cp.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Zi(s=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Yn._allSymbolNavigationCommands=new Map;Yn._activeAlternativeCommands=new Set;class qv extends Yn{async _getLocationModel(e,t,i,n){return new Us(await Wy(e.definitionProvider,t,i,n),p("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("noResultWord","No definition found for '{0}'",e.word):p("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Xt((ym=class extends qv{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:ym.id,title:{value:p("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:p({},"Go to &&Definition")},precondition:te.and(M.hasDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:[{when:M.editorTextFocus,primary:70,weight:100},{when:te.and(M.editorTextFocus,bB),primary:2118,weight:100}],menu:[{id:N.EditorContext,group:"navigation",order:1.1},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),gt.registerCommandAlias("editor.action.goToDeclaration",ym.id)}},ym.id="editor.action.revealDefinition",ym));Xt((Lm=class extends qv{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Lm.id,title:{value:p("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:te.and(M.hasDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:[{when:M.editorTextFocus,primary:qi(2089,70),weight:100},{when:te.and(M.editorTextFocus,bB),primary:qi(2089,2118),weight:100}]}),gt.registerCommandAlias("editor.action.openDeclarationToTheSide",Lm.id)}},Lm.id="editor.action.revealDefinitionAside",Lm));Xt((xm=class extends qv{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:xm.id,title:{value:p("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:te.and(M.hasDefinitionProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:2}}),gt.registerCommandAlias("editor.action.previewDeclaration",xm.id)}},xm.id="editor.action.peekDefinition",xm));class iW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await J6(e.declarationProvider,t,i,n),p("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Xt((Gb=class extends iW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Gb.id,title:{value:p("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:p({},"Go to &&Declaration")},precondition:te.and(M.hasDeclarationProvider,M.isInWalkThroughSnippet.toNegated()),menu:[{id:N.EditorContext,group:"navigation",order:1.3},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?p("decl.noResultWord","No declaration found for '{0}'",e.word):p("decl.generic.noResults","No declaration found")}},Gb.id="editor.action.revealDeclaration",Gb));Xt(class extends iW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:p("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:te.and(M.hasDeclarationProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:3}})}});class nW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await tW(e.typeDefinitionProvider,t,i,n),p("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):p("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Xt((Zb=class extends nW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Zb.ID,title:{value:p("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:p({},"Go to &&Type Definition")},precondition:te.and(M.hasTypeDefinitionProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:0,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.4},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},Zb.ID="editor.action.goToTypeDefinition",Zb));Xt((Yb=class extends nW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Yb.ID,title:{value:p("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:te.and(M.hasTypeDefinitionProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:4}})}},Yb.ID="editor.action.peekTypeDefinition",Yb));class sW extends Yn{async _getLocationModel(e,t,i,n){return new Us(await eW(e.implementationProvider,t,i,n),p("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?p("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):p("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Xt((Xb=class extends sW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Xb.ID,title:{value:p("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:p({},"Go to &&Implementations")},precondition:te.and(M.hasImplementationProvider,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:2118,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},Xb.ID="editor.action.goToImplementation",Xb));Xt((Qb=class extends sW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Qb.ID,title:{value:p("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:te.and(M.hasImplementationProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:3142,weight:100},menu:{id:N.EditorContextPeek,group:"peek",order:5}})}},Qb.ID="editor.action.peekImplementation",Qb));class oW extends Yn{_getNoResultFoundMessage(e){return e?p("references.no","No references found for '{0}'",e.word):p("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Xt(class extends oW{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:p("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:p({},"Go to &&References")},precondition:te.and(M.hasReferenceProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),keybinding:{when:M.editorTextFocus,primary:1094,weight:100},menu:[{id:N.EditorContext,group:"navigation",order:1.45},{id:N.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new Us(await Vy(e.referenceProvider,t,i,!0,n),p("ref.title","References"))}});Xt(class extends oW{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:p("references.action.label","Peek References"),original:"Peek References"},precondition:te.and(M.hasReferenceProvider,xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated()),menu:{id:N.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new Us(await Vy(e.referenceProvider,t,i,!1,n),p("ref.title","References"))}});class Xhe extends Yn{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:p("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:te.and(xs.notInPeekEditor,M.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new Us(this._references,p("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&p("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}gt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:Me},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(o,e,t,i,n,s,r)=>{Tt(Me.isUri(e)),Tt(V.isIPosition(t)),Tt(Array.isArray(i)),Tt(typeof n>"u"||typeof n=="string"),Tt(typeof r>"u"||typeof r=="boolean");const a=o.get(Dt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if($c(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{const c=new class extends Xhe{_getNoResultFoundMessage(h){return s||super._getNoResultFoundMessage(h)}}({muteMessage:!s,openInPeek:!!r,openToSide:!1},i,n);d.get(Oe).invokeFunction(c.run.bind(c),l)})}});gt.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:Me},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(o,e,t,i,n)=>{o.get(ui).executeCommand("editor.action.goToLocations",e,t,i,n,void 0,!0)}});gt.registerCommand({id:"editor.action.findReferences",handler:(o,e,t)=>{Tt(Me.isUri(e)),Tt(V.isIPosition(t));const i=o.get(Se),n=o.get(Dt);return n.openCodeEditor({resource:e},n.getFocusedCodeEditor()).then(s=>{if(!$c(s)||!s.hasModel())return;const r=Cp.get(s);if(!r)return;const a=Zi(d=>Vy(i.referenceProvider,s.getModel(),V.lift(t),!1,d).then(c=>new Us(c,p("ref.title","References")))),l=new k(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});gt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var Qhe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},lD=function(o,e){return function(t,i){e(t,i,o)}},Zm;let Hu=Zm=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new se,this.toUnhookForKeyboard=new se,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new Ry(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(s.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Ge(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(s.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(Zm.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 t;this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new r6(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Zi(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){Ge(a);return}if(!s||!s.length||!n.validate(this.editor)){this.removeLinkDecorations();return}const r=s[0].originSelectionRange?k.lift(s[0].originSelectionRange):new k(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let a=r;for(const{originSelectionRange:l}of s)l&&(a=k.plusRange(a,l));this.addDecoration(a,new Fn().appendText(p("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:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}const h=this.getPreviewValue(d,c,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,h?new Fn().appendCodeblock(u||"",h):void 0),l.dispose()})}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=Zm.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let s=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);s=Math.min(s,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${s-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+Zm.MAX_SOURCE_PREVIEW_LINES);let s=t+1;for(;s<n;s++){const r=e.getLineFirstNonWhitespaceColumn(s);if(i===r)break}return new k(t,1,s+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof Hc)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Wy(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const n=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new qv({openToSide:t,openInPeek:n,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(We);return xs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Hu.ID="editor.contrib.gotodefinitionatposition";Hu.MAX_SOURCE_PREVIEW_LINES=8;Hu=Zm=Qhe([lD(1,ks),lD(2,ni),lD(3,Se)],Hu);yt(Hu.ID,Hu,2);const Jb=pe;class rW extends K{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new Cv(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class SR extends K{static render(e,t,i){return new SR(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ie(e,Jb("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ie(this.actionContainer,Jb("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ie(this.action,Jb(`span.icon.${t.iconClass}`));const n=ie(this.action,Jb("span"));n.textContent=i?`${t.label} (${i})`:t.label,this._register(Q(this.actionContainer,ge.CLICK,s=>{s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer)})),this._register(Q(this.actionContainer,ge.KEY_DOWN,s=>{const r=new Gt(s);(r.equals(3)||r.equals(10))&&(s.stopPropagation(),s.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function Jhe(o,e){return o&&e?p("acessibleViewHint","Inspect this in the accessible view with {0}.",e):o?p("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}let eue=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class aW extends K{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Rt(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Rt(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Rt(()=>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=o$(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){Ge(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 eue(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 dD{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,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 JC{constructor(e,t,i,n,s,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const hg=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class yR{constructor(){this._onDidWillResize=new W,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new W,this.onDidResize=this._onDidResize.event,this._sashListener=new se,this._size=new bt(0,0),this._minSize=new bt(0,0),this._maxSize=new bt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new An(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new An(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new An(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:pw.North}),this._southSash=new An(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:pw.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(fe.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(fe.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(n=>{e&&(i=n.currentX-n.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(n=>{e&&(i=-(n.currentX-n.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(n=>{e&&(t=-(n.currentY-n.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(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(fe.any(this._eastSash.onDidReset,this._westSash.onDidReset)(n=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(fe.any(this._northSash.onDidReset,this._southSash.onDidReset)(n=>{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,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:r}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(r,t));const a=new bt(t,e);bt.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 tue=30,iue=24;class nue extends K{constructor(e,t=new bt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new yR),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=bt.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 bt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?V.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:ji(t).top+i.top-tue}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=ji(t),s=Lu(t.ownerDocument.body),r=n.top+i.top+i.height;return s.height-r-iue}_findPositionPreference(e,t){var i,n;const s=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((n=this._availableVerticalSpaceAbove(t))!==null&&n!==void 0?n:1/0,e),a=Math.min(Math.max(r,s),e),l=Math.min(e,a);let d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=s?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}}var LR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ru=function(o,e){return function(t,i){e(t,i,o)}},e1,Ca;const n5=pe;let zw=e1=class extends K{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(yc,this._editor)),this._participants=[];for(const n of hg.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort((n,s)=>n.hoverOrdinal-s.hoverOrdinal),this._computer=new $w(this._editor,this._participants),this._hoverOperation=this._register(new aW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{if(!this._computer.anchor)return;const s=n.hasLoadingMessage?this._addLoadingMessage(n.value):n.value;this._withResult(new lW(this._computer.anchor,s,n.isComplete))})),this._register(vi(this._widget.getDomNode(),"keydown",n=>{n.equals(9)&&this.hide()})),this._register(Ti.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const s=n.suggestHoverAnchor(e);s&&t.push(s)}const i=e.target;if(i.type===6&&t.push(new dD(0,i.range,e.event.posx,e.event.posy)),i.type===7){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<n&&t.push(new dD(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((n,s)=>s.priority-n.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new dD(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):!1:this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,s){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=n,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=e1.computeHoverRanges(this._editor,e.range,t),r=new se,a=r.add(new Uw(this._keybindingService)),l=document.createDocumentFragment();let d=null;const c={fragment:l,statusBar:a,setColorPicker:u=>d=u,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:u=>this._widget.setMinimumDimensions(u),hide:()=>this.hide()};for(const u of this._participants){const g=t.filter(f=>f.owner===u);g.length>0&&r.add(u.renderHoverParts(c,g))}const h=t.some(u=>u.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(s){const u=this._editor.createDecorationsCollection();u.set([{range:s,options:e1._DECORATION_OPTIONS}]),r.add(Ae(()=>{u.clear()}))}this._widget.showAt(l,new oue(d,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,h,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const d=e._getViewModel(),c=d.coordinatesConverter,h=c.convertModelRangeToViewRange(t),u=new V(h.startLineNumber,d.getLineMinColumn(h.startLineNumber));n=c.convertViewPositionToModelPosition(u).column}const s=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const d of i)a=k.plusRange(a,d.range),d.range.startLineNumber===s&&d.range.endLineNumber===s&&(r=Math.max(Math.min(r,d.range.startColumn),n)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new V(s,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new V(s,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};zw._DECORATION_OPTIONS=Ze.register({description:"content-hover-highlight",className:"hoverHighlight"});zw=e1=LR([ru(1,Oe),ru(2,Pt)],zw);class lW{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new sue(this,this.anchor,t,this.isComplete)}}class sue extends lW{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class oue{constructor(e,t,i,n,s,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}}const s5=30,cD=10,rue=6;let yc=Ca=class extends nue{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,n,s){const r=e.getOption(66)+8,a=150,l=new bt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new rW),this._minimumSize=l,this._hoverVisibleKey=M.hoverVisible.bindTo(t),this._hoverFocusedKey=M.hoverFocused.bindTo(t),ie(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(c=>{c.hasChanged(50)&&this._updateFont()}));const d=this._register(dl(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Ca.ID}static _applyDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Ca._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Ca._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n=typeof t=="number"?`${t}px`:t,s=typeof i=="number"?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){Ca._applyMaxDimensions(this._hover.contentsDomNode,e,t),Ca._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-cD))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new bt(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;Ca._lastDimensions=new bt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=rue;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=cD),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Lu(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=ji(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=o5(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const n=o5(e,t,i.left,i.top,i.width,i.height);return n>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_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(s=>this._editor.applyFontInfo(s))}_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,Ca._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Ca._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,n,s,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Xh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(n=t.colorPicker)===null||n===void 0||n.layout();const c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Jhe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||s===void 0?void 0:s.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new bt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(vs(i),Math.min(s,e)),this._setContentsDomNodeDimensions(vs(n),Math.min(s,e-cD))}setMinimumDimensions(e){this._minimumSize=new bt(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 bt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Xh(t),n=vs(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=Xh(t),n=vs(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const s=Xh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(s,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-s5})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+s5})}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})}};yc.ID="editor.contrib.resizableContentHoverWidget";yc._lastDimensions=new bt(0,0);yc=Ca=LR([ru(1,We),ru(2,ft),ru(3,Sl),ru(4,Pt)],yc);let Uw=class extends K{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=n5("div.hover-row.status-bar"),this.actionsElement=ie(this.hoverElement,n5("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(SR.render(this.actionsElement,e,i))}append(e){const t=ie(this.actionsElement,e);return this._hasContent=!0,t}};Uw=LR([ru(0,Pt)],Uw);class $w{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(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===n?r.range.startColumn:1,l=r.range.endLineNumber===n?r.range.endColumn:s;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Fi.EMPTY;const i=$w._getLineDecorations(this._editor,t);return Fi.merge(this._participants.map(n=>n.computeAsync?n.computeAsync(t,i,e):Fi.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=$w._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Qr(t)}}function o5(o,e,t,i,n,s){const r=t+n/2,a=i+s/2,l=Math.max(Math.abs(o-r)-n/2,0),d=Math.max(Math.abs(e-a)-s/2,0);return Math.sqrt(l*l+d*d)}const r5=pe;class Vf extends K{constructor(e,t,i){super(),this._renderDisposeables=this._register(new se),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new rW),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new pd({editor:this._editor},t,i)),this._computer=new aue(this._editor),this._hoverOperation=this._register(new aW(this._editor,this._computer)),this._register(this._hoverOperation.onResult(n=>{this._withResult(n.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Vf.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const n of t){const s=r5("div.hover-row.markdown-hover"),r=ie(s,r5("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(n.value));r.appendChild(a.element),i.appendChild(s)}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),n=this._editor.getScrollTop(),s=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-n-(r-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Vf.ID="editor.contrib.modesGlyphHoverWidget";class aue{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=n=>({value:n}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const s=n.options.glyphMarginHoverMessage;!s||hp(s)||i.push(...BT(s).map(e))}return i}}class lue{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function due(o,e,t,i,n){try{const s=await Promise.resolve(o.provideHover(t,i,n));if(s&&hue(s))return new lue(o,s,e)}catch(s){Mi(s)}}function xR(o,e,t,i){const s=o.ordered(e).map((r,a)=>due(r,a,e,t,i));return Fi.fromPromises(s).coalesce()}function cue(o,e,t,i){return xR(o,e,t,i).map(n=>n.hover).toPromise()}Cl("_executeHoverProvider",(o,e,t)=>{const i=o.get(Se);return cue(i.hoverProvider,e,t,st.None)});function hue(o){const e=typeof o.range<"u",t=typeof o.contents<"u"&&o.contents&&o.contents.length>0;return e&&t}var uue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eC=function(o,e){return function(t,i){e(t,i,o)}};const a5=pe;class Kr{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let Kw=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new Kr(this,e.range,[new Fn().appendText(p("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];let a=1e3;const l=i.getLineLength(n),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d});let u=!1;c>=0&&l>c&&e.range.startColumn>=c&&(u=!0,r.push(new Kr(this,e.range,[{value:p("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Kr(this,e.range,[{value:p("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 f of t){const m=f.range.startLineNumber===n?f.range.startColumn:1,_=f.range.endLineNumber===n?f.range.endColumn:s,v=f.options.hoverMessage;if(!v||hp(v))continue;f.options.beforeContentClassName&&(g=!0);const b=new k(e.range.startLineNumber,m,e.range.startLineNumber,_);r.push(new Kr(this,b,BT(v),g,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Fi.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return Fi.EMPTY;const s=new V(e.range.startLineNumber,e.range.startColumn);return xR(this._languageFeaturesService.hoverProvider,n,s,i).filter(r=>!hp(r.hover.contents)).map(r=>{const a=r.hover.range?k.lift(r.hover.range):e.range;return new Kr(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return dW(e,t,this._editor,this._languageService,this._openerService)}};Kw=uue([eC(1,ni),eC(2,Qs),eC(3,ft),eC(4,Se)],Kw);function dW(o,e,t,i,n){e.sort((r,a)=>r.ordinal-a.ordinal);const s=new se;for(const r of e)for(const a of r.contents){if(hp(a))continue;const l=a5("div.hover-row.markdown-hover"),d=ie(l,a5("div.hover-contents")),c=s.add(new pd({editor:t},i,n));s.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",o.onContentsChanged()}));const h=s.add(c.render(a));d.appendChild(h.element),o.fragment.appendChild(l)}return s}var cW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jw=function(o,e){return function(t,i){e(t,i,o)}};class l5{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let vN=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new W,this.onDidChange=this._onDidChange.event,this._dispoables=new se,this._markers=[],this._nextIdx=-1,Me.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(a,l)=>{let d=V_(a.resource.toString(),l.resource.toString());return d===0&&(n==="position"?d=k.compareRangesUsingStarts(a,l)||ci.compare(a.severity,l.severity):d=ci.compare(a.severity,l.severity)||k.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:Me.isUri(e)?e:void 0,severities:ci.Error|ci.Warning|ci.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(s)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new l5(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());s<0&&(s=M_(this._markers,{resource:e.uri},(r,a)=>V_(r.resource.toString(),a.resource.toString())),s<0&&(s=~s));for(let r=s;r<this._markers.length;r++){let a=k.lift(this._markers[r]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new k(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,n=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}n||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const n=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(n=>n.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(k.containsPosition(this._markers[i],t))return new l5(this._markers[i],i+1,this._markers.length)}}};vN=cW([jw(1,yl),jw(2,ft)],vN);const hW=ot("IMarkerNavigationService");let bN=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new rs}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new vN(e,this._markerService,this._configService)}};bN=cW([jw(0,yl),jw(1,ft)],bN);ct(hW,bN,1);var CN;(function(o){function e(t){switch(t){case Si.Ignore:return"severity-ignore "+Re.asClassName(he.info);case Si.Info:return Re.asClassName(he.info);case Si.Warning:return Re.asClassName(he.warning);case Si.Error:return Re.asClassName(he.error);default:return""}}o.className=e})(CN||(CN={}));var gue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ig=function(o,e){return function(t,i){e(t,i,o)}},wN;class fue{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new se,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(vi(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new k8(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Et(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let r=(t?.length||0)+2;s&&(typeof s=="string"?r+=s.length:r+=s.value.length);const a=ll(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);bn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=pe("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=f=>{this._openerService.open(s.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()};const g=ie(this._codeLink,pe("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(bn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Bn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const g of n){const f=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const _=document.createElement("span");_.innerText=g.message,f.appendChild(m),f.appendChild(_),this._lines+=1,u.appendChild(f)}}const d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}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 ci.Error:t=p("Error","Error");break;case ci.Warning:t=p("Warning","Warning");break;case ci.Info:t=p("Info","Info");break;case ci.Hint:t=p("Hint","Hint");break}let i=p("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let Sp=wN=class extends Hw{constructor(e,t,i,n,s,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new se,this._onDidSelectRelatedInformation=new W,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ci.Warning,this._backgroundColor=q.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(vue);let t=SN,i=pue;this._severity===ci.Warning?(t=t1,i=mue):this._severity===ci.Info&&(t=yN,i=_ue);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(Y6),secondaryHeadingColor:e.getColor(X6)})}_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(n=>this.editor.focus()));const t=[],i=this._menuService.createMenu(wN.TitleMenu,this._contextKeyService);NM(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ie(e,pe(""))}_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 fue(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 n=k.lift(e),s=this.editor.getPosition(),r=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?p("problems","{0} of {1} problems",t,i):p("change","{0} of {1} problem",t,i);this.setTitle(qo(a.uri),l)}this._icon.className=`codicon ${CN.className(ci.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Sp.TitleMenu=new N("gotoErrorTitleMenu");Sp=wN=gue([Ig(1,tn),Ig(2,Qs),Ig(3,ra),Ig(4,Oe),Ig(5,We),Ig(6,ap)],Sp);const d5=s0(Ka,pG),c5=s0(vo,i0),h5=s0(Ss,n0),SN=R("editorMarkerNavigationError.background",{dark:d5,light:d5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationError","Editor marker navigation widget error color.")),pue=R("editorMarkerNavigationError.headerBackground",{dark:Ee(SN,.1),light:Ee(SN,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),t1=R("editorMarkerNavigationWarning.background",{dark:c5,light:c5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),mue=R("editorMarkerNavigationWarning.headerBackground",{dark:Ee(t1,.1),light:Ee(t1,.1),hcDark:"#0C141F",hcLight:Ee(t1,.2)},p("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),yN=R("editorMarkerNavigationInfo.background",{dark:h5,light:h5,hcDark:dt,hcLight:dt},p("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),_ue=R("editorMarkerNavigationInfo.headerBackground",{dark:Ee(yN,.1),light:Ee(yN,.1),hcDark:null,hcLight:null},p("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),vue=R("editorMarkerNavigation.background",{dark:en,light:en,hcDark:en,hcLight:en},p("editorMarkerNavigationBackground","Editor marker navigation widget background."));var bue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tC=function(o,e){return function(t,i){e(t,i,o)}},Ym;let Yc=Ym=class{static get(e){return e.getContribution(Ym.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new se,this._editor=e,this._widgetVisible=uW.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(Sp,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 n,s,r;(!(!((n=this._model)===null||n===void 0)&&n.selected)||!k.containsPosition((s=this._model)===null||s===void 0?void 0:s.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:k.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new V(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,n;if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const r=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);r&&((i=Ym.get(r))===null||i===void 0||i.close(),(n=Ym.get(r))===null||n===void 0||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}};Yc.ID="editor.contrib.markerController";Yc=Ym=bue([tC(1,hW),tC(2,We),tC(3,Dt),tC(4,Oe)],Yc);class Hy extends we{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=Yc.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}}class Lc extends Hy{constructor(){super(!0,!1,{id:Lc.ID,label:Lc.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:578,weight:100},menuOpts:{menuId:Sp.TitleMenu,title:Lc.LABEL,icon:Di("marker-navigation-next",he.arrowDown,p("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Lc.ID="editor.action.marker.next";Lc.LABEL=p("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class fu extends Hy{constructor(){super(!1,!1,{id:fu.ID,label:fu.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:M.focus,primary:1602,weight:100},menuOpts:{menuId:Sp.TitleMenu,title:fu.LABEL,icon:Di("marker-navigation-previous",he.arrowUp,p("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}fu.ID="editor.action.marker.prev";fu.LABEL=p("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Cue extends Hy{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:p("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:M.focus,primary:66,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class wue extends Hy{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:p("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:M.focus,primary:1090,weight:100},menuOpts:{menuId:N.MenubarGoMenu,title:p({},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}yt(Yc.ID,Yc,4);de(Lc);de(fu);de(Cue);de(wue);const uW=new be("markersNavigationVisible",!1),Sue=cn.bindToContribution(Yc.get);ue(new Sue({id:"closeMarkersNavigation",precondition:uW,handler:o=>o.close(),kbOpts:{weight:150,kbExpr:M.focus,primary:9,secondary:[1033]}}));var yue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hD=function(o,e){return function(t,i){e(t,i,o)}};const er=pe;class Lue{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 u5={type:1,filter:{include:Be.QuickFix},triggerAction:qs.QuickFixHover};let LN=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,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(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),r=[];for(const a of t){const l=a.range.startLineNumber===n?a.range.startColumn:1,d=a.range.endLineNumber===n?a.range.endColumn:s,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;const h=new k(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new Lue(this,h,c))}return r}renderHoverParts(e,t){if(!t.length)return K.None;const i=new se;t.forEach(s=>e.fragment.appendChild(this.renderMarkerHover(s,i)));const n=t.length===1?t[0]:t.sort((s,r)=>ci.compare(s.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=er("div.hover-row"),n=ie(i,er("div.marker.hover-contents")),{source:s,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const d=ie(n,er("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,s||a)if(a&&typeof a!="string"){const c=er("span");if(s){const f=ie(c,er("span"));f.innerText=s}const h=ie(c,er("a.code-link"));h.setAttribute("href",a.target.toString()),t.add(Q(h,"click",f=>{this._openerService.open(a.target,{allowCommands:!0}),f.preventDefault(),f.stopPropagation()}));const u=ie(h,er("span"));u.innerText=a.value;const g=ie(n,c);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const c=ie(n,er("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Bn(l))for(const{message:c,resource:h,startLineNumber:u,startColumn:g}of l){const f=ie(n,er("div"));f.style.marginTop="8px";const m=ie(f,er("a"));m.innerText=`${qo(h)}(${u}, ${g}): `,m.style.cursor="pointer",t.add(Q(m,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(h,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:g}}}).catch(Ge)}));const _=ie(f,er("span"));_.innerText=c,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ci.Error||t.marker.severity===ci.Warning||t.marker.severity===ci.Info)&&e.statusBar.addAction({label:p("view problem","View Problem"),commandId:Lc.ID,run:()=>{var n;e.hide(),(n=Yc.get(this._editor))===null||n===void 0||n.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(er("div"));this.recentMarkerCodeActionsInfo&&(gw.makeKey(this.recentMarkerCodeActionsInfo.marker)===gw.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=p("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?K.None:i.add(Rc(()=>n.textContent=p("checkingForQuickFixes","Checking for quick fixes..."),200));n.textContent||(n.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ae(()=>r.cancel())),r.then(a=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),n.textContent=p("noQuickFixes","No quick fixes available");return}n.style.display="none";let l=!1;i.add(Ae(()=>{l||a.dispose()})),e.statusBar.addAction({label:p("quick fixes","Quick Fix..."),commandId:pR,run:d=>{l=!0;const c=jc.get(this._editor),h=ji(d);e.hide(),c?.showCodeActions(u5,a,{x:h.left,y:h.top,width:h.width,height:h.height})}})},Ge)}}getCodeActions(e){return Zi(t=>L_(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),u5,ld.None,t))}};LN=yue([hD(1,R2),hD(2,Qs),hD(3,Se)],LN);const gW="editor.action.inlineSuggest.commit",fW="editor.action.inlineSuggest.showPrevious",pW="editor.action.inlineSuggest.showNext";var DR=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jr=function(o,e){return function(t,i){e(t,i,o)}},i1;let xN=class extends K{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=pi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Xe(this,n=>{var s,r,a;const l=(s=this.model.read(n))===null||s===void 0?void 0:s.ghostText.read(n);if(!this.alwaysShowToolbar.read(n)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const c=new V(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(yd((n,s)=>{const r=this.model.read(n);if(!r||!this.alwaysShowToolbar.read(n))return;const a=s.add(this.instantiationService.createInstance(Xc,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),s.add(Ae(()=>e.removeContentWidget(a))),s.add(xt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==od.Explicit&&r.triggerExplicitly()}))}))}};xN=DR([jr(2,Oe)],xN);const xue=Di("inline-suggestion-hints-next",he.chevronRight,p("parameterHintsNextIcon","Icon for show next parameter hint.")),Due=Di("inline-suggestion-hints-previous",he.chevronLeft,p("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let Xc=i1=class extends K{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new cs(e,t,i,!0,()=>this._commandService.executeCommand(e)),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return s&&(r=p({},"{0} ({1})",t,s.getLabel())),n.tooltip=r,n}constructor(e,t,i,n,s,r,a,l,d,c,h){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=h,this.id=`InlineSuggestionHintsContentWidget${i1.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Jt("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Jt("div@toolBar")]),this.previousAction=this.createCommandAction(fW,p("previous","Previous"),Re.asClassName(Due)),this.availableSuggestionCountAction=new cs("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(pW,p("next","Next"),Re.asClassName(xue)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(N.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Rt(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Rt(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(DN,this.nodes.toolBar,N.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:u=>u.startsWith("primary")},actionViewItemProvider:(u,g)=>{if(u instanceof _r)return l.createInstance(Iue,u,void 0);if(u===this.availableSuggestionCountAction){const f=new kue(void 0,u,{label:!0,icon:!1});return f.setClass("availableSuggestionCount"),f}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(u=>{i1._dropDownVisible=u})),this._register(xt(u=>{this._position.read(u),this.editor.layoutContentWidget(this)})),this._register(xt(u=>{const g=this._suggestionCount.read(u),f=this._currentSuggestionIdx.read(u);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${f+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(xt(u=>{const g=this._extraCommands.read(u);if(_i(this.lastCommands,g))return;this.lastCommands=g;const f=g.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof _r&&f.push(v);f.length>0&&f.unshift(new dn),this.toolBar.setAdditionalSecondaryActions(f)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Xc._dropDownVisible=!1;Xc.id=0;Xc=i1=DR([jr(6,ui),jr(7,Oe),jr(8,Pt),jr(9,We),jr(10,ra)],Xc);class kue extends up{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Iue=class extends Nu{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Jt("div.keybinding").root;new Mv(t,mo,{disableTitle:!0,...boe}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},DN=class extends Ow{constructor(e,t,i,n,s,r,a,l){super(e,{resetMenu:t,...i},n,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,n,s,r,a;const l=[],d=[];NM(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(s=(n=this.options2)===null||n===void 0?void 0:n.toolbarOptions)===null||s===void 0?void 0:s.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){_i(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){_i(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};DN=DR([jr(3,ra),jr(4,We),jr(5,Yo),jr(6,Pt),jr(7,Gs)],DN);var Eue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iC=function(o,e){return function(t,i){e(t,i,o)}},kN;let Ds=kN=class extends K{static get(e){return e.getContribution(kN.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new se,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Rt(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===yc.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Vf.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();const n=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(n)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===yc.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((s=(n=e.event.browserEvent.view)===null||n===void 0?void 0:n.getSelection())===null||s===void 0)&&s.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===yc.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Vf.ID)}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((n=this._contentWidget)===null||n===void 0)&&n.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((s=this._contentWidget)===null||s===void 0)&&s.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,r=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(s.type===2&&s.position){(n=this._contentWidget)===null||n===void 0||n.hide(),this._glyphWidget||(this._glyphWidget=new Vf(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(s.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!n&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Xc.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(zw,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ds.ID="editor.contrib.hover";Ds=kN=Eue([iC(1,Oe),iC(2,Qs),iC(3,ni),iC(4,Pt)],Ds);var Rr;(function(o){o.NoAutoFocus="noAutoFocus",o.FocusIfVisible="focusIfVisible",o.AutoFocusImmediately="autoFocusImmediately"})(Rr||(Rr={}));class Nue extends we{constructor(){super({id:"editor.action.showHover",label:p({},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",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:[Rr.NoAutoFocus,Rr.FocusIfVisible,Rr.AutoFocusImmediately],enumDescriptions:[p("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),p("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),p("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Rr.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=Ds.get(t);if(!n)return;const s=i?.focus;let r=Rr.FocusIfVisible;s in Rr?r=s:typeof s=="boolean"&&s&&(r=Rr.AutoFocusImmediately);const a=d=>{const c=t.getPosition(),h=new k(c.lineNumber,c.column,c.lineNumber,c.column);n.showContentHover(h,1,1,d)},l=t.getOption(2)===2;n.isHoverVisible?r!==Rr.NoAutoFocus?n.focus():a(l):a(l||r===Rr.AutoFocusImmediately)}}class Tue extends we{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:p({},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=Ds.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new k(n.lineNumber,n.column,n.lineNumber,n.column),r=Hu.get(t);if(!r)return;r.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(s,1,1,!0)})}}class Mue extends we{constructor(){super({id:"editor.action.scrollUpHover",label:p({},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollUp()}}class Rue extends we{constructor(){super({id:"editor.action.scrollDownHover",label:p({},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollDown()}}class Aue extends we{constructor(){super({id:"editor.action.scrollLeftHover",label:p({},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollLeft()}}class Pue extends we{constructor(){super({id:"editor.action.scrollRightHover",label:p({},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ds.get(t);i&&i.scrollRight()}}class Oue extends we{constructor(){super({id:"editor.action.pageUpHover",label:p({},"Page Up Hover"),alias:"Page Up Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.pageUp()}}class Fue extends we{constructor(){super({id:"editor.action.pageDownHover",label:p({},"Page Down Hover"),alias:"Page Down Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.pageDown()}}class Bue extends we{constructor(){super({id:"editor.action.goToTopHover",label:p({},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.goToTop()}}class Wue extends we{constructor(){super({id:"editor.action.goToBottomHover",label:p({},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:M.hoverFocused,kbOpts:{kbExpr:M.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ds.get(t);i&&i.goToBottom()}}yt(Ds.ID,Ds,2);de(Nue);de(Tue);de(Mue);de(Rue);de(Aue);de(Pue);de(Oue);de(Fue);de(Bue);de(Wue);hg.register(Kw);hg.register(LN);Sr((o,e)=>{const t=o.getColor(NG);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class IN extends K{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==V6||!i.range)return;const n=this._editor.getContribution(Ds.ID);if(n&&!n.isColorPickerVisible){const s=new k(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(s,1,0,!1,!0)}}}IN.ID="editor.contrib.colorContribution";yt(IN.ID,IN,2);hg.register(Vw);var mW=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hr=function(o,e){return function(t,i){e(t,i,o)}},EN,NN;let Qc=EN=class extends K{constructor(e,t,i,n,s,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=M.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=M.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new qw(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(EN.ID)}};Qc.ID="editor.contrib.standaloneColorPickerController";Qc=EN=mW([Hr(1,We),Hr(2,ii),Hr(3,Pt),Hr(4,Oe),Hr(5,Se),Hr(6,Wt)],Qc);yt(Qc.ID,Qc,1);const g5=8,Vue=22;let qw=NN=class extends K{constructor(e,t,i,n,s,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new W),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(W0,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),h=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},u=this._register(dl(this._body));this._register(u.onDidBlur(g=>{this.hide()})),this._register(u.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var f;const m=(f=g.target.element)===null||f===void 0?void 0:f.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(h),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return NN.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 Hue(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 bR(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment(),n=this._register(new Uw(this._keybindingService));let s;const r={fragment:i,statusBar:n,setColorPicker:m=>s=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),s===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),s.layout();const a=s.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-Vue-g5,c=s.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});const h=s.header,u=h.pickedColorNode;u.style.width=l+g5+"px";const g=h.originalColorNode;g.style.width=d+"px";const f=s.header.closeButton;f?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};qw.ID="editor.contrib.standaloneColorPickerWidget";qw=NN=mW([Hr(3,Oe),Hr(4,ii),Hr(5,Pt),Hr(6,Se),Hr(7,Wt)],qw);class Hue{constructor(e,t){this.value=e,this.foundInEditor=t}}class zue extends aa{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:p("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:p({},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:N.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.showOrFocus()}}class Uue extends we{constructor(){super({id:"editor.action.hideColorPicker",label:p({},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:M.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.hide()}}class $ue extends we{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:p({},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:M.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=Qc.get(t))===null||i===void 0||i.insertColor()}}de(Uue);de($ue);Xt(zue);class ac{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 n=t.length,s=e.length;if(i+n>s)return!1;for(let r=0;r<n;r++){const a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,r){const a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,h=s.getLineContent(a),u=s.getLineContent(d);let g=h.lastIndexOf(t,l-1+t.length),f=u.indexOf(i,c-1-i.length);if(g!==-1&&f!==-1)if(a===d)h.substring(g+t.length,f).indexOf(i)>=0&&(g=-1,f=-1);else{const _=h.substring(g+t.length),v=u.substring(0,f);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(g=-1,f=-1)}let m;g!==-1&&f!==-1?(n&&g+t.length<h.length&&h.charCodeAt(g+t.length)===32&&(t=t+" "),n&&f>0&&u.charCodeAt(f-1)===32&&(i=" "+i,f-=1),m=ac._createRemoveBlockCommentOperations(new k(a,g+t.length+1,d,f+1),t,i)):(m=ac._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)r.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return k.isEmpty(e)?n.push(oi.delete(new k(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(oi.delete(new k(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(oi.delete(new k(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return k.isEmpty(e)?s.push(oi.replace(new k(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(oi.insert(new V(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(oi.insert(new V(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),r=this.languageConfigurationService.getLanguageConfiguration(s).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const n=i[0],s=i[1];return new xe(n.range.endLineNumber,n.range.endColumn,s.range.startLineNumber,s.range.startColumn)}else{const n=i[0].range,s=this._usedEndToken?-this._usedEndToken.length-1:0;return new xe(n.endLineNumber,n.endColumn+s,n.endLineNumber,n.endColumn+s)}}}class Fl{constructor(e,t,i,n,s,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),r=n.getLanguageConfiguration(s).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,n,s,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let h=0,u=n.length;h<u;h++){const g=n[h],f=s+h;if(f===s&&a){g.ignore=!0;continue}const m=i.getLineContent(f),_=Xn(m);if(_===-1){g.ignore=r,g.commentStrOffset=m.length;continue}if(d=!1,g.ignore=!1,g.commentStrOffset=_,c&&!ac._haystackHasNeedleAtOffset(m,g.commentStr,_)&&(e===0?c=!1:e===1||(g.ignore=!0)),c&&t){const v=_+g.commentStrLength;v<m.length&&m.charCodeAt(v)===32&&(g.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let h=0,u=n.length;h<u;h++)n[h].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:n}}static _gatherPreflightData(e,t,i,n,s,r,a,l){const d=Fl._gatherPreflightCommentStrings(i,n,s,l);return d===null?{supported:!1}:Fl._analyzeLines(e,t,i,d,n,r,a,l)}_executeLineComments(e,t,i,n){let s;i.shouldRemoveComments?s=Fl._createRemoveLineCommentsOperations(i.lines,n.startLineNumber):(Fl._normalizeInsertionPoint(e,i.lines,n.startLineNumber,this._tabSize),s=this._createAddLineCommentsOperations(i.lines,n.startLineNumber));const r=new V(n.positionLineNumber,n.positionColumn);for(let a=0,l=s.length;a<l;a++)t.addEditOperation(s[a].range,s[a].text),k.isEmpty(s[a].range)&&k.getStartPosition(s[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[a].text||"").length);this._selectionId=t.trackSelection(n)}_attemptRemoveBlockComment(e,t,i,n){let s=t.startLineNumber,r=t.endLineNumber;const a=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(s).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(n,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(s).indexOf(n,l+i.length),r=s),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),s=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(s).indexOf(i),l!==-1&&(d=e.getLineContent(s).indexOf(n,l+i.length))),l!==-1&&e.getLineContent(s).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(n=" "+n,d-=1),l!==-1&&d!==-1?ac._createRemoveBlockCommentOperations(new k(s,l+i.length+1,r,d+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),s=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!s||!s.blockCommentStartToken||!s.blockCommentEndToken)return;const r=s.blockCommentStartToken,a=s.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){const d=e.getLineContent(i.startLineNumber);let c=Xn(d);c===-1&&(c=d.length),l=ac._createAddBlockCommentOperations(new k(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=ac._createAddBlockCommentOperations(new k(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(const d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new k(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
653
653
  `),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=Fl._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new xe(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(oi.delete(new k(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(oi.insert(new V(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=Fl.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Fl.nextVisibleColumn(h,n,c.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class kR extends we{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Wt);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>k.compareRangesUsingStarts(c.selection,h.selection));let d=l[0];for(let c=1;c<l.length;c++){const h=l[c];d.selection.endLineNumber===h.selection.startLineNumber&&(d.index<h.index?h.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=h))}for(const c of l)s.push(new Fl(i,c.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Kue extends kR{constructor(){super(0,{id:"editor.action.commentLine",label:p("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:p({},"&&Toggle Line Comment"),order:1}})}}class jue extends kR{constructor(){super(1,{id:"editor.action.addCommentLine",label:p("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2081),weight:100}})}}class que extends kR{constructor(){super(2,{id:"editor.action.removeCommentLine",label:p("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:qi(2089,2099),weight:100}})}}class Gue extends we{constructor(){super({id:"editor.action.blockComment",label:p("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:M.writable,kbOpts:{kbExpr:M.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:p({},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Wt);if(!t.hasModel())return;const n=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new ac(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}de(Kue);de(jue);de(que);de(Gue);var Zue=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},kh=function(o,e){return function(t,i){e(t,i,o)}},TN;let yp=TN=class{static get(e){return e.getContribution(TN.ID)}constructor(e,t,i,n,s,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new se,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){const c=this._contextViewService.getContextViewElement(),h=d.srcElement;h.shadowRoot&&xu(c)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.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 n of this._editor.getSelections())if(n.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?N.SimpleEditorContext:N.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const r of s){const[,a]=r;let l=0;for(const d of a)if(d instanceof $_){const c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new Gf(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new dn)}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 n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=ji(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;n={x:l,y:d}}const s=this._editor.getOption(126)&&!rl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:r=>{const a=this._keybindingFor(r);if(a)return new up(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new up(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||$te(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const n=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),s=(d,c)=>new Gf(`menu-action-${++i}`,d,c,void 0),r=(d,c,h,u,g)=>{if(!c)return n({label:d,enabled:c,run:()=>{}});const f=_=>()=>{this._configurationService.updateValue(h,_)},m=[];for(const _ of g)m.push(n({label:_.label,checked:u===_.value,run:f(_.value)}));return s(d,m)},a=[];a.push(n({label:p("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new dn),a.push(n({label:p("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(p("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:p("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:p("context.minimap.size.fill","Fill"),value:"fill"},{label:p("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(p("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:p("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:p("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!rl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};yp.ID="editor.contrib.contextmenu";yp=TN=Zue([kh(1,Yo),kh(2,bd),kh(3,We),kh(4,Pt),kh(5,ra),kh(6,ft),kh(7,Eu)],yp);class Yue extends we{constructor(){super({id:"editor.action.showContextMenu",label:p("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=yp.get(t))===null||i===void 0||i.showContextMenu()}}yt(yp.ID,yp,2);de(Yue);class uD{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let n=0;n<t;n++)if(!this.selections[n].equalsSelection(e.selections[n]))return!1;return!0}}class gD{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class zu extends K{static get(e){return e.getContribution(zu.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{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 uD(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new gD(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 gD(new uD(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 gD(new uD(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}}zu.ID="editor.contrib.cursorUndoRedoController";class Xue extends we{constructor(){super({id:"cursorUndo",label:p("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:M.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;(n=zu.get(t))===null||n===void 0||n.cursorUndo()}}class Que extends we{constructor(){super({id:"cursorRedo",label:p("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;(n=zu.get(t))===null||n===void 0||n.cursorRedo()}}yt(zu.ID,zu,0);de(Xue);de(Que);class Jue{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 k(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 xe(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 xe(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.lineNumber<this.selection.endLineNumber){this.targetSelection=new xe(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new xe(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new xe(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function Eg(o){return ut?o.altKey:o.ctrlKey}class dd extends K{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._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)||(Eg(e)&&(this._modifierPressed=!0),this._mouseDown&&Eg(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(Eg(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===dd.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 n=(this._editor.getSelections()||[]).filter(s=>t.position&&s.containsPosition(t.position));if(n.length===1)this._dragSelection=n[0];else return}Eg(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 V(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const n=this._editor.getSelection();if(n){const{selectionStartLineNumber:s,selectionStartColumn:r}=n;i=[new xe(s,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(n=>n.containsPosition(t)?new xe(t.lineNumber,t.column,t.lineNumber,t.column):n);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(Eg(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(dd.ID,new Jue(this._dragSelection,t,Eg(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 k(e.lineNumber,e.column,e.lineNumber,e.column),options:dd._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()}}dd.ID="editor.contrib.dragAndDrop";dd.TRIGGER_KEY_VALUE=ut?6:5;dd._DECORATION_OPTIONS=Ze.register({description:"dnd-target",className:"dnd-target"});yt(dd.ID,dd,2);const zy=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){o(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}}();function IR(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function ege(o,e,t){const i={id:zy(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class _W{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 rt.some(this,([i,n])=>n.asFile())&&t.push("files"),bW(Gw(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Gw(e)}}function Gw(o){return o.toLowerCase()}function vW(o,e){return bW(Gw(o),e.map(Gw))}function bW(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const Uy=Object.freeze({create:o=>Ic(o.map(e=>e.toString())).join(`\r
654
654
  `),split:o=>o.split(`\r